From 4c7fa1aabf718c54e671a63ce862063fd9d1103a Mon Sep 17 00:00:00 2001 From: Will Elwood Date: Wed, 16 Nov 2016 15:43:29 +0000 Subject: [PATCH] Fix version.sh for ancient git I'm not sure when the `format` argument was added to `git log`, but it seems to be an alias for `pretty` (ie both exist in current versions of git). I noticed this was failing on my ancient system that's stuck with git 1.5, this makes it work. Also, `ignore-submodules` is not understood by ancient `git status` - I believe the expected output would be achieved by simply removing this argument, but it's not important since it fails gracefully enough and fixing it so newer git doesn't fail seems more complicated. --- version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.sh b/version.sh index 9b8daeba..339bfe5a 100755 --- a/version.sh +++ b/version.sh @@ -16,7 +16,7 @@ else # Figure out the information we need LATEST_TAG=`${GIT} describe --abbrev=0 HEAD` - COMMITS_SINCE=`${GIT} log --format=oneline ${LATEST_TAG}..HEAD | wc -l` + COMMITS_SINCE=`${GIT} log --pretty=oneline ${LATEST_TAG}..HEAD | wc -l` # Explicitly make it a number: on openbsd wc -l returns " 42" instead of "42" let COMMITS_SINCE=COMMITS_SINCE SHORT_ID=`${GIT} rev-parse --short HEAD`