{"thread":{"id":"5176","subject":"Trouble building newer git with older","startedAt":"2006-08-08T18:47:16Z","lastAt":"2006-08-08T22:52:25Z","messageCount":3,"participants":["Nishanth Aravamudan","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"24989","messageId":"20060808184716.GC4546@us.ibm.com","threadId":"5176","inReplyTo":null,"subject":"Trouble building newer git with older","fromName":"Nishanth Aravamudan","fromEmail":"nacc@us.ibm.com","sentAt":"2006-08-08T18:47:16Z","receivedAt":"2006-08-08T18:47:16Z","isPatch":false,"sender":{"key":"nacc@us.ibm.com","avatar":null},"body":"Hi all,\n\nI am in the process of updating one of our system's set of git binaries\nand noticed the following. When executing\n\ngit clone rsync://rsync.kernel.org/pub/scm/git/git.git git\ncd git\ngit checkout\nmake\n\nI get this error:\n\nkernel:/home/nacc/download/git# make\nGIT_VERSION = Usage: git COMMAND [OPTIONS] [TARGET]\n git command 'describe' not found: commands are:\n    add apply archimport bisect branch checkout cherry clone\n    commit count.objects cvsimport diff fetch format.patch\n    fsck.cache get.tar.commit.id init.db log ls.remote octopus\n    pack.objects parse.remote patch.id prune pull push rebase\n    relink rename repack request.pull reset resolve revert\n    send.email shortlog show.branch status tag verify.tag\n    whatchanged-dirty\nGIT-VERSION-FILE:2: *** multiple target patterns.  Stop.\n\nThis is because GIT-VERSION-GEN attempts to invoke `git describe` but\ndescribe is not a valid parameter to the current version of git. This is\nnot treated as a failure case, though, as output is stored in VN.\nPerhaps the return code of `git describe` should also be checked? Or am\nI just not supposed to upgrade from this old of a version of git via\ngit?\n\nThanks,\nNish\n\n-- \nNishanth Aravamudan <nacc@us.ibm.com>\nIBM Linux Technology Center\n"},{"id":"24993","messageId":"7v7j1jvvh7.fsf@assigned-by-dhcp.cox.net","threadId":"5176","inReplyTo":"20060808184716.GC4546@us.ibm.com","subject":"Re: Trouble building newer git with older","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-08T20:11:16Z","receivedAt":"2006-08-08T20:11:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nishanth Aravamudan <nacc@us.ibm.com> writes:\n\n> This is because GIT-VERSION-GEN attempts to invoke `git describe` but\n> describe is not a valid parameter to the current version of git. This is\n> not treated as a failure case, though, as output is stored in VN.\n> Perhaps the return code of `git describe` should also be checked? Or am\n> I just not supposed to upgrade from this old of a version of git via\n> git?\n\nNo, it was broken when this patch was applied.\n\n        commit 1100ac81a90b03e0c037a286569a340decf7489b\n        Author: Sean <seanlkml@sympatico.ca>\n        Date:   Mon May 22 00:39:52 2006 -0400\n\nLuckily, my copy of GNU interactive tools, when invoked like this:\n\n\tgit describe --abbrev=4 HEAD 2>/dev/null\n\nexits with an error code 1, so the existing code already catches it.\n\nHow about this patch?\n\n-- >8 --\nGIT-VERSION-GEN: adjust for ancient git\n\nWhen an ancient \"git\" that does not understand \"describe\"\ncommand is on the $PATH, \"git describe\" emitted a Usage message\nwithout exiting non-zero status (which is a mistake we cannot\nfix retroactively).  Catch this case to make sure we do not try\nusing phoney multi-line string as a version number.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 1ce217d..14923c9 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -3,9 +3,17 @@ #!/bin/sh\n GVF=GIT-VERSION-FILE\n DEF_VER=v1.4.2.GIT\n \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); then\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 then\n"},{"id":"25005","messageId":"20060808225225.GA5906@us.ibm.com","threadId":"5176","inReplyTo":"7v7j1jvvh7.fsf@assigned-by-dhcp.cox.net","subject":"Re: Trouble building newer git with older","fromName":"Nishanth Aravamudan","fromEmail":"nacc@us.ibm.com","sentAt":"2006-08-08T22:52:25Z","receivedAt":"2006-08-08T22:52:25Z","isPatch":false,"sender":{"key":"nacc@us.ibm.com","avatar":null},"body":"On 08.08.2006 [13:11:16 -0700], Junio C Hamano wrote:\n> Nishanth Aravamudan <nacc@us.ibm.com> writes:\n> \n> > This is because GIT-VERSION-GEN attempts to invoke `git describe` but\n> > describe is not a valid parameter to the current version of git. This is\n> > not treated as a failure case, though, as output is stored in VN.\n> > Perhaps the return code of `git describe` should also be checked? Or am\n> > I just not supposed to upgrade from this old of a version of git via\n> > git?\n> \n> No, it was broken when this patch was applied.\n> \n>         commit 1100ac81a90b03e0c037a286569a340decf7489b\n>         Author: Sean <seanlkml@sympatico.ca>\n>         Date:   Mon May 22 00:39:52 2006 -0400\n> \n> Luckily, my copy of GNU interactive tools, when invoked like this:\n> \n> \tgit describe --abbrev=4 HEAD 2>/dev/null\n> \n> exits with an error code 1, so the existing code already catches it.\n> \n> How about this patch?\n> \n> -- >8 --\n> GIT-VERSION-GEN: adjust for ancient git\n> \n> When an ancient \"git\" that does not understand \"describe\"\n> command is on the $PATH, \"git describe\" emitted a Usage message\n> without exiting non-zero status (which is a mistake we cannot\n> fix retroactively).  Catch this case to make sure we do not try\n> using phoney multi-line string as a version number.\n> \n> Signed-off-by: Junio C Hamano <junkio@cox.net>\n\nLooks good to me and I can confirm this fixes the problem here.\n\nAcked-by: Nishanth Aravamudan <nacc@us.ibm.com>\n\nThanks,\nNish\n"}]}