Re: [ANNOUCNE] GIT 1.1.0
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 10, 2006, 14:49 UTC
- Message-ID
- <Pine.LNX.4.63.0601101540070.26054@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <7v1wzgg9nm.fsf@assigned-by-dhcp.cox.net>
Hi,
On Mon, 9 Jan 2006, Junio C Hamano wrote:
Show 8 quoted lines
> Andreas Ericsson <ae@op5.se> 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