Re: [PATCH] gitk: Take only numeric version components when computing $git_version
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jan 13, 2011, 19:22 UTC
- Message-ID
- <20110113192243.GA20625@burratino>
- In-Reply-To
- <4D2C5F3E.2020007@debugon.org>
Mathias Lafeldt wrote:
> Anders Kaseorg wrote:
>> This fixes errors running with release candidate versions of Git: >> Error in startup script: expected version number but got "1.7.4-rc0"
[...]
> People don't seem to use gitk with the RC releases because nobody else > complains...
GIT-VERSION-GEN contains:
DEF_VER=v1.7.4-rc1 [...] if test -f version then [...] elif test -d .git -o -f .git && [...] then VN=$(echo "$VN" | sed -e 's/-/./g'); else VN="$DEF_VER" fi
So after building from a tarball generated with "git archive", "git version" produces v1.7.4-rc1, producing errors from gitk, but after building from the git repo or a tarball generated with "make dist", the version is v1.7.4.rc1 (which gitk accepts).
Anders's fix looks good to me for robustness reasons anyway, so
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Maybe the substitution in GIT-VERSION-GEN should say something like
VN=$(echo "$VN" | sed -e 's/-\([^r]\)/.\1/g')
meaning the result for tagged rcs would not depend on whether git is present? Alternatively, DEF_VER could be set to v1.7.4.rc1, which does not seem as nice to me.