summaryrefslogtreecommitdiff
path: root/subcmds
diff options
context:
space:
mode:
authorJosef Malmström <josef.malmstrom@arm.com>2026-07-16 11:09:40 +0200
committergerrit-scoped@luci-project-accounts.iam.gserviceaccount.com <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2026-07-21 00:19:21 -0700
commitdd1130352be015979413da0caa3cbd882ee5bf87 (patch)
treed603401070867fdef220e1b75eb0b70b85b40fb3 /subcmds
parenteeba6f268d0220bc928ed7af41d310dfbe215205 (diff)
downloadgit-repo-dd1130352be015979413da0caa3cbd882ee5bf87.tar.gz
git-repo-dd1130352be015979413da0caa3cbd882ee5bf87.zip
sync: Deprecate fetch-submodules flag names
The names for flags --fetch-submodules / --no-fetch-submodules are misleading, since they impact the full sync operation (fetch and checkout), not just the fetching. Introduce new flags --recurse-submodules / --no-recurse-submodules and treat the old ones as deprecated aliases. Change-Id: I78339a3e0496a855c222c1869b27b578507886a7 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/608881 Commit-Queue: Josef Malmstrom <Josef.Malmstrom@arm.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Josef Malmstrom <Josef.Malmstrom@arm.com>
Diffstat (limited to 'subcmds')
-rw-r--r--subcmds/sync.py50
1 files changed, 38 insertions, 12 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 5a635fa97..3fdb36afa 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -378,9 +378,12 @@ resumeable bundle file on a content delivery network. This
may be necessary if there are problems with the local Python
HTTP client or proxy configuration, but the Git binary works.
-The --fetch-submodules option enables fetching Git submodules
-of all projects from the server. The --no-fetch-submodules option disables
-fetching Git submodules, even when a project has sync-s="true" in the manifest.
+The --recurse-submodules option enables syncing Git submodules of all projects
+from the server. The --no-recurse-submodules option disables syncing Git
+submodules, even when a project has sync-s="true" in the manifest.
+
+The --fetch-submodules and --no-fetch-submodules options are deprecated aliases
+for --recurse-submodules and --no-recurse-submodules, respectively.
The -c/--current-branch option can be used to only fetch objects that
are on the branch specified by a project's revision.
@@ -428,6 +431,15 @@ later is required to fix a server side protocol bug.
_JOBS_WARN_THRESHOLD = 100
+ @staticmethod
+ def _deprecated_submodules_option(option, opt_str, _value, parser):
+ enabled = opt_str == "--fetch-submodules"
+ replacement = (
+ "--recurse-submodules" if enabled else "--no-recurse-submodules"
+ )
+ logger.warning("%s is deprecated; use %s instead", opt_str, replacement)
+ setattr(parser.values, option.dest, enabled)
+
def _Options(self, p, show_smart=True):
p.add_option(
"--jobs-network",
@@ -570,15 +582,29 @@ later is required to fix a server side protocol bug.
help="password to authenticate with the manifest server",
)
p.add_option(
- "--fetch-submodules",
+ "--recurse-submodules",
action="store_true",
- help="fetch submodules from server",
+ help="sync submodules from server",
)
p.add_option(
- "--no-fetch-submodules",
- dest="fetch_submodules",
+ "--no-recurse-submodules",
+ dest="recurse_submodules",
action="store_false",
- help="don't fetch submodules from server",
+ help="don't sync submodules from server",
+ )
+ p.add_option(
+ "--fetch-submodules",
+ dest="recurse_submodules",
+ action="callback",
+ callback=self._deprecated_submodules_option,
+ help=optparse.SUPPRESS_HELP,
+ )
+ p.add_option(
+ "--no-fetch-submodules",
+ dest="recurse_submodules",
+ action="callback",
+ callback=self._deprecated_submodules_option,
+ help=optparse.SUPPRESS_HELP,
)
p.add_option(
"--use-superproject",
@@ -749,7 +775,7 @@ later is required to fix a server side protocol bug.
all_projects = self.GetProjects(
args,
missing_ok=True,
- submodules_ok=opt.fetch_submodules,
+ submodules_ok=opt.recurse_submodules,
manifest=manifest,
all_manifests=not opt.this_manifest_only,
)
@@ -1078,7 +1104,7 @@ later is required to fix a server side protocol bug.
all_projects = self.GetProjects(
args,
missing_ok=True,
- submodules_ok=opt.fetch_submodules,
+ submodules_ok=opt.recurse_submodules,
manifest=manifest,
all_manifests=not opt.this_manifest_only,
)
@@ -2325,7 +2351,7 @@ later is required to fix a server side protocol bug.
all_projects = self.GetProjects(
args,
missing_ok=True,
- submodules_ok=opt.fetch_submodules,
+ submodules_ok=opt.recurse_submodules,
manifest=manifest,
all_manifests=not opt.this_manifest_only,
)
@@ -2988,7 +3014,7 @@ later is required to fix a server side protocol bug.
project_list = self.GetProjects(
args,
missing_ok=True,
- submodules_ok=opt.fetch_submodules,
+ submodules_ok=opt.recurse_submodules,
manifest=manifest,
all_manifests=not opt.this_manifest_only,
)