diff options
Diffstat (limited to 'git_version.sh')
-rwxr-xr-x | git_version.sh | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/git_version.sh b/git_version.sh index 69eb0f24..50658970 100755 --- a/git_version.sh +++ b/git_version.sh @@ -155,6 +155,29 @@ cat<<EOF EOF +# Backwards compatibility hack for git 1.6.0 (and people running the +# latest pre-release version of git.) +# +# For now, we'll do this to support git 1.6, with minimal changes to +# the rest of this script, but no guarantees how long this will work. +# The hyphenated git-foo-bar names really are deprecated, and may +# disappear in the future as more of git gets rewritten as built-in C +# programs. Google summer of code students and other git developers +# are hard at work doing this, in order to make git more +# portable/usable for Windows users. As a result, some of the +# git-foo-bar programs, which will be moved to the exec-dir directory +# in git 1.6, may disappear altogether in the future. Hence the only +# truly safe and future-compatible way of running commands such as +# git-diff-files, git-rev-parse, etc., are "git diff-files" and +# "git rev-parse". Here endeth the git portability sermon, which +# I suspect will have as much effect as abstinence-only sex ed +# classes. :-) TYT, 2008-07-08 + +execdir=$(git --exec-path 2> /dev/null) +if test -n "$execdir"; then + PATH=$PATH:$execdir +fi + # Detect git tools (should work with old and new git versions) git_found=yes for git_tool in git-symbolic-ref git-rev-parse git-diff-files git-diff-index git @@ -314,7 +337,7 @@ int main(int argc, char *argv[]) const char *const prog = (idx)?(idx+1):(argv[0]); #ifdef PACKAGE_VERSION printf("%s: version %s, built from %s\n", prog, PACKAGE_VERSION, GIT_MESSAGE); -#elif defined(GIT_USED) +#elif defined(GIT_MESSAGE) printf("%s: built from %s\n", prog, GIT_MESSAGE); #endif return 0; |