sync: allow syncing groups with repo sync -g group

Similar to how repo init -g can restrict repo syncs to
a subset of the manifest globally, allow "repo sync -g" to only sync a
subset of projects from the manifest when running that specific
sync command.

Change-Id: I4929aad109de05c73a7db42bb27fd8d47eea32fc
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/609481
Reviewed-by: Mike Frysinger <vapier@google.com>
Commit-Queue: Andrew Chant <achant@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Tested-by: Andrew Chant <achant@google.com>
This commit is contained in:
Andrew Chant authored and gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com committed 2026-07-21 13:42:38 -07:00
1 parent 06c4f9e1cc
commit 0b82311632
4 files changed
+146

No files matched your search

+11
View File
@@ -558,6 +558,13 @@ later is required to fix a server side protocol bug.
help="temporary manifest to use for this sync",
metavar="NAME.xml",
)
p.add_option(
"-g",
"--groups",
help="sync projects matching the specific groups. Not persistent "
"unlike when used on init",
metavar="GROUP",
)
p.add_option(
"--clone-bundle",
action="store_true",
@@ -774,6 +781,7 @@ later is required to fix a server side protocol bug.
all_projects = self.GetProjects(
args,
groups=opt.groups,
missing_ok=True,
submodules_ok=opt.recurse_submodules,
manifest=manifest,
@@ -1103,6 +1111,7 @@ later is required to fix a server side protocol bug.
self._ReloadManifest(None, manifest)
all_projects = self.GetProjects(
args,
groups=opt.groups,
missing_ok=True,
submodules_ok=opt.recurse_submodules,
manifest=manifest,
@@ -2350,6 +2359,7 @@ later is required to fix a server side protocol bug.
all_projects = self.GetProjects(
args,
groups=opt.groups,
missing_ok=True,
submodules_ok=opt.recurse_submodules,
manifest=manifest,
@@ -3013,6 +3023,7 @@ later is required to fix a server side protocol bug.
self._ReloadManifest(None, manifest)
project_list = self.GetProjects(
args,
groups=opt.groups,
missing_ok=True,
submodules_ok=opt.recurse_submodules,
manifest=manifest,