summaryrefslogtreecommitdiffstats
path: root/docs/smart-sync.md
diff options
context:
space:
mode:
authorRahul Yadav <yadavrah@google.com>2026-10-08 16:27:03 +0000
committergerrit-scoped@luci-project-accounts.iam.gserviceaccount.com <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2026-10-12 02:14:30 -0700
commit178b66ee3e2e14df3502cb939cb0a43fc3b41685 (patch)
treedaf4d95e329f115f325c30239b316b0fe2eac074 /docs/smart-sync.md
parentbeda65323e8fb08199133b4779b9a5c079710f83 (diff)
downloadgit-repo-178b66ee3e2e14df3502cb939cb0a43fc3b41685.tar.gz
sync: keep smart sync override with -l
Splitting a sync into `repo sync -n` followed by `repo sync -l` should end up in the same state as a single `repo sync`. With smart sync it does not always: -n fetches the revisions pinned by the smart sync manifest and saves it as smart_sync_override.xml, but the following -l deletes that override and checks out ToT instead, unless the manifest sets sync-smartsync="true". So `repo sync -s -n` + `repo sync -l` lands on ToT, while `repo sync -s` lands on the pinned revisions. Without an explicit -s or -t, -l does not contact the manifest server, so it cannot choose new pins itself; the only consistent choice is to keep the override the previous -n left behind. Do that regardless of the manifest default. Syncs that choose a manifest themselves still replace or remove the override as before: any sync without -l, and -l combined with -s, -t, -m, --superproject-revision or --no-smart-sync. Smart sync stays non-sticky for regular syncs, and `repo sync -l --no-smart-sync` still discards the override to check out ToT. Bug: 569927750 Change-Id: Id06ff88e9f3183fae32e993e86630fc3e8de71a1 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/640965 Commit-Queue: Rahul Yadav <yadavrah@google.com> Tested-by: Rahul Yadav <yadavrah@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
Diffstat (limited to 'docs/smart-sync.md')
-rw-r--r--docs/smart-sync.md24
1 files changed, 14 insertions, 10 deletions
diff --git a/docs/smart-sync.md b/docs/smart-sync.md
index 77f7a9cf9..2da4b90e5 100644
--- a/docs/smart-sync.md
+++ b/docs/smart-sync.md
@@ -138,6 +138,20 @@ copy into `.repo/manifests/smart_sync_override.xml` so users can examine it.
138The next time `repo sync` is run, this file is automatically replaced or removed 138The next time `repo sync` is run, this file is automatically replaced or removed
139based on the current set of options. 139based on the current set of options.
140 140
141With `-l`/`--local-only` and no explicit `-s`/`--smart-sync` or
142`-t`/`--smart-tag`, repo does not contact the manifest server. Instead, it keeps
143using the existing `smart_sync_override.xml`, if there is one, whether it came
144from an explicit `-s`/`--smart-sync` or from the manifest's `sync-smartsync`
145default. This way, `repo sync -n` followed by `repo sync -l` ends up on the same
146revisions as the equivalent single `repo sync` (e.g. `repo sync -s -n` +
147`repo sync -l` matches `repo sync -s`). Pass `--no-smart-sync` to discard it and
148use the default manifest instead.
149
150`--no-manifest-update` only skips updating the manifest checkout. It does not
151affect Smart Sync: the default Smart Sync from `sync-smartsync` (see below)
152still runs, and an existing `smart_sync_override.xml` is replaced or removed as
153in a regular sync.
154
141### sync-smartsync (Manifest Attribute) 155### sync-smartsync (Manifest Attribute)
142 156
143The manifest can enable Smart Sync by default for all `repo sync` invocations 157The manifest can enable Smart Sync by default for all `repo sync` invocations
@@ -158,16 +172,6 @@ sync, as before. Options that specify an explicit target or manifest source
158(such as `-t`/`--smart-tag`, `-m`/`--manifest-name` or 172(such as `-t`/`--smart-tag`, `-m`/`--manifest-name` or
159`--superproject-revision`) will also disable the default Smart Sync behavior. 173`--superproject-revision`) will also disable the default Smart Sync behavior.
160 174
161With `-l`/`--local-only`, the default Smart Sync does not contact the manifest
162server. Instead, repo keeps using the `smart_sync_override.xml` from the last
163Smart Sync, if there is one. Pass `--no-smart-sync` to discard it and use the
164default manifest instead. These options do not change the behavior of an
165explicit `-s`/`--smart-sync`.
166
167`--no-manifest-update` only skips updating the manifest checkout. It does not
168affect Smart Sync: the default Smart Sync still runs, and an existing
169`smart_sync_override.xml` is replaced or removed as in a regular sync.
170
171### --smart-sync / -s 175### --smart-sync / -s
172 176
173Explicitly enables Smart Sync. Repo will call 177Explicitly enables Smart Sync. Repo will call