diff --git a/git_command.py b/git_command.py index 5017ea9b..4868ccdf 100644 --- a/git_command.py +++ b/git_command.py @@ -28,8 +28,17 @@ from repo_trace import REPO_TRACE, IsTrace, Trace from wrapper import Wrapper GIT = 'git' -# Should keep in sync with the "repo" launcher file. -MIN_GIT_VERSION = (2, 10, 2) +# NB: These do not need to be kept in sync with the repo launcher script. +# These may be much newer as it allows the repo launcher to roll between +# different repo releases while source versions might require a newer git. +# +# The soft version is when we start warning users that the version is old and +# we'll be dropping support for it. We'll refuse to work with versions older +# than the hard version. +# +# git-1.7 is in (EOL) Ubuntu Precise. git-1.9 is in Ubuntu Trusty. +MIN_GIT_VERSION_SOFT = (1, 9, 1) +MIN_GIT_VERSION_HARD = (1, 7, 2) GIT_DIR = 'GIT_DIR' LAST_GITDIR = None diff --git a/repo b/repo index 2b125296..01d5c46d 100755 --- a/repo +++ b/repo @@ -166,7 +166,12 @@ TACbBS+Up3RpfYVfd63c1cDdlru13pQAn3NQy/SN858MkxN+zym86UBgOad2 """ GIT = 'git' # our git command -MIN_GIT_VERSION = (2, 10, 2) # minimum supported git version +# NB: The version of git that the repo launcher requires may be much older than +# the version of git that the main repo source tree requires. Keeping this at +# an older version also makes it easier for users to upgrade/rollback as needed. +# +# git-1.7 is in (EOL) Ubuntu Precise. +MIN_GIT_VERSION = (1, 7, 2) # minimum supported git version repodir = '.repo' # name of repo's private directory S_repo = 'repo' # special repo repository S_manifests = 'manifests' # special manifest repository diff --git a/subcmds/init.py b/subcmds/init.py index 6594a602..a7950069 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -34,7 +34,7 @@ from command import InteractiveCommand, MirrorSafeCommand from error import ManifestParseError from project import SyncBuffer from git_config import GitConfig -from git_command import git_require, MIN_GIT_VERSION +from git_command import git_require, MIN_GIT_VERSION_SOFT, MIN_GIT_VERSION_HARD import platform_utils class Init(InteractiveCommand, MirrorSafeCommand): @@ -451,7 +451,12 @@ to update the working directory files. self.OptionParser.error('--mirror and --archive cannot be used together.') def Execute(self, opt, args): - git_require(MIN_GIT_VERSION, fail=True) + git_require(MIN_GIT_VERSION_HARD, fail=True) + if not git_require(MIN_GIT_VERSION_SOFT): + print('repo: warning: git-%s+ will soon be required; please upgrade your ' + 'version of git to maintain support.' + % ('.'.join(str(x) for x in MIN_GIT_VERSION_SOFT),), + file=sys.stderr) self._SyncManifest(opt) self._LinkManifest(opt.manifest_name)