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>
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 1ed37ce..5b41046 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -70,7 +70,9 @@
 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 @@
       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