Re: [ANNOUCNE] GIT 1.1.0

From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Date: 2006-01-11 01:49:04
Hi,

On Mon, 9 Jan 2006, Junio C Hamano wrote:

> 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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Jan 11 01:49:42 2006

This archive was generated by hypermail 2.1.8 : 2006-01-11 01:49:51 EST