<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tools/git-repo.git/docs/smart-sync.md, branch v2.69</title>
<subtitle>Mirror of gerrit.googlesource.com/git-repo</subtitle>
<id>https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.69</id>
<link rel='self' href='https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.69'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/'/>
<updated>2026-10-14T10:30:36+00:00</updated>
<entry>
<title>sync: Add GetApprovedManifestV2 with named request options</title>
<updated>2026-10-14T10:30:36+00:00</updated>
<author>
<name>Rahul Yadav</name>
<email>yadavrah@google.com</email>
</author>
<published>2026-10-01T16:34:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=3448df395478c2375d880e33bfc705a9ed36272b'/>
<id>urn:sha1:3448df395478c2375d880e33bfc705a9ed36272b</id>
<content type='text'>
Smart sync calls GetApprovedManifest(branch[, target]) over XML-RPC,
which only supports positional arguments.  Adding new request options
that way does not scale.

Add a GetApprovedManifestV2 method that takes a single struct of named
options and returns a struct:

  request:  {branch, target?, best_effort?}
  response: {success, manifest_xml?, error_message?}

Servers must ignore unknown options, so new options (e.g. criteria for
selecting a good build) can be added without another method.

The first new option is `best_effort`.  repo sets it when smart sync was
enabled implicitly by the manifest's sync-smartsync="true" default
rather than by -s.  The server may decline a best_effort request (e.g.
for rollout or cohort gating) by returning success=false.  The client
still owns the fallback policy: declined implicit requests fall back to
a regular sync, while explicit -s requests fail as before.

If the server does not implement GetApprovedManifestV2, repo falls back
to the legacy GetApprovedManifest call.

Bug: 545137090
Test: ./run_tests
Change-Id: I9297b728df26516012cb93dffc91d39c1fb0458f
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/636623
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Commit-Queue: Rahul Yadav &lt;yadavrah@google.com&gt;
Tested-by: Rahul Yadav &lt;yadavrah@google.com&gt;
</content>
</entry>
<entry>
<title>sync: keep smart sync override with -l</title>
<updated>2026-10-12T09:14:30+00:00</updated>
<author>
<name>Rahul Yadav</name>
<email>yadavrah@google.com</email>
</author>
<published>2026-10-08T16:27:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=178b66ee3e2e14df3502cb939cb0a43fc3b41685'/>
<id>urn:sha1:178b66ee3e2e14df3502cb939cb0a43fc3b41685</id>
<content type='text'>
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 &lt;yadavrah@google.com&gt;
Tested-by: Rahul Yadav &lt;yadavrah@google.com&gt;
Reviewed-by: Gavin Mak &lt;gavinmak@google.com&gt;
</content>
</entry>
<entry>
<title>sync: Support SYNC_BRANCH to override the smart sync branch</title>
<updated>2026-10-09T14:00:47+00:00</updated>
<author>
<name>Rahul Yadav</name>
<email>yadavrah@google.com</email>
</author>
<published>2026-10-06T14:07:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=340b587e94c5397de197cc59635cafa1c3c488fb'/>
<id>urn:sha1:340b587e94c5397de197cc59635cafa1c3c488fb</id>
<content type='text'>
`repo sync -s` always sends the manifest branch to the manifest server
as the `branch` argument of GetApprovedManifest. Some servers map one
manifest branch to several server-side (CI) branches, and the only way
to pick among them was indirectly through the target.

Honor a SYNC_BRANCH environment variable, mirroring SYNC_TARGET: if set
and non-empty, send it instead of the manifest branch. An empty value
is treated as unset. -t/--smart-tag is unaffected.

Bug: 568962967
Test: ./run_tests
Change-Id: I26700e8997c21487f83011258100fd91a5c87508
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/639123
Commit-Queue: Rahul Yadav &lt;yadavrah@google.com&gt;
Reviewed-by: Gavin Mak &lt;gavinmak@google.com&gt;
Tested-by: Rahul Yadav &lt;yadavrah@google.com&gt;
</content>
</entry>
<entry>
<title>sync: don't let --nmu affect smart sync</title>
<updated>2026-10-09T14:00:22+00:00</updated>
<author>
<name>Rahul Yadav</name>
<email>yadavrah@google.com</email>
</author>
<published>2026-10-08T16:25:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=0a4e68f9d28cf07d9b9a42a51f2c0c9645ec80da'/>
<id>urn:sha1:0a4e68f9d28cf07d9b9a42a51f2c0c9645ec80da</id>
<content type='text'>
--no-manifest-update has always meant "use the existing manifest
checkout as-is": it skips updating .repo/manifests and nothing else.
Smart sync pins do not come from that checkout but from the manifest
server, and an explicit `-s --nmu` already works that way.

