<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tools/git-repo.git/command.py, branch v2.66</title>
<subtitle>Mirror of gerrit.googlesource.com/git-repo</subtitle>
<id>https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.66</id>
<link rel='self' href='https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.66'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/'/>
<updated>2026-08-04T18:38:03+00:00</updated>
<entry>
<title>command: Respect smart sync override declaratively by default</title>
<updated>2026-08-04T18:38:03+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-05-19T02:07:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=4bec297eb6e5f30ea2fe2a2d8a92054cafa30e4f'/>
<id>urn:sha1:4bec297eb6e5f30ea2fe2a2d8a92054cafa30e4f</id>
<content type='text'>
Introduce a `RESPECT_SMART_SYNC_OVERRIDE` class attribute to the base
`Command` class, defaulting to `True`. This allows subcommands to
automatically respect the smart sync override manifest if it exists.

The override is applied in `CommonValidateOptions` before any
subcommand-specific validation or execution occurs. The `sync` and
`init` commands explicitly opt out.

This ensures all workspace-aware subcommands consistently align with the
active smart sync override manifest. It also fixes a bug in
multi-manifest setups where running a command from a submanifest would
not apply the override to the outer manifest, causing inconsistency when
resolving projects across all manifests.

Bug: 279204331
Change-Id: I9426e90a13a77ce6bd94b4a82efda4d485cbe116
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/585081
Reviewed-by: Mike Frysinger &lt;vapier@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>sync: Add CLI flag for globally disabling submodule fetch</title>
<updated>2026-07-16T08:19:51+00:00</updated>
<author>
<name>Josef Malmström</name>
<email>josef.malmstrom@arm.com</email>
</author>
<published>2026-07-13T10:50:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=978adb7ea504ae5c9238d03cea63f916035765c4'/>
<id>urn:sha1:978adb7ea504ae5c9238d03cea63f916035765c4</id>
<content type='text'>
A global setting for disabling fetching of submodules is useful
since this can currently otherwise only be done by modifying
the manifest, or by explicitly providing projects on command line.

Add this setting as --no-fetch-submodules to mirror the existing
--fetch-submodules.

Change-Id: Ic727c54f11a594aa52315751284b87138cf246bb
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/607641
Commit-Queue: Josef Malmstrom &lt;Josef.Malmstrom@arm.com&gt;
Reviewed-by: Gavin Mak &lt;gavinmak@google.com&gt;
Tested-by: Josef Malmstrom &lt;Josef.Malmstrom@arm.com&gt;
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>Fix submodules not synced for repeated repo</title>
<updated>2026-05-20T13:05:57+00:00</updated>
<author>
<name>Josef Malmström</name>
<email>josef.malmstrom@arm.com</email>
</author>
<published>2026-05-06T14:19:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=1b4e7a04be7b49d8c0c5e161d36f209bca4b6498'/>
<id>urn:sha1:1b4e7a04be7b49d8c0c5e161d36f209bca4b6498</id>
<content type='text'>
If I check out e.g. multiple branches of the same repo in one
manifest, only the submodules of one checkout are synced.

Fix this by adding the relative path  of the checkout as a key
to the mapping of derived projects, preventing overwrite.

The fix was originally proposed here:
https://issues.gerritcodereview.com/issues/40013218

Bug: 40013218
Change-Id: Ia86518ccf2c0af7bd7e4daf8d703a55b7e10ba52
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/581062
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Reviewed-by: Gavin Mak &lt;gavinmak@google.com&gt;
Commit-Queue: Josef Malmstrom &lt;Josef.Malmstrom@arm.com&gt;
Tested-by: Josef Malmstrom &lt;Josef.Malmstrom@arm.com&gt;
</content>
</entry>
<entry>
<title>command: Move smart sync override logic to Command base class</title>
<updated>2026-05-14T20:19:26+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-05-12T20:21:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=d453273f0638f7090846a9f95e3cae578569a6c7'/>
<id>urn:sha1:d453273f0638f7090846a9f95e3cae578569a6c7</id>
<content type='text'>
Deduplicate the logic for loading `smart_sync_override.xml` by
moving it from `forall.py` to the `Command` base class. This allows
other commands to reuse it to respect smart tags.

