{"thread":{"id":"6810","subject":"bug: build from tarball uses git-describe","startedAt":"2007-02-13T22:59:47Z","lastAt":"2007-02-14T19:30:18Z","messageCount":6,"participants":["Han-Wen Nienhuys","Johannes Schindelin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"34479","messageId":"eqtfso$7mo$1@sea.gmane.org","threadId":"6810","inReplyTo":null,"subject":"bug: build from tarball uses git-describe","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2007-02-13T22:59:47Z","receivedAt":"2007-02-13T22:59:47Z","isPatch":false,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"\n\nwhile building GIT from tarball inside a GUB checkout \n(GUB is a build environment , now using GIT for version\ncontrol):\n\nsed -e '1s|#!.*/sh|#!/bin/sh|' \\\n            -e 's|@@PERL@@|/usr/bin/perl|g' \\\n            -e 's/@@GIT_VERSION@@/release_2.11.17.1_of_lilypond_release/2.11.16.1.g3abe43a66cf3655e5ec5486c3001ac2ac479433.3.gdb02-dirty/g' \\\n            -e 's/@@NO_CURL@@//g' \\\n\n\napparently, the makefile blindly uses the output of \n\n  git describe \n\nwithout checking whether there is a .git directory.\n\n-- \n Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"},{"id":"34484","messageId":"Pine.LNX.4.63.0702140159440.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6810","inReplyTo":"eqtfso$7mo$1@sea.gmane.org","subject":"Re: bug: build from tarball uses git-describe","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-14T01:00:31Z","receivedAt":"2007-02-14T01:00:31Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 13 Feb 2007, Han-Wen Nienhuys wrote:\n\n> apparently, the makefile blindly uses the output of \n> \n>   git describe \n> \n> without checking whether there is a .git directory.\n\nDoes this (totally untested) patch help?\n\n--\n\n GIT-VERSION-GEN |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 7a10b60..e6f89cb 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -8,7 +8,7 @@ LF='\n \n # First try git-describe, then see if there is a version file\n # (included in release tarballs), then default\n-if VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&\n+if test -d .git && VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&\n    case \"$VN\" in\n    *$LF*) (exit 1) ;;\n    v[0-9]*) : happy ;;\n"},{"id":"34485","messageId":"7vd54dwnvb.fsf@assigned-by-dhcp.cox.net","threadId":"6810","inReplyTo":"Pine.LNX.4.63.0702140159440.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: bug: build from tarball uses git-describe","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-14T01:04:40Z","receivedAt":"2007-02-14T01:04:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Does this (totally untested) patch help?\n>\n> --\n>\n>  GIT-VERSION-GEN |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n> index 7a10b60..e6f89cb 100755\n> --- a/GIT-VERSION-GEN\n> +++ b/GIT-VERSION-GEN\n> @@ -8,7 +8,7 @@ LF='\n>  \n>  # First try git-describe, then see if there is a version file\n>  # (included in release tarballs), then default\n> -if VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&\n> +if test -d .git && VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&\n>     case \"$VN\" in\n>     *$LF*) (exit 1) ;;\n>     v[0-9]*) : happy ;;\n\nHave you checked what the elif part does in the if statement you\nare patching?\n\nAfter all fresh tarball is how we build rpm packages and we do\nnot have .git in that build environment, so I am quite puzzled.\n"},{"id":"34486","messageId":"Pine.LNX.4.63.0702140206550.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6810","inReplyTo":"7vd54dwnvb.fsf@assigned-by-dhcp.cox.net","subject":"Re: bug: build from tarball uses git-describe","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-14T01:10:39Z","receivedAt":"2007-02-14T01:10:39Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 13 Feb 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > Does this (totally untested) patch help?\n> >\n> > --\n> >\n> >  GIT-VERSION-GEN |    2 +-\n> >  1 files changed, 1 insertions(+), 1 deletions(-)\n> >\n> > diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n> > index 7a10b60..e6f89cb 100755\n> > --- a/GIT-VERSION-GEN\n> > +++ b/GIT-VERSION-GEN\n> > @@ -8,7 +8,7 @@ LF='\n> >  \n> >  # First try git-describe, then see if there is a version file\n> >  # (included in release tarballs), then default\n> > -if VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&\n> > +if test -d .git && VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&\n> >     case \"$VN\" in\n> >     *$LF*) (exit 1) ;;\n> >     v[0-9]*) : happy ;;\n> \n> Have you checked what the elif part does in the if statement you\n> are patching?\n\nIt checks if the file \"version\" exists, and takes the contents of that as \nversion, otherwise $DEF_VER.\n\n> After all fresh tarball is how we build rpm packages and we do\n> not have .git in that build environment, so I am quite puzzled.\n\nYes, the idea was: if there is no .git, do not even bother checking the \noutput of git-describe (it might find a .git directory in a parent \ndirectory, after all).\n\nCiao,\nDscho\n"},{"id":"34608","messageId":"7vlkj0o814.fsf@assigned-by-dhcp.cox.net","threadId":"6810","inReplyTo":"Pine.LNX.4.63.0702140206550.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: bug: build from tarball uses git-describe","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-14T19:26:15Z","receivedAt":"2007-02-14T19:26:15Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> It checks if the file \"version\" exists, and takes the contents of that as \n> version, otherwise $DEF_VER.\n>\n>> After all fresh tarball is how we build rpm packages and we do\n>> not have .git in that build environment, so I am quite puzzled.\n>\n> Yes, the idea was: if there is no .git, do not even bother checking the \n> output of git-describe (it might find a .git directory in a parent \n> directory, after all).\n\nOk, then let's do this.  Our tarballs do have version file, and\nif the upperlevel Makefile wants to set a different version it\ncan drop 'version' file before descending into us. \n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex febacd2..6abde8d 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -6,18 +6,19 @@ DEF_VER=v1.5.0.GIT\n LF='\n '\n \n-# First try git-describe, then see if there is a version file\n-# (included in release tarballs), then default\n-if VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&\n-   case \"$VN\" in\n-   *$LF*) (exit 1) ;;\n-   v[0-9]*) : happy ;;\n-   esac\n-then\n-\tVN=$(echo \"$VN\" | sed -e 's/-/./g');\n-elif test -f version\n+# First see if there is a version file (included in release tarballs),\n+# then try git-describe, then default.\n+if test -f version\n then\n \tVN=$(cat version) || VN=\"$DEF_VER\"\n+elif test -d .git &&\n+\tVN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&\n+\tcase \"$VN\" in\n+\t*$LF*) (exit 1) ;;\n+\tv[0-9]*) : happy ;;\n+\tesac\n+then\n+\tVN=$(echo \"$VN\" | sed -e 's/-/./g');\n else\n \tVN=\"$DEF_VER\"\n fi\n"},{"id":"34609","messageId":"Pine.LNX.4.63.0702142028230.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6810","inReplyTo":"7vlkj0o814.fsf@assigned-by-dhcp.cox.net","subject":"Re: bug: build from tarball uses git-describe","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-02-14T19:30:18Z","receivedAt":"2007-02-14T19:30:18Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 14 Feb 2007, Junio C Hamano wrote:\n\n> Ok, then let's do this.  Our tarballs do have version file, and if the \n> upperlevel Makefile wants to set a different version it can drop \n> 'version' file before descending into us.\n\nOkay. But I started hacking git by getting it, compiling it, doing \"git \ninit\", a \"git fetch origin\", \"git read-tree HEAD\" and \"git update-index \n--refresh\". In that case, .git is there, but also the file \"version\".\n\nBut that's too obscure a case as to care about, so I am okay with your \npatch.\n\nCiao,\nDscho\n"}]}