git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C HamanoNext: Junio C Hamano
Message 13 of 16 in “[ANNOUCNE] GIT 1.1.0”
  1. Junio C HamanoJan 9, 2006
  2. Coywolf Qi HuntJan 9, 2006
  3. Junio C HamanoJan 9, 2006
  4. Junio C HamanoJan 9, 2006
  5. Martin LanghoffJan 9, 2006
  6. Gerrit PapeJan 11, 2006
  7. lamikrJan 9, 2006
  8. Andreas EricssonJan 9, 2006
  9. Junio C HamanoJan 9, 2006
  10. lamikrJan 9, 2006
  11. Andreas EricssonJan 10, 2006
  12. Junio C HamanoJan 10, 2006
  13. Johannes SchindelinJan 10, 2006
  14. Junio C HamanoJan 10, 2006
  15. H. Peter AnvinJan 10, 2006
  16. Junio C HamanoJan 10, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.