<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tools/git-repo.git, branch v2.65</title>
<subtitle>Mirror of gerrit.googlesource.com/git-repo</subtitle>
<id>https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.65</id>
<link rel='self' href='https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.65'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/'/>
<updated>2026-07-01T22:59:45+00:00</updated>
<entry>
<title>color: Treat "true" and "yes" as "auto", not "always"</title>
<updated>2026-07-01T22:59:45+00:00</updated>
<author>
<name>Brian Gan</name>
<email>brgan@google.com</email>
</author>
<published>2026-06-30T21:38:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=35bbf701d04de5c6a71937279bc3d16f6ce36808'/>
<id>urn:sha1:35bbf701d04de5c6a71937279bc3d16f6ce36808</id>
<content type='text'>
Per the git documentation for color.ui [1], setting color.ui to "true"
(or "yes") should behave identically to "auto", enabling color only
when output is written to a terminal or an active pager. Previously,
repo was equating "true" and "yes" with "always", which caused color
escape codes to be emitted unconditionally, even when output was piped
or redirected.

Replace the duplicated string-matching logic in SetDefaultColoring and
Coloring.__init__ with a single CONFIG_TO_COLOR_SETTING dict that maps
all git color config values to their behavior. This makes the mapping
easy to verify against the git docs and impossible to get out of sync
between the two call sites.

Added tests for SetDefaultColoring and Coloring.__init__ covering
all color mode values (auto, true, yes, always, never, no, false),
case insensitivity, TTY vs pipe behavior, active pager detection,
and unrecognised input.

[1] https://git-scm.com/docs/git-config#Documentation/git-config.txt-colorui

Bug: 295841573
Change-Id: I8a04b9c7e4154de37ed7518c010233039e0afdc9
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/602981
Tested-by: Brian Gan &lt;brgan@google.com&gt;
Reviewed-by: Gavin Mak &lt;gavinmak@google.com&gt;
Commit-Queue: Brian Gan &lt;brgan@google.com&gt;
</content>
</entry>
<entry>
<title>agents: run review agents manually</title>
<updated>2026-07-01T22:45:23+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-07-01T22:39:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=881af15cdc4a72894adc9e6b9504e6ca6d4d7c8e'/>
<id>urn:sha1:881af15cdc4a72894adc9e6b9504e6ca6d4d7c8e</id>
<content type='text'>
The review agents are broken right now, so don't run them automatically.
They should still be runnable on demand.

Change-Id: I22e5ff46f917a49d0c267a0b1e8c63ae2165347d
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/603461
Reviewed-by: Brian Gan &lt;brgan@google.com&gt;
Commit-Queue: Brian Gan &lt;brgan@google.com&gt;
Tested-by: Gavin Mak &lt;gavinmak@google.com&gt;
Tested-by: Brian Gan &lt;brgan@google.com&gt;
</content>
</entry>
<entry>
<title>tests: Fix test compatibility with Python 3.14 forkserver</title>
<updated>2026-06-30T22:35:57+00:00</updated>
<author>
<name>Brian Gan</name>
<email>brgan@google.com</email>
</author>
<published>2026-06-30T21:11:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=fbc9c7919246ea74c295be888db4ae332cced202'/>
<id>urn:sha1:fbc9c7919246ea74c295be888db4ae332cced202</id>
<content type='text'>
Python 3.14 changed the default multiprocessing start method on Linux
from "fork" to "forkserver". The test_forall_all_projects_called_once
test uses mock.patch.object on Project.GetRevisionId, but class-level
mock patches do not survive into forkserver worker processes because
they start from a clean Python interpreter rather than inheriting the
parent's memory.

Replace the mock with setting revisionId directly on each Project
instance so GetRevisionId() short-circuits without touching git.
This works with any multiprocessing start method since the string
attribute is part of the Project objects stored in _parallel_context,
which is properly serialized to workers via initargs.