The manifest-driven default smart sync (sync-smartsync="true") instead
treated --nmu like -l: it disabled the implicit smart sync and kept an
existing smart_sync_override.xml. So on such manifests `repo sync --nmu`
fetched and checked out the previous pins (or ToT if there were none)
instead of doing what `repo sync` does minus the manifest checkout
update.

Make --nmu orthogonal to smart sync again: it no longer disables the
default smart sync, and it no longer keeps the override. Both have to
change together; otherwise a failed implicit smart sync under --nmu
would fall back to ToT while leaving the override on disk. Only -l,
which skips fetching, keeps the override.

Bug: 569927750
Change-Id: I33730363df485d72cd86ae99bf5eb8399b58e81a
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/641264
Reviewed-by: Brian Gan &lt;brgan@google.com&gt;
Commit-Queue: Rahul Yadav &lt;yadavrah@google.com&gt;
Reviewed-by: Gavin Mak &lt;gavinmak@google.com&gt;
Tested-by: Rahul Yadav &lt;yadavrah@google.com&gt;
</content>
</entry>
<entry>
<title>sync: Support manifest-driven default smart sync</title>
<updated>2026-10-01T10:13:33+00:00</updated>
<author>
<name>Rahul Yadav</name>
<email>yadavrah@google.com</email>
</author>
<published>2026-08-11T09:38:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=d53a4278f5156d57d71fe401ba87efcd8435886a'/>
<id>urn:sha1:d53a4278f5156d57d71fe401ba87efcd8435886a</id>
<content type='text'>
Add support for enabling smart sync by default via the
sync-smartsync="true" attribute on the manifest &lt;default&gt; element.

When sync-smartsync is set to true in the manifest defaults:
- Plain `repo sync` triggers Smart Sync automatically.
- If that implicit Smart Sync fails (manifest server unreachable, or
  the returned manifest cannot be parsed), repo silently falls back to
  a regular ToT sync. The reason is logged with --verbose.
- `--no-smart-sync` CLI flag overrides the manifest default and
  syncs to ToT.
- Passing explicit `-s` / `--smart-sync` forces Smart Sync as before,
  and its failures are still fatal.
- `-t`, `--smart-tag`, `-m`, `--manifest-name`, and
  `--superproject-revision` disable the default smart sync.
- `-l` / `--local-only` and `--no-manifest-update` skip the manifest
  server and reuse the existing smart_sync_override.xml, if any.

Update docs, completion, regenerate man pages, and add tests for XML
parsing, serialization, CLI option resolution, and the fallback and
reuse paths.

Bug: 545137090
Change-Id: If75569c58dd525d170e9801e70ccbf02206a52f2
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/617641
Tested-by: Rahul Yadav &lt;yadavrah@google.com&gt;
Commit-Queue: Rahul Yadav &lt;yadavrah@google.com&gt;
Reviewed-by: Gavin Mak &lt;gavinmak@google.com&gt;
</content>
</entry>
<entry>
<title>sync: Support pluggable remote helpers for smart sync manifest server.</title>
<updated>2026-06-18T16:48:49+00:00</updated>
<author>
<name>Rahul Yadav</name>
<email>yadavrah@google.com</email>
</author>
<published>2026-06-08T15:28:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=39c0b6090071c1039faf9dea2be9ca285054e4f6'/>
<id>urn:sha1:39c0b6090071c1039faf9dea2be9ca285054e4f6</id>
<content type='text'>
Introduce support for pluggable remote helpers (declared via the
optional 'helper' attribute in &lt;manifest-server&gt;) to dynamically resolve
proxy addresses. Route the XML-RPC manifest server connection through
the resolved proxy.

Bug: b/517477903
Change-Id: I3b6b8ea2640bb077521df4b4a9e8a34a8c6ecdad
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/591642
Tested-by: Rahul Yadav &lt;yadavrah@google.com&gt;
Commit-Queue: Rahul Yadav &lt;yadavrah@google.com&gt;
Reviewed-by: Gavin Mak &lt;gavinmak@google.com&gt;
</content>
</entry>
<entry>
<title>docs: smart-sync: split out &amp; expand details</title>
<updated>2025-01-31T03:17:24+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2025-01-31T00:11:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=dfdf577e98f6e9b13a3236767316863b3a995c01'/>
<id>urn:sha1:dfdf577e98f6e9b13a3236767316863b3a995c01</id>
<content type='text'>
The existing documentation on smart-sync behavior is a bit light on
details, and out of date wrt what the code actually does.  Start a
dedicated document and fill it out more.

Change-Id: I1a8a3ac6edf9291d72182ad55db865035d9b683e
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/450002
Commit-Queue: Mike Frysinger &lt;vapier@google.com&gt;
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
Reviewed-by: Josip Sokcevic &lt;sokcevic@chromium.org&gt;
</content>
</entry>
</feed>
