<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tools/git-repo.git/project.py, branch v2.70</title>
<subtitle>Mirror of gerrit.googlesource.com/git-repo</subtitle>
<id>https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.70</id>
<link rel='self' href='https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.70'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/'/>
<updated>2026-10-13T20:55:40+00:00</updated>
<entry>
<title>repo: tolerate a transiently missing stable branch</title>
<updated>2026-10-13T20:55:40+00:00</updated>
<author>
<name>Brian Gan</name>
<email>brgan@google.com</email>
</author>
<published>2026-10-13T19:47:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=a110680ff3e0d3e8504edf4457dff759801ad011'/>
<id>urn:sha1:a110680ff3e0d3e8504edf4457dff759801ad011</id>
<content type='text'>
The automated release process deletes the stable branch and then
recreates it. A client that fetches during that window can't find it:
`repo init` fails to resolve --repo-rev, and the daily self-update in
`repo sync` fails with "Cannot fetch repo tool".

In the launcher, if --repo-rev doesn't resolve after the initial fetch,
wait 10 seconds and refetch once before giving up. `resolve_repo_rev`
gains a `report_errors` flag so this first check doesn't print an error
that the refetch then fixes. Bump the launcher version to 2.69 so
existing users pick this up.

For fetches of the repo project itself (sync's self-update and
`repo selfupdate`), wait 10 seconds instead of 4 before retrying. The
delay is now a `RETRY_SLEEP_INITIAL_SEC` class attribute that
`RepoProject` overrides, so other projects keep the 4 second delay. This
replaces the unused `retry_sleep_initial_sec` parameter of
`_RemoteFetch`.

Bug: 566270786
Change-Id: I23cb810258522b5aa9eae9d7013dbb7904ebcad8
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/643265
Tested-by: Brian Gan &lt;brgan@google.com&gt;
Commit-Queue: Brian Gan &lt;brgan@google.com&gt;
Reviewed-by: Gavin Mak &lt;gavinmak@google.com&gt;
</content>
</entry>
<entry>
<title>sync: skip clone.bundle when repo.fetchcmd is configured</title>
<updated>2026-10-09T21:09:50+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-10-08T22:59:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=beda65323e8fb08199133b4779b9a5c079710f83'/>
<id>urn:sha1:beda65323e8fb08199133b4779b9a5c079710f83</id>
<content type='text'>
In Sync_NetworkHalf, clone_bundle defaults to True on initial sync when
self.objdir does not exist yet, and _ApplyCloneBundle is called before
custom_fetch_configured is checked.

For remotes with HTTP/HTTPS URLs that serve /clone.bundle, this causes
repo sync to download and unpack the full clone.bundle into .git/objects
before invoking repo.fetchcmd.

Skip _ApplyCloneBundle when custom_fetch_configured is enabled so
repo.fetchcmd exclusively handles object fetching.

Bug: 543101585
Change-Id: If41a775a75589ad5a23106163f9932e2940b72d2
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/641685
Commit-Queue: Gavin Mak &lt;gavinmak@google.com&gt;
Reviewed-by: Brian Gan &lt;brgan@google.com&gt;
Tested-by: Gavin Mak &lt;gavinmak@google.com&gt;
</content>
</entry>
<entry>
<title>project: peel annotated tags in GetRevisionId with cached refs</title>
<updated>2026-10-09T21:09:44+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-10-01T19:54:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=02e07525f9d66e269f9614f7217f815a977b3033'/>
<id>urn:sha1:02e07525f9d66e269f9614f7217f815a977b3033</id>
<content type='text'>
When all_refs (e.g. self.bare_ref.all in Sync_LocalHalf) is passed to
GetRevisionId, looking up a tag ref in all_refs returns the tag object
SHA for annotated tags rather than the peeled commit SHA.

In Sync_LocalHalf, this causes repo.reprojectcmd to receive a tag SHA in
REPO_TREV and DetachHead to fail with 'trying to write non-commit object
to branch HEAD', and causes standard checkouts to re-checkout on every
subsequent sync because HEAD (the commit SHA) never equals revid (the
tag object SHA).

