summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
authorLaMont Jones <lamontjones@google.com>2022-12-01 20:18:46 +0000
committerLaMont Jones <lamontjones@google.com>2022-12-02 22:33:11 +0000
commitd793553804c76677444709ebefd70f6e01c29525 (patch)
treed3f3460331119d11d2bb910f6052f094deef1b3f /subcmds/sync.py
parentea5239ddd930624532cd1d0edccc0f3e74bec73f (diff)
downloadgit-repo-d793553804c76677444709ebefd70f6e01c29525.tar.gz
sync: mark REPO_AUTO_GC=1 as deprecated.
REPO_AUTO_GC was introduced as a way for users to restore the previous default behavior, since the default changed at the same time as the option was added. As such, it should be marked as deprecated, and removed entirely in a future release. Change-Id: Ib73d98fbea693e7057cc4587928c225a9e4beab2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/353734 Reviewed-by: Sam Saccone <samccone@google.com> Tested-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 1ed37cef..5b41046d 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -70,7 +70,9 @@ _ONE_DAY_S = 24 * 60 * 60
70REPO_BACKUP_OBJECTS = 'REPO_BACKUP_OBJECTS' 70REPO_BACKUP_OBJECTS = 'REPO_BACKUP_OBJECTS'
71_BACKUP_OBJECTS = os.environ.get(REPO_BACKUP_OBJECTS) != '0' 71_BACKUP_OBJECTS = os.environ.get(REPO_BACKUP_OBJECTS) != '0'
72 72
73# Env var to implicitly turn auto-gc back on. 73# Env var to implicitly turn auto-gc back on. This was added to allow a user to
74# revert a change in default behavior in v2.29.9, and will be removed in a
75# future release.
74_REPO_AUTO_GC = 'REPO_AUTO_GC' 76_REPO_AUTO_GC = 'REPO_AUTO_GC'
75_AUTO_GC = os.environ.get(_REPO_AUTO_GC) == '1' 77_AUTO_GC = os.environ.get(_REPO_AUTO_GC) == '1'
76 78
@@ -1226,6 +1228,8 @@ later is required to fix a server side protocol bug.
1226 print(f"Will run `git gc --auto` because {_REPO_AUTO_GC} is set.", 1228 print(f"Will run `git gc --auto` because {_REPO_AUTO_GC} is set.",
1227 file=sys.stderr) 1229 file=sys.stderr)
1228 opt.auto_gc = True 1230 opt.auto_gc = True
1231 print(f'{_REPO_AUTO_GC} is deprecated and will be removed in a future'
1232 'release. Use `--auto-gc` instead.', file=sys.stderr)
1229 1233
1230 def Execute(self, opt, args): 1234 def Execute(self, opt, args):
1231 manifest = self.outer_manifest 1235 manifest = self.outer_manifest