{"thread":{"id":"34886","subject":"[PATCH 1/2] version-gen: cleanup","startedAt":"2013-09-09T05:01:27Z","lastAt":"2013-09-10T01:13:14Z","messageCount":8,"participants":["Felipe Contreras","Junio C Hamano","brian m. carlson"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"227197","messageId":"1378702889-21638-1-git-send-email-felipe.contreras@gmail.com","threadId":"34886","inReplyTo":null,"subject":"[PATCH 0/2] version-gen: fixes and cleanups","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-09T05:01:27Z","receivedAt":"2013-09-09T05:01:27Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Felipe Contreras (2):\n  version-gen: cleanup\n  version-gen: avoid messing the version\n\n GIT-VERSION-GEN | 23 +++++++++++------------\n 1 file changed, 11 insertions(+), 12 deletions(-)\n\n-- \n1.8.4-338-gefd7fa6\n"},{"id":"227196","messageId":"1378702889-21638-2-git-send-email-felipe.contreras@gmail.com","threadId":"34886","inReplyTo":"1378702889-21638-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 1/2] version-gen: cleanup","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-09T05:01:28Z","receivedAt":"2013-09-09T05:01:28Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"No functional changes.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 24 ++++++++++++------------\n 1 file changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 06026ea..b0db139 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -7,21 +7,24 @@ LF='\n '\n \n # First see if there is a version file (included in release tarballs),\n-# then try git-describe, then default.\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_DIR:-.git} -o -f .git &&\n-\tVN=$(git describe --match \"v[0-9]*\" --abbrev=7 HEAD 2>/dev/null) &&\n+\tVN=$(git describe --match \"v[0-9]*\" --abbrev=7 HEAD 2>/dev/null)\n+then\n \tcase \"$VN\" in\n-\t*$LF*) (exit 1) ;;\n+\t*$LF*)\n+\t\texit 1\n+\t\t;;\n \tv[0-9]*)\n \t\tgit update-index -q --refresh\n \t\ttest -z \"$(git diff-index --name-only HEAD --)\" ||\n-\t\tVN=\"$VN-dirty\" ;;\n+\t\tVN=\"$VN-dirty\"\n+\t\t;;\n \tesac\n-then\n-\tVN=$(echo \"$VN\" | sed -e 's/-/./g');\n+\tVN=$(echo \"$VN\" | sed -e 's/-/./g')\n else\n \tVN=\"$DEF_VER\"\n fi\n@@ -34,9 +37,6 @@ then\n else\n \tVC=unset\n fi\n-test \"$VN\" = \"$VC\" || {\n-\techo >&2 \"GIT_VERSION = $VN\"\n-\techo \"GIT_VERSION = $VN\" >$GVF\n-}\n-\n-\n+test \"$VN\" = \"$VC\" && exit\n+echo >&2 \"GIT_VERSION = $VN\"\n+echo \"GIT_VERSION = $VN\" >$GVF\n-- \n1.8.4-338-gefd7fa6\n"},{"id":"227198","messageId":"1378702889-21638-3-git-send-email-felipe.contreras@gmail.com","threadId":"34886","inReplyTo":"1378702889-21638-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH 2/2] version-gen: avoid messing the version","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-09T05:01:29Z","receivedAt":"2013-09-09T05:01:29Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"If the version is 'v1.8.4-rc1' that is the version, and there's no need\nto change it to anything else, like 'v1.8.4.rc1'.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n GIT-VERSION-GEN | 1 -\n 1 file changed, 1 deletion(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex b0db139..2b9fd2f 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -24,7 +24,6 @@ then\n \t\tVN=\"$VN-dirty\"\n \t\t;;\n \tesac\n-\tVN=$(echo \"$VN\" | sed -e 's/-/./g')\n else\n \tVN=\"$DEF_VER\"\n fi\n-- \n1.8.4-338-gefd7fa6\n"},{"id":"227199","messageId":"7vtxhuilv1.fsf@alter.siamese.dyndns.org","threadId":"34886","inReplyTo":"1378702889-21638-3-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 2/2] version-gen: avoid messing the version","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-09-09T05:51:14Z","receivedAt":"2013-09-09T05:51:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> If the version is 'v1.8.4-rc1' that is the version, and there's no need\n> to change it to anything else, like 'v1.8.4.rc1'.\n>\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  GIT-VERSION-GEN | 1 -\n>  1 file changed, 1 deletion(-)\n>\n> diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n> index b0db139..2b9fd2f 100755\n> --- a/GIT-VERSION-GEN\n> +++ b/GIT-VERSION-GEN\n> @@ -24,7 +24,6 @@ then\n>  \t\tVN=\"$VN-dirty\"\n>  \t\t;;\n>  \tesac\n> -\tVN=$(echo \"$VN\" | sed -e 's/-/./g')\n>  else\n>  \tVN=\"$DEF_VER\"\n>  fi\n\nThe log message of 5c7d3c95 (Allow building of RPM from interim\nsnapshot., 2006-01-16) leaves a lot to be desired, but I do remember\nthat this was added due to user request.  Before that commit, we did\nnot strip dashes, and RPM packaging did not like dash in the version\nname, hence folks on RH and derived distributions could not package\nthe software out of the box themselves.\n\nI do not offhand know if that RPM limitation was lifted.  I do not\nknow if there are other packagers with a similar limitation that\nhave been relying on this version mangling, either.  This change may\nend up being a regression for these users.\n\nThe mangling is done only for auto-generated names, so I suspect\nthat anybody who wanted the dash in their version names for whatever\nreason has already been using the \"version file\" escape hatch (or\nnobody had a desparate need to use dash instead of dot).\n"},{"id":"227201","messageId":"7vppsiila6.fsf@alter.siamese.dyndns.org","threadId":"34886","inReplyTo":"1378702889-21638-2-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH 1/2] version-gen: cleanup","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-09-09T06:03:45Z","receivedAt":"2013-09-09T06:03:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> No functional changes.\n>\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  GIT-VERSION-GEN | 24 ++++++++++++------------\n>  1 file changed, 12 insertions(+), 12 deletions(-)\n>\n> diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n> index 06026ea..b0db139 100755\n> --- a/GIT-VERSION-GEN\n> +++ b/GIT-VERSION-GEN\n> @@ -7,21 +7,24 @@ LF='\n>  '\n>  \n>  # First see if there is a version file (included in release tarballs),\n> -# then try git-describe, then default.\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_DIR:-.git} -o -f .git &&\n> -\tVN=$(git describe --match \"v[0-9]*\" --abbrev=7 HEAD 2>/dev/null) &&\n> +\tVN=$(git describe --match \"v[0-9]*\" --abbrev=7 HEAD 2>/dev/null)\n> +then\n>  \tcase \"$VN\" in\n> -\t*$LF*) (exit 1) ;;\n> +\t*$LF*)\n> +\t\texit 1\n\nThe funnily written \"false\" is misleading and a clean-up may be a\ngood idea to turn it to a straight \"false\".\n\nI however think this actually changes the behaviour.\n\nIn any case, if you want to keep this step a \"no functional change\"\nrewrite, this section has to be part of the condition of this \"elif\"\n(because it logically is).  If describe couldn't describe HEAD, or\neven if it could, if its output was multi-line for any reason, we\nwanted to punt and let the DEF_VER in the last \"else\" clause kick\nin.\n\nAfter the update, describe output that is not a single-liner will\nfail the entire script, instead of falling back to DEF_VER.  I\nactually think it is a good change to fail it (even though it is\nunlikely that the \"describe\" command give above would give more than\none line).\n\n> +\t\t;;\n>  \tv[0-9]*)\n>  \t\tgit update-index -q --refresh\n>  \t\ttest -z \"$(git diff-index --name-only HEAD --)\" ||\n> -\t\tVN=\"$VN-dirty\" ;;\n> +\t\tVN=\"$VN-dirty\"\n> +\t\t;;\n>  \tesac\n> -then\n> -\tVN=$(echo \"$VN\" | sed -e 's/-/./g');\n> +\tVN=$(echo \"$VN\" | sed -e 's/-/./g')\n>  else\n>  \tVN=\"$DEF_VER\"\n>  fi\n"},{"id":"227202","messageId":"CAMP44s1B4F8k_TEgXT8reatCw9UKATDAH=D31v=79QA6voEKOw@mail.gmail.com","threadId":"34886","inReplyTo":"7vtxhuilv1.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/2] version-gen: avoid messing the version","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-09T07:00:55Z","receivedAt":"2013-09-09T07:00:55Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, Sep 9, 2013 at 12:51 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> If the version is 'v1.8.4-rc1' that is the version, and there's no need\n>> to change it to anything else, like 'v1.8.4.rc1'.\n>>\n>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>> ---\n>>  GIT-VERSION-GEN | 1 -\n>>  1 file changed, 1 deletion(-)\n>>\n>> diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\n>> index b0db139..2b9fd2f 100755\n>> --- a/GIT-VERSION-GEN\n>> +++ b/GIT-VERSION-GEN\n>> @@ -24,7 +24,6 @@ then\n>>               VN=\"$VN-dirty\"\n>>               ;;\n>>       esac\n>> -     VN=$(echo \"$VN\" | sed -e 's/-/./g')\n>>  else\n>>       VN=\"$DEF_VER\"\n>>  fi\n>\n> The log message of 5c7d3c95 (Allow building of RPM from interim\n> snapshot., 2006-01-16) leaves a lot to be desired, but I do remember\n> that this was added due to user request.  Before that commit, we did\n> not strip dashes, and RPM packaging did not like dash in the version\n> name, hence folks on RH and derived distributions could not package\n> the software out of the box themselves.\n\nOf course they could, by doing the replace themselves, or by simply\nusing a 'version' file. Didn't you just recently suggested somebody to\ndo exactly that?\n\n> I do not offhand know if that RPM limitation was lifted.  I do not\n> know if there are other packagers with a similar limitation that\n> have been relying on this version mangling, either.  This change may\n> end up being a regression for these users.\n\nOf course not. First of all, who exactly is packaging release\ncandidates nowadays? And second, why they can't they use the existing\ntools, like the 'version' file?\n\nThe information behind the commit 5c7d3c95 is basically non-existant,\nas I cannot even find a patch for that change in the mailing list. I\nguess you decided the commit was so trivial it didn't merit a patch\nfor review and discussion. Anyway, it happened before the 'version'\nfile option was present, so it's quite likely they (whatever \"they\"\nmight be) would not have any issue.\n\n> The mangling is done only for auto-generated names, so I suspect\n> that anybody who wanted the dash in their version names for whatever\n> reason has already been using the \"version file\" escape hatch (or\n> nobody had a desparate need to use dash instead of dot).\n\nSo, let me get this straight; the nominal version of Git has a dash\n(v1.8.3-rc1), but the internal version of doesn't (1.8.3.rc1), there\nis no real reason for that, except that you say \"some people\" need it\nthat way, but then you say the people that need it in the nominal way\nshould use the 'version' file. Why couldn't the people that want the\nnon-nominal form use the 'version' file instead?\n\nIt doesn't follow.\n\n-- \nFelipe Contreras\n"},{"id":"227287","messageId":"20130909233028.GB101065@vauxhall.crustytoothpaste.net","threadId":"34886","inReplyTo":"CAMP44s1B4F8k_TEgXT8reatCw9UKATDAH=D31v=79QA6voEKOw@mail.gmail.com","subject":"Re: [PATCH 2/2] version-gen: avoid messing the version","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2013-09-09T23:30:28Z","receivedAt":"2013-09-09T23:30:28Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Mon, Sep 09, 2013 at 02:00:55AM -0500, Felipe Contreras wrote:\n> Of course not. First of all, who exactly is packaging release\n> candidates nowadays? And second, why they can't they use the existing\n> tools, like the 'version' file?\n\nDebian unstable, for one.  However, they don't use RPMs and the version\nwould be rewritten to use ~ anyway.  Fedora rawhide might.\n\n-- \nbrian m. carlson / brian with sandals: Houston, Texas, US\n+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only\nOpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187\n"},{"id":"227300","messageId":"CAMP44s28ZVRTRj+2cX1q0SaGyY16TZKmJtCscPUgF_hY=KJiwA@mail.gmail.com","threadId":"34886","inReplyTo":"20130909233028.GB101065@vauxhall.crustytoothpaste.net","subject":"Re: [PATCH 2/2] version-gen: avoid messing the version","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-09-10T01:13:14Z","receivedAt":"2013-09-10T01:13:14Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, Sep 9, 2013 at 6:30 PM, brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n> On Mon, Sep 09, 2013 at 02:00:55AM -0500, Felipe Contreras wrote:\n>> Of course not. First of all, who exactly is packaging release\n>> candidates nowadays? And second, why they can't they use the existing\n>> tools, like the 'version' file?\n>\n> Debian unstable, for one.  However, they don't use RPMs and the version\n> would be rewritten to use ~ anyway.  Fedora rawhide might.\n\nDebian uses their own version; 1:1.8.4~rc3-1, it doesn't use Git's\nversion 1.8.4.rc3, so if we change it to 1.8.4-rc3, that doesn't\naffect them one bit because they are not using it anyway.\n\nAs for Fedora rawhide, they don't even use rc versions:\n\nhttp://koji.fedoraproject.org/koji/packageinfo?packageID=1864\n\n-- \nFelipe Contreras\n"}]}