Bug: 425319437
Change-Id: Icd3bbd010921d7652bb2425fad85974df9198367
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/602941
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: Implement fetchcmd for standard Git layouts</title>
<updated>2026-06-30T20:20:15+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-06-15T23:23:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=ead4b2d7aa86fde803066f59c1dda94aefe2b9fe'/>
<id>urn:sha1:ead4b2d7aa86fde803066f59c1dda94aefe2b9fe</id>
<content type='text'>
Introduce support for `repo.fetchcmd` configuration, allowing users to
specify a custom command to fetch project data instead of
`_RemoteFetch`.

When `repo.fetchcmd` is specified, `repo` will execute it instead of
`_RemoteFetch` during the network half of sync. Note that
`repo.fetchcmd` requires `repo.uselocalgitdirs` to be enabled.

The command is executed in a subshell with project-context environment
variables, including the new `REPO_TREV` (target revision resolved to a
commit hash) and `REPO_PROJECT_FETCH_URL`.

After execution, `repo` verifies that the target commit is available and
that the tracking ref and FETCH_HEAD are correctly updated.

Tested with:
```
&gt; ~/git-repo/repo init -u https://android-review.googlesource.com/platform/manifest \
    --repo-url file:///usr/local/google/home/gavinmak/git-repo \
    --groups developers \
    --no-repo-verify \
    --use-local-gitdirs
...

&gt; git config --file .repo/manifests.git/config repo.fetchcmd 'mkdir -p $REPO_PATH &amp;&amp; cd $REPO_PATH &amp;&amp; if [ ! -d .git ]; then git init &amp;&amp; git remote add aosp $REPO_PROJECT_FETCH_URL; fi &amp;&amp; git fetch aosp $REPO_TREV &amp;&amp; git reset --hard $REPO_TREV &amp;&amp; mkdir -p .git/refs/remotes/aosp &amp;&amp; echo $REPO_TREV &gt; .git/refs/remotes/aosp/main &amp;&amp; echo $REPO_TREV &gt; .git/FETCH_HEAD'

&gt; ~/git-repo/repo sync -j32
warning: repo is not tracking a remote branch, so it will not receive updates; run `repo init --repo-rev=stable` to fix.
You are currently enrolled in Git submodules experiment (go/android-submodules-quickstart).  Use --no-use-superproject to override.

Syncing: 100% (4/4), done in 1m15.686s
Finalizing sync state...
repo sync has finished successfully.
```

Bug: 513329573
Change-Id: I754d3f3c78e86fdeee1a72115297a75b571bc497
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/583883
Reviewed-by: Becky Siegel &lt;beckysiegel@google.com&gt;
Tested-by: Gavin Mak &lt;gavinmak@google.com&gt;
Commit-Queue: Gavin Mak &lt;gavinmak@google.com&gt;
</content>
</entry>
<entry>
<title>status: Show ahead/behind info for local branches</title>
<updated>2026-06-30T18:13:14+00:00</updated>
<author>
<name>Brian Gan</name>
<email>brgan@google.com</email>
</author>
<published>2026-06-29T20:15:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=e7cac4bca6b8e4276a5a64287653b5c56555d6f4'/>
<id>urn:sha1:e7cac4bca6b8e4276a5a64287653b5c56555d6f4</id>
<content type='text'>
When viewing `repo status`, it is difficult to distinguish between branches that have active unpushed changes and stale branches that are fully synced. Previously, developers had to run commands like `repo forall -c "git status"` to see their ahead/behind counts.

This change updates Project.PrintWorkTreeStatus to automatically calculate and display the number of commits a branch is ahead and/or behind its upstream tracking branch. We use `git rev-list --left-right --count` to fetch this information natively and efficiently.

If the branch is completely synced with upstream, no extra text is shown.

Added tests for ahead-only, behind-only, diverged, no-tracking, and fully-synced branch states.

Bug: 319412954
Change-Id: I23879b2d472c7a7e11d01b565428a84b1b4f09c1
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/602423
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>info: Parallelize project data gathering for JSON output</title>
<updated>2026-06-30T16:19:35+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-06-29T17:42:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=91986011b012ca7cf881246976282dd581b88ad3'/>
<id>urn:sha1:91986011b012ca7cf881246976282dd581b88ad3</id>
<content type='text'>
https://gerrit-review.googlesource.com/c/git-repo/+/581921 parallelized
`repo info` for text output. This commit does the same for JSON output
format.

