1
0
Fork 0
git-repo/docs
Kenny Cheng 82d500eb7a sync: support post-sync hook in <repo-hooks>
Add support for a new hook type "post-sync" declared in the manifest using
<repo-hooks>. This allows executing a script automatically after a successful
`repo sync`.

This is useful for initializing developer environments, installing project-wide
Git hooks, generating configs, and other post-sync automation tasks.

Example manifest usage:

  <project name="myorg/repo-hooks" path="hooks" revision="main" />
  <repo-hooks in-project="myorg/repo-hooks" enabled-list="post-sync">
    <hook name="post-sync" />
  </repo-hooks>

The hook script must be named `post-sync.py` and located at the root of the
hook project.

The post-sync hook does not block `repo sync`; if the script fails, the sync
still completes successfully with a warning.

Test: Added `post-sync.py` in hook project and verified it runs after `repo sync`

Bug: b/421694721
Change-Id: I69f3158f0fc319d73a85028d6e90fea02c1dc8c8
Signed-off-by: Kenny Cheng <chao.shun.cheng.tw@gmail.com>
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/480581
Reviewed-by: Scott Lee <ddoman@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2025-07-01 16:11:50 -07:00
..
internal-fs-layout.md Update internal filesystem layout for submodules 2025-02-04 08:07:49 -08:00
manifest-format.md docs: smart-sync: split out & expand details 2025-01-30 19:17:24 -08:00
python-support.md docs: fix some grammar typos 2024-01-04 17:19:33 +00:00
release-process.md Add REPO_SKIP_SELF_UPDATE check in sync 2024-10-28 17:46:25 +00:00
repo-hooks.md sync: support post-sync hook in <repo-hooks> 2025-07-01 16:11:50 -07:00
smart-sync.md docs: smart-sync: split out & expand details 2025-01-30 19:17:24 -08:00
windows.md docs: update Windows info 2020-02-22 04:56:24 +00:00