From: Johannes Schindelin Date: Tue, 10 Jan 2006 14:49:04 GMT Subject: Re: [ANNOUCNE] GIT 1.1.0 Message-ID: In-Reply-To: <7v1wzgg9nm.fsf@assigned-by-dhcp.cox.net> Hi, On Mon, 9 Jan 2006, Junio C Hamano wrote: > Andreas Ericsson writes: > > > I have no solution to this, apart from rewriting the Makefile on the > > fly whenever a release tarball is created. > > Well, there is always an option to update the fallback version > number hardcoded in GIT-VERSION-GEN script, but that kind fo > defeats the whole idea of the current setup, so... The whole idea of the current setup is working only if you have a git repository of git. Kind of a chicken-egg, right? So, why not just include GIT-VERSION-FILE in the tarball, and let GIT-VERSION-GEN check if there exists .git or $GIT_DIR before trying its voodoo? --- diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 845b9dc..b65b214 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -2,6 +2,9 @@ GVF=GIT-VERSION-FILE +test -z "$GIT_DIR" && GIT_DIR=.git +test -d "$GIT_DIR" || exit 0 + VN=$(git-describe --abbrev=4 HEAD 2>/dev/null) || VN=v1.0.GIT VN=$(expr "$VN" : v'\(.*\)') if test -r $GVF