diff options
| author | Rahul Yadav <yadavrah@google.com> | 2026-10-08 16:27:03 +0000 |
|---|---|---|
| committer | gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2026-10-12 02:14:30 -0700 |
| commit | 178b66ee3e2e14df3502cb939cb0a43fc3b41685 (patch) | |
| tree | daf4d95e329f115f325c30239b316b0fe2eac074 /docs/smart-sync.md | |
| parent | beda65323e8fb08199133b4779b9a5c079710f83 (diff) | |
| download | git-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.md | 24 |
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. | |||
| 138 | The next time `repo sync` is run, this file is automatically replaced or removed | 138 | The next time `repo sync` is run, this file is automatically replaced or removed |
| 139 | based on the current set of options. | 139 | based on the current set of options. |
| 140 | 140 | ||
| 141 | With `-l`/`--local-only` and no explicit `-s`/`--smart-sync` or | ||
| 142 | `-t`/`--smart-tag`, repo does not contact the manifest server. Instead, it keeps | ||
| 143 | using the existing `smart_sync_override.xml`, if there is one, whether it came | ||
| 144 | from an explicit `-s`/`--smart-sync` or from the manifest's `sync-smartsync` | ||
| 145 | default. This way, `repo sync -n` followed by `repo sync -l` ends up on the same | ||
| 146 | revisions 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 | ||
| 148 | use the default manifest instead. | ||
| 149 | |||
| 150 | `--no-manifest-update` only skips updating the manifest checkout. It does not | ||
| 151 | affect Smart Sync: the default Smart Sync from `sync-smartsync` (see below) | ||
| 152 | still runs, and an existing `smart_sync_override.xml` is replaced or removed as | ||
| 153 | in a regular sync. | ||
| 154 | |||
| 141 | ### sync-smartsync (Manifest Attribute) | 155 | ### sync-smartsync (Manifest Attribute) |
| 142 | 156 | ||
| 143 | The manifest can enable Smart Sync by default for all `repo sync` invocations | 157 | The 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 | ||
| 161 | With `-l`/`--local-only`, the default Smart Sync does not contact the manifest | ||
| 162 | server. Instead, repo keeps using the `smart_sync_override.xml` from the last | ||
| 163 | Smart Sync, if there is one. Pass `--no-smart-sync` to discard it and use the | ||
| 164 | default manifest instead. These options do not change the behavior of an | ||
| 165 | explicit `-s`/`--smart-sync`. | ||
| 166 | |||
| 167 | `--no-manifest-update` only skips updating the manifest checkout. It does not | ||
| 168 | affect 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 | ||
| 173 | Explicitly enables Smart Sync. Repo will call | 177 | Explicitly enables Smart Sync. Repo will call |
