From d793553804c76677444709ebefd70f6e01c29525 Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Thu, 1 Dec 2022 20:18:46 +0000 Subject: [PATCH] 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 Tested-by: LaMont Jones Reviewed-by: Mike Frysinger --- subcmds/sync.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 REPO_BACKUP_OBJECTS = 'REPO_BACKUP_OBJECTS' _BACKUP_OBJECTS = os.environ.get(REPO_BACKUP_OBJECTS) != '0' -# Env var to implicitly turn auto-gc back on. +# Env var to implicitly turn auto-gc back on. This was added to allow a user to +# revert a change in default behavior in v2.29.9, and will be removed in a +# future release. _REPO_AUTO_GC = 'REPO_AUTO_GC' _AUTO_GC = os.environ.get(_REPO_AUTO_GC) == '1' @@ -1226,6 +1228,8 @@ later is required to fix a server side protocol bug. print(f"Will run `git gc --auto` because {_REPO_AUTO_GC} is set.", file=sys.stderr) opt.auto_gc = True + print(f'{_REPO_AUTO_GC} is deprecated and will be removed in a future' + 'release. Use `--auto-gc` instead.', file=sys.stderr) def Execute(self, opt, args): manifest = self.outer_manifest