Bug: 279204331
Change-Id: I6f2f03995266c2a68c3225cacb92b2f580a89178
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/582502
Tested-by: Gavin Mak &lt;gavinmak@google.com&gt;
Commit-Queue: Gavin Mak &lt;gavinmak@google.com&gt;
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>sync: Re-raise KeyboardInterrupt in main process</title>
<updated>2026-05-12T17:41:47+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2026-05-11T22:56:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=d5037230e94e50c30698f9dd8d9404e293e23c7e'/>
<id>urn:sha1:d5037230e94e50c30698f9dd8d9404e293e23c7e</id>
<content type='text'>
When running sync -j1, worker functions run directly in the main
process. Swallowing KeyboardInterrupt causes the loop to continue to the
next project instead of aborting.

Re-raise KeyboardInterrupt if running in the MainProcess, while
maintaining the suppression of stack traces in worker processes.

Bug: 468170157
Change-Id: I156d66bc209a265f7fa25eea0eb88737d1b51a34
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/581342
Commit-Queue: Gavin Mak &lt;gavinmak@google.com&gt;
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Tested-by: Gavin Mak &lt;gavinmak@google.com&gt;
</content>
</entry>
<entry>
<title>Rename XmlManifest.GetGroupsStr() to XmlManifest.GetManifestGroupsStr()</title>
<updated>2025-12-03T15:57:22+00:00</updated>
<author>
<name>Peter Kjellerstedt</name>
<email>pkj@axis.com</email>
</author>
<published>2025-11-18T19:13:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=2b6de52a36d5d38c7b9a92d7f61e1f0daf4dec69'/>
<id>urn:sha1:2b6de52a36d5d38c7b9a92d7f61e1f0daf4dec69</id>
<content type='text'>
This makes it more clear what kind of groups it refers to.

Change-Id: I47369050d1436efcc77f3a69d5b7c99a536b23bc
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/528462
Tested-by: Peter Kjellerstedt &lt;peter.kjellerstedt@axis.com&gt;
Reviewed-by: Gavin Mak &lt;gavinmak@google.com&gt;
Commit-Queue: Peter Kjellerstedt &lt;peter.kjellerstedt@axis.com&gt;
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>Remove gitc support from repo</title>
<updated>2024-12-03T22:27:56+00:00</updated>
<author>
<name>Josip Sokcevic</name>
<email>sokcevic@google.com</email>
</author>
<published>2024-12-03T21:29:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=cf411b3f03c3bd6001701136be5a874a85f1dc91'/>
<id>urn:sha1:cf411b3f03c3bd6001701136be5a874a85f1dc91</id>
<content type='text'>
gitc is no longer available.

Change-Id: I0cbfdf936832f2cdd4876104ae3cc5a6e26154e2
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/444841
Reviewed-by: Gavin Mak &lt;gavinmak@google.com&gt;
Commit-Queue: Josip Sokcevic &lt;sokcevic@google.com&gt;
Tested-by: Josip Sokcevic &lt;sokcevic@google.com&gt;
</content>
</entry>
<entry>
<title>subcmds: reduce multiprocessing serialization overhead</title>
<updated>2024-10-23T23:34:34+00:00</updated>
<author>
<name>Kuang-che Wu</name>
<email>kcwu@google.com</email>
</author>
<published>2024-10-22T13:04:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=8da4861b3860c505e39341b4135c21f67569e4d8'/>
<id>urn:sha1:8da4861b3860c505e39341b4135c21f67569e4d8</id>
<content type='text'>
Follow the same approach as 39ffd9977e to reduce serialization overhead.

Below benchmarks are tested with 2.7k projects on my workstation
(warm cache). git tracing is disabled for benchmark.

(seconds)              | v2.48 | v2.48 | this CL | this CL
	               |       |  -j32 |         |    -j32
