From 3ec52c91bfee242c31c1c93d6058e187944c9abf Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Fri, 13 Feb 2015 03:42:29 -0800 Subject: [PATCH] install.sh: warn about various Git versions' limitations If $Girocco::Config::git_bin is set to a version of Git that has known issues that affect Girocco, warn about it. Additionally require at least Git version 1.6.6 because the smart HTTP support is integral to Girocco now. --- install.sh | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 6e80794..7cd263c 100755 --- a/install.sh +++ b/install.sh @@ -81,7 +81,7 @@ if ! git_version="$("$cfg_git_bin" version)"; then exit 1 fi case "$git_version" in - "git version "*) :;; + [Gg]"it version "*) :;; *) echo "ERROR: '$cfg_git_bin version' output does not start with 'git version '" >&2 exit 1 @@ -90,6 +90,40 @@ case "$cfg_git_bin" in /*) :;; *) echo 'ERROR: $Girocco::Config::git_bin must be set to an absolute path' >&2 exit 1 esac +git_vernum="$(echo "$git_version" | sed -ne 's/^[^0-9]*\([0-9][0-9]*\(\.[0-9][0-9]*\)*\).*$/\1/p')" +if [ "$(vcmp "$git_vernum" 1.6.6)" -lt 0 ]; then + echo 'ERROR: $Girocco::Config::git_bin must be at least Git version 1.6.6' + exit 1 +fi +if [ "$(vcmp "$git_vernum" 1.6.6.3)" -lt 0 ]; then + echo 'WARNING: $Girocco::Config::git_bin version < 1.6.6.3, clients will not see useful error messages' +fi +if [ "$(vcmp "$git_vernum" 1.7.2)" -lt 0 ]; then + echo 'WARNING: $Girocco::Config::git_bin version < 1.7.2, some Girocco functionality will be disabled' +fi +if [ -n "$cfg_mirror" -a "$(vcmp "$git_vernum" 1.7.5)" -lt 0 ]; then + echo 'WARNING: $Girocco::Config::git_bin version < 1.7.5 and mirroring enabled, some sources can cause an infinite fetch loop' +fi +if [ "$(vcmp "$git_vernum" 1.7.6.6)" -lt 0 ]; then + echo 'WARNING: $Girocco::Config::git_bin version < 1.7.6.6, performance may be degraded' +fi +if [ "$(uname -m 2>/dev/null)" = "x86_64" ] && [ "$(vcmp "$git_vernum" 1.7.11)" -ge 0 ]; then + echo 'WARNING: $Girocco::Config::git_bin version >= 1.7.11 and x86_64, make sure Git built WITHOUT XDL_FAST_HASH' + echo 'WARNING: See http://thread.gmane.org/gmane.comp.version-control.git/261638 for details' +fi +if [ "$(vcmp "$git_vernum" 1.8.4.2)" -ge 0 ] && [ -n "$cfg_mirror" -a "$(vcmp "$git_vernum" 2)" -lt 0 ]; then + echo 'WARNING: $Girocco::Config::git_bin version >= 1.8.4.2 and < 2.0.0, git-daemon needs write access for shallow clones' + echo 'WARNING: $Girocco::Config::git_bin version >= 1.8.4.2 and < 2.0.0, shallow clones will leave repository turds' +fi +if [ "$(vcmp "$git_vernum" 1.8.4.3)" -lt 0 ]; then + echo 'WARNING: $Girocco::Config::git_bin version < 1.8.4.3, clients will not receive symref=HEAD:refs/heads/...' +fi +if [ "$(vcmp "$git_vernum" 2.1)" -lt 0 ]; then + echo 'WARNING: $Girocco::Config::git_bin version < 2.1.0, pack bitmaps will not be available' +fi +if [ "$(vcmp "$git_vernum" 2.1)" -ge 0 ] && [ "$(vcmp "$git_vernum" 2.1.3)" -lt 0 ]; then + echo 'WARNING: $Girocco::Config::git_bin version >= 2.1.0 and < 2.1.3, pack bitmaps may not be reliable, please upgrade to at least Git version 2.1.3' +fi if [ -n "$cfg_mirror" -a "$cfg_mirror" != 0 ] && grep -q ns_parserr "$cfg_git_bin"; then cat <<'EOT' -- 2.11.4.GIT