Benchmarked `repo info --format=json` on an Android workspace with ~3k
projects (N=3):
- Before (sequential): 1m 30s average
- After (parallelized): 46s average (~2x speedup)

Verified that the JSON output is identical before and after.

Bug: 526685287
Change-Id: If573223aba584f8b932f87d29e34ed565c5c930a
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/601861
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>git_trace2_event_log: Fix index out of range on empty config values</title>
<updated>2026-06-30T11:44:38+00:00</updated>
<author>
<name>Rahul Yadav</name>
<email>yadavrah@google.com</email>
</author>
<published>2026-06-29T09:27:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=a27dbcdb7bba1b8a2cc84112fa31c8f9f818604e'/>
<id>urn:sha1:a27dbcdb7bba1b8a2cc84112fa31c8f9f818604e</id>
<content type='text'>
In git_trace2_event_log_base.py's GetDataEventName method, it parses
value to identify if it represents a JSON list. When a config key has an
empty string value, GetDataEventName evaluates value[0], which raises
IndexError: string index out of range.

This change fixes the crash by checking if the value is a string and using
startswith/endswith to check for JSON lists instead of direct indexing.

Test: PYTHONPATH=. pytest tests/test_git_trace2_event_log.py

Bug: 512518342
TAG=agy
CONV=ff5d70d7-e5b3-42b3-8f16-23b9e3070754

Change-Id: Ic40a8c6a22df57d0e97f268f6e1bc8a14a5024a4
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/602201
Reviewed-by: Gavin Mak &lt;gavinmak@google.com&gt;
Tested-by: Rahul Yadav &lt;yadavrah@google.com&gt;
Commit-Queue: Rahul Yadav &lt;yadavrah@google.com&gt;
</content>
</entry>
<entry>
<title>repo: Normalize GNUPGHOME path for MSYS GPG on Windows</title>
<updated>2026-06-29T18:06:23+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-06-24T21:24:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=547dc9985ca6d401284b7ee0018721e8aa3324d3'/>
<id>urn:sha1:547dc9985ca6d401284b7ee0018721e8aa3324d3</id>
<content type='text'>
Convert GNUPGHOME to a POSIX path using cygpath on Windows
so MSYS GPG can read it correctly.

Bug: 510840000
Change-Id: I7d25564dd6521f6e887ff45548f42984e709ef5e
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/601121
Tested-by: Gavin Mak &lt;gavinmak@google.com&gt;
Reviewed-by: Brian Gan &lt;brgan@google.com&gt;
Commit-Queue: Gavin Mak &lt;gavinmak@google.com&gt;
</content>
</entry>
<entry>
<title>info: Report actual checked-out HEAD revision</title>
<updated>2026-06-29T17:50:02+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-06-22T22:36:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=88a7e88e54d27f8d6068ba3d86fe61c291ab76a5'/>
<id>urn:sha1:88a7e88e54d27f8d6068ba3d86fe61c291ab76a5</id>
<content type='text'>
When `repo info` runs, the reported "Current revision" is resolved using
the manifest's target branch tracking ref (e.g. refs/remotes/goog/main).

Introduce Project.GetHeadRevisionId(), which gets the checked-out HEAD
commit in the worktree, and use it in `repo info` with a fallback to the
old behavior if the project is not checked out.

Bug: 526685287
Change-Id: I72280ce27daa210cada27d722a94e365644f06e0
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/599481
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>git_config: Support SHA-256 object IDs</title>
<updated>2026-06-26T22:40:55+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-06-23T22:47:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=c21a41c7ccc0350841cb57733f845dd2054bd285'/>
<id>urn:sha1:c21a41c7ccc0350841cb57733f845dd2054bd285</id>
<content type='text'>
Update ID_RE to match both 40-char (SHA-1) and 64-char (SHA-256) IDs as
part of Git 3.0 support.

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