-----------------------------------------------------------
with clean tree state:
branches (none)        |   5.6 |   5.9 |    1.0  |    0.9
status (clean)         |  21.3 |   9.4 |   19.4  |    4.7
diff (none)            |   7.6 |   7.2 |    5.7  |    2.2
prune (none)           |   5.7 |   6.1 |    1.3  |    1.2
abandon (none)         |  19.4 |  18.6 |    0.9  |    0.8
upload (none)          |  19.7 |  18.7 |    0.9  |    0.8
forall -c true         |   7.5 |   7.6 |    0.6  |    0.6
forall -c "git log -1" |  11.3 |  11.1 |    0.6  |    0.6

with branches:
start BRANCH --all     |  21.9 |  20.3 |   13.6  |    2.6
checkout BRANCH        |  29.1 |  27.8 |    1.1  |    1.0
branches (2)           |  28.0 |  28.6 |    1.5  |    1.3
abandon BRANCH         |  29.2 |  27.5 |    9.7  |    2.2

Bug: b/371638995
Change-Id: I53989a3d1e43063587b3f52f852b1c2c56b49412
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/440221
Reviewed-by: Josip Sokcevic &lt;sokcevic@google.com&gt;
Tested-by: Kuang-che Wu &lt;kcwu@google.com&gt;
Commit-Queue: Kuang-che Wu &lt;kcwu@google.com&gt;
</content>
</entry>
<entry>
<title>sync: reduce multiprocessing serialization overhead</title>
<updated>2024-10-23T02:58:45+00:00</updated>
<author>
<name>Kuang-che Wu</name>
<email>kcwu@google.com</email>
</author>
<published>2024-10-18T15:32:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=39ffd9977e2f6cb1ca1757e59173fc93e0eab72c'/>
<id>urn:sha1:39ffd9977e2f6cb1ca1757e59173fc93e0eab72c</id>
<content type='text'>
Background:
 - Manifest object is large (for projects like Android) in terms of
   serialization cost and size (more than 1mb).
 - Lots of Project objects usually share only a few manifest objects.

Before this CL, Project objects were passed to workers via function
parameters. Function parameters are pickled separately (in chunk). In
other words, manifests are serialized again and again. The major
serialization overhead of repo sync was
  O(manifest_size * projects / chunksize)

This CL uses following tricks to reduce serialization overhead.
 - All projects are pickled in one invocation. Because Project objects
   share manifests, pickle library remembers which objects are already
   seen and avoid the serialization cost.
 - Pass the Project objects to workers at worker intialization time.
   And pass project index as function parameters instead. The number of
   workers is much smaller than the number of projects.
 - Worker init state are shared on Linux (fork based). So it requires
   zero serialization for Project objects.

On Linux (fork based), the serialization overhead is
  O(projects)  --- one int per project
On Windows (spawn based), the serialization overhead is
  O(manifest_size * min(workers, projects))

Moreover, use chunksize=1 to avoid the chance that some workers are idle
while other workers still have more than one job in their chunk queue.

Using 2.7k projects as the baseline, originally "repo sync" no-op
sync takes 31s for fetch and 25s for checkout on my Linux workstation.
With this CL, it takes 12s for fetch and 1s for checkout.

Bug: b/371638995
Change-Id: Ifa22072ea54eacb4a5c525c050d84de371e87caa
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/439921
Tested-by: Kuang-che Wu &lt;kcwu@google.com&gt;
Reviewed-by: Josip Sokcevic &lt;sokcevic@google.com&gt;
Commit-Queue: Kuang-che Wu &lt;kcwu@google.com&gt;
</content>
</entry>
<entry>
<title>cleanup: use new dict &amp; set generator styles</title>
<updated>2023-10-21T00:55:01+00:00</updated>
<author>
<name>Jason R. Coombs</name>
<email>jaraco@jaraco.com</email>
</author>
<published>2023-10-20T17:44:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=0bcffd865616a0a14b7e9f2b03d77da2444d3025'/>
<id>urn:sha1:0bcffd865616a0a14b7e9f2b03d77da2444d3025</id>
<content type='text'>
Change-Id: Ie34ac33ada7855945c77238da3ce644f8a9f8306
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390374
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
Commit-Queue: Mike Frysinger &lt;vapier@google.com&gt;
Reviewed-by: Aravind Vasudevan &lt;aravindvasudev@google.com&gt;
</content>
</entry>
</feed>
