{"thread":{"id":"26186","subject":"BUG: gitk fails to parse 1.7.4-rc0 version string","startedAt":"2011-01-04T12:44:54Z","lastAt":"2011-01-19T09:35:18Z","messageCount":8,"participants":["Mathias Lafeldt","Anders Kaseorg","Jonathan Nieder","Paul Mackerras","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"158883","messageId":"4D231646.5080005@debugon.org","threadId":"26186","inReplyTo":null,"subject":"BUG: gitk fails to parse 1.7.4-rc0 version string","fromName":"Mathias Lafeldt","fromEmail":"misfire@debugon.org","sentAt":"2011-01-04T12:44:54Z","receivedAt":"2011-01-04T12:44:54Z","isPatch":false,"sender":{"key":"misfire@debugon.org","avatar":"https://avatars.githubusercontent.com/u/158074?v=4"},"body":"Looks like gitk doesn't like the \"-rc0\" suffix.\n\n$ git --version\ngit version 1.7.4-rc0\n\n$ gitk\nError in startup script: expected version number but got \"1.7.4-rc0\"\n    while executing\n\"package vcompare $git_version \"1.6.6.2\"\"\n    (file \"/usr/local/bin/gitk\" line 1)\n\nI temporarily fixed it by hard-coding the version string:\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex e82c6bf..367446e 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -11581,7 +11581,7 @@ if {![info exists have_ttk]} {\n set use_ttk [expr {$have_ttk && $want_ttk}]\n set NS [expr {$use_ttk ? \"ttk\" : \"\"}]\n\n-set git_version [join [lrange [split [lindex [exec git version] end] .]\n0 2] .]\n+set git_version \"1.7.4\"\n\n\n set show_notes {}\n if {[package vcompare $git_version \"1.6.6.2\"] >= 0} {\n\n\n-Mathias\n"},{"id":"159084","messageId":"1294360953.21006.2.camel@fixed-disk","threadId":"26186","inReplyTo":"4D231646.5080005@debugon.org","subject":"[PATCH] gitk: Take only numeric version components when computing $git_version","fromName":"Anders Kaseorg","fromEmail":"andersk@mit.edu","sentAt":"2011-01-07T00:42:33Z","receivedAt":"2011-01-07T00:42:33Z","isPatch":true,"sender":{"key":"andersk@mit.edu","avatar":"https://avatars.githubusercontent.com/u/26471?v=4"},"body":"This fixes errors running with release candidate versions of Git:\n  Error in startup script: expected version number but got \"1.7.4-rc0\"\n\nAlso, $git_version is no longer artificially limited to three\ncomponents.  That limitation was added by commit\n194bbf6cc8c2f3c14a920c841841d66b7667a848 to deal with msysGit version\nstrings like “1.6.4.msysgit.0”, and we don’t need it now.  Hence as\nanother side effect, this enables showing notes with git version\n1.6.6.2 or 1.6.6.3, as originally intended by commit\n7defefb134270b6e8ab3e422b343b41a4a383f5d.\n\nSigned-off-by: Anders Kaseorg <andersk@mit.edu>\n---\n gitk-git/gitk |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex e82c6bf..9cbc09d 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -11581,7 +11581,7 @@ if {![info exists have_ttk]} {\n set use_ttk [expr {$have_ttk && $want_ttk}]\n set NS [expr {$use_ttk ? \"ttk\" : \"\"}]\n \n-set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]\n+regexp {^git version ([\\d.]*\\d)} [exec git version] _ git_version\n \n set show_notes {}\n if {[package vcompare $git_version \"1.6.6.2\"] >= 0} {\n-- \n1.7.4-rc0\n"},{"id":"159334","messageId":"4D2C5F3E.2020007@debugon.org","threadId":"26186","inReplyTo":"1294360953.21006.2.camel@fixed-disk","subject":"Re: [PATCH] gitk: Take only numeric version components when computing $git_version","fromName":"Mathias Lafeldt","fromEmail":"misfire@debugon.org","sentAt":"2011-01-11T13:46:38Z","receivedAt":"2011-01-11T13:46:38Z","isPatch":true,"sender":{"key":"misfire@debugon.org","avatar":"https://avatars.githubusercontent.com/u/158074?v=4"},"body":"Anders Kaseorg wrote:\n> This fixes errors running with release candidate versions of Git:\n>   Error in startup script: expected version number but got \"1.7.4-rc0\"\n> \n> Also, $git_version is no longer artificially limited to three\n> components.  That limitation was added by commit\n> 194bbf6cc8c2f3c14a920c841841d66b7667a848 to deal with msysGit version\n> strings like “1.6.4.msysgit.0”, and we don’t need it now.  Hence as\n> another side effect, this enables showing notes with git version\n> 1.6.6.2 or 1.6.6.3, as originally intended by commit\n> 7defefb134270b6e8ab3e422b343b41a4a383f5d.\n> \n> Signed-off-by: Anders Kaseorg <andersk@mit.edu>\n> ---\n>  gitk-git/gitk |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/gitk-git/gitk b/gitk-git/gitk\n> index e82c6bf..9cbc09d 100755\n> --- a/gitk-git/gitk\n> +++ b/gitk-git/gitk\n> @@ -11581,7 +11581,7 @@ if {![info exists have_ttk]} {\n>  set use_ttk [expr {$have_ttk && $want_ttk}]\n>  set NS [expr {$use_ttk ? \"ttk\" : \"\"}]\n>  \n> -set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]\n> +regexp {^git version ([\\d.]*\\d)} [exec git version] _ git_version\n>  \n>  set show_notes {}\n>  if {[package vcompare $git_version \"1.6.6.2\"] >= 0} {\n\nSeems to work well.\n\nHowever, an \"Reported-by\" would have been nice.\n\nPeople don't seem to use gitk with the RC releases because nobody else\ncomplains...\n\n-Mathias\n"},{"id":"159450","messageId":"20110113192243.GA20625@burratino","threadId":"26186","inReplyTo":"4D2C5F3E.2020007@debugon.org","subject":"Re: [PATCH] gitk: Take only numeric version components when computing $git_version","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2011-01-13T19:22:43Z","receivedAt":"2011-01-13T19:22:43Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Mathias Lafeldt wrote:\n> Anders Kaseorg wrote:\n\n>> This fixes errors running with release candidate versions of Git:\n>>   Error in startup script: expected version number but got \"1.7.4-rc0\"\n[...]\n> People don't seem to use gitk with the RC releases because nobody else\n> complains...\n\nGIT-VERSION-GEN contains:\n\n\tDEF_VER=v1.7.4-rc1\n\t[...]\n\tif test -f version\n\tthen\n\t\t[...]\n\telif test -d .git -o -f .git &&\n\t\t[...]\n\tthen\n\t\tVN=$(echo \"$VN\" | sed -e 's/-/./g');\n\telse\n\t\tVN=\"$DEF_VER\"\n\tfi\n\nSo after building from a tarball generated with \"git archive\", \"git version\"\nproduces v1.7.4-rc1, producing errors from gitk, but after building\nfrom the git repo or a tarball generated with \"make dist\", the version\nis v1.7.4.rc1 (which gitk accepts).\n\nAnders's fix looks good to me for robustness reasons anyway, so\n\n Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nMaybe the substitution in GIT-VERSION-GEN should say something like\n\n\t\tVN=$(echo \"$VN\" | sed -e 's/-\\([^r]\\)/.\\1/g')\n\nmeaning the result for tagged rcs would not depend on whether git is\npresent?  Alternatively, DEF_VER could be set to v1.7.4.rc1, which\ndoes not seem as nice to me.\n"},{"id":"159578","messageId":"4D355966.7090707@debugon.org","threadId":"26186","inReplyTo":"20110113192243.GA20625@burratino","subject":"Re: [PATCH] gitk: Take only numeric version components when computing $git_version","fromName":"Mathias Lafeldt","fromEmail":"misfire@debugon.org","sentAt":"2011-01-18T09:12:06Z","receivedAt":"2011-01-18T09:12:06Z","isPatch":true,"sender":{"key":"misfire@debugon.org","avatar":"https://avatars.githubusercontent.com/u/158074?v=4"},"body":"Jonathan Nieder wrote:\n> [...]\n> So after building from a tarball generated with \"git archive\", \"git version\"\n> produces v1.7.4-rc1, producing errors from gitk, but after building\n> from the git repo or a tarball generated with \"make dist\", the version\n> is v1.7.4.rc1 (which gitk accepts).\n> \n> Anders's fix looks good to me for robustness reasons anyway, so\n> \n>  Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n> \n\nOK then. Junio? :)\n\n> Maybe the substitution in GIT-VERSION-GEN should say something like\n> \n> \t\tVN=$(echo \"$VN\" | sed -e 's/-\\([^r]\\)/.\\1/g')\n> \n> meaning the result for tagged rcs would not depend on whether git is\n> present?  Alternatively, DEF_VER could be set to v1.7.4.rc1, which\n> does not seem as nice to me.\n"},{"id":"159597","messageId":"20110118104742.GA3279@brick.ozlabs.ibm.com","threadId":"26186","inReplyTo":"4D355966.7090707@debugon.org","subject":"Re: [PATCH] gitk: Take only numeric version components when computing $git_version","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2011-01-18T10:47:42Z","receivedAt":"2011-01-18T10:47:42Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Tue, Jan 18, 2011 at 10:12:06AM +0100, Mathias Lafeldt wrote:\n> Jonathan Nieder wrote:\n> > [...]\n> > So after building from a tarball generated with \"git archive\", \"git version\"\n> > produces v1.7.4-rc1, producing errors from gitk, but after building\n> > from the git repo or a tarball generated with \"make dist\", the version\n> > is v1.7.4.rc1 (which gitk accepts).\n> > \n> > Anders's fix looks good to me for robustness reasons anyway, so\n> > \n> >  Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n> > \n> \n> OK then. Junio? :)\n\nI'll pick it up.\n\nPaul.\n"},{"id":"159601","messageId":"7voc7dkink.fsf@alter.siamese.dyndns.org","threadId":"26186","inReplyTo":"20110118104742.GA3279@brick.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: Take only numeric version components when computing $git_version","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-18T21:26:39Z","receivedAt":"2011-01-18T21:26:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Paul Mackerras <paulus@samba.org> writes:\n\n>> OK then. Junio? :)\n>\n> I'll pick it up.\n\nThanks.\n"},{"id":"159629","messageId":"20110119093518.GB5728@brick.ozlabs.ibm.com","threadId":"26186","inReplyTo":"1294360953.21006.2.camel@fixed-disk","subject":"Re: [PATCH] gitk: Take only numeric version components when computing $git_version","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2011-01-19T09:35:18Z","receivedAt":"2011-01-19T09:35:18Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Thu, Jan 06, 2011 at 05:42:33PM -0700, Anders Kaseorg wrote:\n\n> This fixes errors running with release candidate versions of Git:\n>   Error in startup script: expected version number but got \"1.7.4-rc0\"\n\nThanks, applied.\n\nJunio, you could do a pull from my gitk repository at your convenience.\n\nPaul.\n"}]}