Skip the all_refs fast path for refs/tags/* so tags always fall through
to bare_git.ResolveCommit, which peels to the underlying commit SHA.

Bug: 543101585
Change-Id: Ie4afa3cee9149e2a8438bd8fb4a8026a210848d8
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/641683
Commit-Queue: Gavin Mak &lt;gavinmak@google.com&gt;
Reviewed-by: Brian Gan &lt;brgan@google.com&gt;
Tested-by: Gavin Mak &lt;gavinmak@google.com&gt;
</content>
</entry>
<entry>
<title>sync: don't run git ls-remote before fetchcmd on unpinned refs</title>
<updated>2026-10-09T21:09:37+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-10-07T21:40:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=2e8a3805bb016bcaa7ca422fffbb1da22dd00605'/>
<id>urn:sha1:2e8a3805bb016bcaa7ca422fffbb1da22dd00605</id>
<content type='text'>
When a project's revision is an unpinned branch or tag and superprojects
are not used (so self.revisionId is unset), _CustomFetch previously ran
git ls-remote against the Git remote before invoking repo.fetchcmd just
to pre-populate REPO_TREV.

This added a per-project network round-trip before fetchcmd and forced
branch resolution against the Git remote rather than letting fetchcmd
resolve REPO_RREV from its own server (just as standard git fetch does
in _RemoteFetch).

Only populate REPO_TREV before fetchcmd when the target commit SHA is
already known (via self.revisionId from superproject or a SHA-pinned
revisionExpr). When REPO_RREV is an unpinned branch or tag, leave
REPO_TREV empty, let fetchcmd resolve REPO_RREV and update the local
tracking ref and FETCH_HEAD, and verify afterward that the tracking ref
and FETCH_HEAD resolve to the same valid commit in the object store.

Bug: 543101585
Change-Id: I482bf4c022d0e669e5620d4517581ac193983da0
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/640423
Reviewed-by: Brian Gan &lt;brgan@google.com&gt;
Commit-Queue: Gavin Mak &lt;gavinmak@google.com&gt;
Tested-by: Gavin Mak &lt;gavinmak@google.com&gt;
</content>
</entry>
<entry>
<title>sync: roll back repo when stable is rewound</title>
<updated>2026-10-09T16:49:49+00:00</updated>
<author>
<name>Brian Gan</name>
<email>brgan@google.com</email>
</author>
<published>2026-10-07T22:09:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=9293cda144a547303db902f4e9b535c6cb58ffde'/>
<id>urn:sha1:9293cda144a547303db902f4e9b535c6cb58ffde</id>
<content type='text'>
The documented way to roll back a bad release is to force push an older
release to stable, and docs/release-process.md says clients will then
automatically downgrade. _PostRepoFetch already supports switching to an
older commit, but it only runs when `RepoProject.HasChanges` is true,
and that used the `MetaProject` check of whether the remote has commits
that HEAD lacks. After a rewind it doesn't, so clients that had already
upgraded stayed on the bad release.

Make `RepoProject.HasChanges` true whenever the remote revision differs
from HEAD, in either direction. `ManifestProject` keeps the forward-only
check so local manifest commits are still rebased rather than dropped.

Bug: 571204396
Change-Id: I248507f434d2552ce11a9afabe9a6335cb24ddbd
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/640130
Reviewed-by: Gavin Mak &lt;gavinmak@google.com&gt;
Tested-by: Brian Gan &lt;brgan@google.com&gt;
Commit-Queue: Brian Gan &lt;brgan@google.com&gt;
</content>
</entry>
<entry>
<title>init: don't suggest --no-use-superproject on failure</title>
<updated>2026-09-24T20:54:06+00:00</updated>
<author>
<name>Ram Peri</name>
<email>ramperi@google.com</email>
</author>
<published>2026-09-24T19:53:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=9066409c2ddc24bbd2405f66e3358d479a17038f'/>
<id>urn:sha1:9066409c2ddc24bbd2405f66e3358d479a17038f</id>
<content type='text'>
When the superproject can't be fetched, repo init warns and tells users
to re-run repo init with --no-use-superproject. That choice is saved in
the checkout config (repo.superproject), so following it disables the
superproject for that checkout until it is re-inited, even though these
failures are often transient.

Drop the recommendation and keep the rest of the warning.

This is the repo init counterpart of reverting
https://gerrit-review.googlesource.com/c/git-repo/+/305622 for repo sync
(https://gerrit-review.googlesource.com/c/git-repo/+/634804).

Bug: 565845573
Change-Id: I91a6e682ef1d1c6dee07bc7969de88a681e1d239
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/634784
Tested-by: Ram Peri &lt;ramperi@google.com&gt;
Reviewed-by: Sam Saccone &lt;samccone@google.com&gt;
Reviewed-by: Arif Kasim &lt;arifkasim@google.com&gt;
Commit-Queue: Ram Peri &lt;ramperi@google.com&gt;
</content>
</entry>
<entry>
<title>project: don't plan a stateless prune without a worktree</title>
<updated>2026-09-23T20:27:06+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-09-23T17:42:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=e1e215a14ea5373419acb8753b6865de19d1f122'/>
<id>urn:sha1:e1e215a14ea5373419acb8753b6865de19d1f122</id>
<content type='text'>
Skip stateless prune planning when a project's worktree directory
does not exist, preventing fetch failures on subsequent syncs.

Also run _LsRemote() bare so it does not depend on worktree
existence.

Bug: 565047698
Change-Id: I385cba4e06813d9113ec7ddc963e8499acffaec5
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/634426
Tested-by: Gavin Mak &lt;gavinmak@google.com&gt;
Commit-Queue: Gavin Mak &lt;gavinmak@google.com&gt;
Reviewed-by: Brian Gan &lt;brgan@google.com&gt;
</content>
</entry>
<entry>
<title>sync: skip the bloat check for projects without a worktree</title>
<updated>2026-09-23T20:27:01+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-09-23T17:27:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=175198b0aa22a54406be2b651020bb53c3c6d2b7'/>
<id>urn:sha1:175198b0aa22a54406be2b651020bb53c3c6d2b7</id>
<content type='text'>
Skip shallow clone bloat checks during --network-only syncs and
filter out projects whose worktree directory does not exist on disk.

Also return None quietly from _GetStatusSnapshot() when a project
lacks an existing worktree directory.

Bug: 565047698
Change-Id: Ia4c7db36a2bd78bc89e7b72f7a492b901b50efa7
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/634425
Commit-Queue: Gavin Mak &lt;gavinmak@google.com&gt;
Reviewed-by: Brian Gan &lt;brgan@google.com&gt;
Tested-by: Gavin Mak &lt;gavinmak@google.com&gt;
</content>
</entry>
<entry>
<title>project: don't rerun git status after a failed snapshot</title>
<updated>2026-09-23T20:26:55+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-09-23T17:25:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=310c99571f49e2d17f79853e69b7c17ff00f1bfc'/>
<id>urn:sha1:310c99571f49e2d17f79853e69b7c17ff00f1bfc</id>
<content type='text'>
When a status snapshot fails, fall back directly to _IsDirtyLegacy()
instead of IsDirty() to avoid running git status twice.

Expose Project.GetDirtyAndHead() so sync bloat checks can inspect
worktree state without invoking private Project methods.

Bug: 565047698
Change-Id: I6432ed82da88778eec9d151fd5b70bedb1efc62b
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/634424
Reviewed-by: Brian Gan &lt;brgan@google.com&gt;
Commit-Queue: Gavin Mak &lt;gavinmak@google.com&gt;
Tested-by: Gavin Mak &lt;gavinmak@google.com&gt;
</content>
</entry>
<entry>
<title>project: avoid unnecessary sync revision enumeration</title>
<updated>2026-09-21T20:40:01+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-08-25T15:57:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=f6f5946422097f2559cf3bc39a69d5fddc838ab8'/>
<id>urn:sha1:f6f5946422097f2559cf3bc39a69d5fddc838ab8</id>
<content type='text'>
Skip the detached-history walk when its count will not be printed, ask
rev-list --count for upstream gain, and cap the published-but-unmerged
existence probe at one commit. These preserve the decisions while
reducing traversal and output work.

Bug: 553599402
Change-Id: I30f769c9aa5269428ece15ffcb45c50993d7c4b8
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/634004
Commit-Queue: Gavin Mak &lt;gavinmak@google.com&gt;
Tested-by: Gavin Mak &lt;gavinmak@google.com&gt;
Reviewed-by: Brian Gan &lt;brgan@google.com&gt;
</content>
</entry>
</feed>
