All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG: gitk fails to parse 1.7.4-rc0 version string
@ 2011-01-04 12:44 Mathias Lafeldt
  2011-01-07  0:42 ` [PATCH] gitk: Take only numeric version components when computing $git_version Anders Kaseorg
  0 siblings, 1 reply; 8+ messages in thread
From: Mathias Lafeldt @ 2011-01-04 12:44 UTC (permalink / raw)
  To: git; +Cc: paulus

Looks like gitk doesn't like the "-rc0" suffix.

$ git --version
git version 1.7.4-rc0

$ gitk
Error in startup script: expected version number but got "1.7.4-rc0"
    while executing
"package vcompare $git_version "1.6.6.2""
    (file "/usr/local/bin/gitk" line 1)

I temporarily fixed it by hard-coding the version string:

diff --git a/gitk-git/gitk b/gitk-git/gitk
index e82c6bf..367446e 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -11581,7 +11581,7 @@ if {![info exists have_ttk]} {
 set use_ttk [expr {$have_ttk && $want_ttk}]
 set NS [expr {$use_ttk ? "ttk" : ""}]

-set git_version [join [lrange [split [lindex [exec git version] end] .]
0 2] .]
+set git_version "1.7.4"


 set show_notes {}
 if {[package vcompare $git_version "1.6.6.2"] >= 0} {


-Mathias

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] gitk: Take only numeric version components when computing $git_version
  2011-01-04 12:44 BUG: gitk fails to parse 1.7.4-rc0 version string Mathias Lafeldt
@ 2011-01-07  0:42 ` Anders Kaseorg
  2011-01-11 13:46   ` Mathias Lafeldt
  2011-01-19  9:35   ` Paul Mackerras
  0 siblings, 2 replies; 8+ messages in thread
From: Anders Kaseorg @ 2011-01-07  0:42 UTC (permalink / raw)
  To: Paul Mackerras, Junio C Hamano; +Cc: Mathias Lafeldt, git

This fixes errors running with release candidate versions of Git:
  Error in startup script: expected version number but got "1.7.4-rc0"

Also, $git_version is no longer artificially limited to three
components.  That limitation was added by commit
194bbf6cc8c2f3c14a920c841841d66b7667a848 to deal with msysGit version
strings like “1.6.4.msysgit.0”, and we don’t need it now.  Hence as
another side effect, this enables showing notes with git version
1.6.6.2 or 1.6.6.3, as originally intended by commit
7defefb134270b6e8ab3e422b343b41a4a383f5d.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
 gitk-git/gitk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index e82c6bf..9cbc09d 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -11581,7 +11581,7 @@ if {![info exists have_ttk]} {
 set use_ttk [expr {$have_ttk && $want_ttk}]
 set NS [expr {$use_ttk ? "ttk" : ""}]
 
-set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]
+regexp {^git version ([\d.]*\d)} [exec git version] _ git_version
 
 set show_notes {}
 if {[package vcompare $git_version "1.6.6.2"] >= 0} {
-- 
1.7.4-rc0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] gitk: Take only numeric version components when computing $git_version
  2011-01-07  0:42 ` [PATCH] gitk: Take only numeric version components when computing $git_version Anders Kaseorg
@ 2011-01-11 13:46   ` Mathias Lafeldt
  2011-01-13 19:22     ` Jonathan Nieder
  2011-01-19  9:35   ` Paul Mackerras
  1 sibling, 1 reply; 8+ messages in thread
From: Mathias Lafeldt @ 2011-01-11 13:46 UTC (permalink / raw)
  To: Anders Kaseorg; +Cc: Paul Mackerras, Junio C Hamano, git

Anders Kaseorg wrote:
> This fixes errors running with release candidate versions of Git:
>   Error in startup script: expected version number but got "1.7.4-rc0"
> 
> Also, $git_version is no longer artificially limited to three
> components.  That limitation was added by commit
> 194bbf6cc8c2f3c14a920c841841d66b7667a848 to deal with msysGit version
> strings like “1.6.4.msysgit.0”, and we don’t need it now.  Hence as
> another side effect, this enables showing notes with git version
> 1.6.6.2 or 1.6.6.3, as originally intended by commit
> 7defefb134270b6e8ab3e422b343b41a4a383f5d.
> 
> Signed-off-by: Anders Kaseorg <andersk@mit.edu>
> ---
>  gitk-git/gitk |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/gitk-git/gitk b/gitk-git/gitk
> index e82c6bf..9cbc09d 100755
> --- a/gitk-git/gitk
> +++ b/gitk-git/gitk
> @@ -11581,7 +11581,7 @@ if {![info exists have_ttk]} {
>  set use_ttk [expr {$have_ttk && $want_ttk}]
>  set NS [expr {$use_ttk ? "ttk" : ""}]
>  
> -set git_version [join [lrange [split [lindex [exec git version] end] .] 0 2] .]
> +regexp {^git version ([\d.]*\d)} [exec git version] _ git_version
>  
>  set show_notes {}
>  if {[package vcompare $git_version "1.6.6.2"] >= 0} {

Seems to work well.

However, an "Reported-by" would have been nice.

People don't seem to use gitk with the RC releases because nobody else
complains...

-Mathias

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gitk: Take only numeric version components when computing $git_version
  2011-01-11 13:46   ` Mathias Lafeldt
@ 2011-01-13 19:22     ` Jonathan Nieder
  2011-01-18  9:12       ` Mathias Lafeldt
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Nieder @ 2011-01-13 19:22 UTC (permalink / raw)
  To: Mathias Lafeldt; +Cc: Anders Kaseorg, Paul Mackerras, Junio C Hamano, git

Mathias Lafeldt wrote:
> Anders Kaseorg wrote:

>> This fixes errors running with release candidate versions of Git:
>>   Error in startup script: expected version number but got "1.7.4-rc0"
[...]
> People don't seem to use gitk with the RC releases because nobody else
> complains...

GIT-VERSION-GEN contains:

	DEF_VER=v1.7.4-rc1
	[...]
	if test -f version
	then
		[...]
	elif test -d .git -o -f .git &&
		[...]
	then
		VN=$(echo "$VN" | sed -e 's/-/./g');
	else
		VN="$DEF_VER"
	fi

So after building from a tarball generated with "git archive", "git version"
produces v1.7.4-rc1, producing errors from gitk, but after building
from the git repo or a tarball generated with "make dist", the version
is v1.7.4.rc1 (which gitk accepts).

Anders's fix looks good to me for robustness reasons anyway, so

 Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Maybe the substitution in GIT-VERSION-GEN should say something like

		VN=$(echo "$VN" | sed -e 's/-\([^r]\)/.\1/g')

meaning the result for tagged rcs would not depend on whether git is
present?  Alternatively, DEF_VER could be set to v1.7.4.rc1, which
does not seem as nice to me.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gitk: Take only numeric version components when computing $git_version
  2011-01-13 19:22     ` Jonathan Nieder
@ 2011-01-18  9:12       ` Mathias Lafeldt
  2011-01-18 10:47         ` Paul Mackerras
  0 siblings, 1 reply; 8+ messages in thread
From: Mathias Lafeldt @ 2011-01-18  9:12 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Anders Kaseorg, Paul Mackerras, Junio C Hamano, git

Jonathan Nieder wrote:
> [...]
> So after building from a tarball generated with "git archive", "git version"
> produces v1.7.4-rc1, producing errors from gitk, but after building
> from the git repo or a tarball generated with "make dist", the version
> is v1.7.4.rc1 (which gitk accepts).
> 
> Anders's fix looks good to me for robustness reasons anyway, so
> 
>  Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
> 

OK then. Junio? :)

> Maybe the substitution in GIT-VERSION-GEN should say something like
> 
> 		VN=$(echo "$VN" | sed -e 's/-\([^r]\)/.\1/g')
> 
> meaning the result for tagged rcs would not depend on whether git is
> present?  Alternatively, DEF_VER could be set to v1.7.4.rc1, which
> does not seem as nice to me.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gitk: Take only numeric version components when computing $git_version
  2011-01-18  9:12       ` Mathias Lafeldt
@ 2011-01-18 10:47         ` Paul Mackerras
  2011-01-18 21:26           ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Mackerras @ 2011-01-18 10:47 UTC (permalink / raw)
  To: Mathias Lafeldt; +Cc: Jonathan Nieder, Anders Kaseorg, Junio C Hamano, git

On Tue, Jan 18, 2011 at 10:12:06AM +0100, Mathias Lafeldt wrote:
> Jonathan Nieder wrote:
> > [...]
> > So after building from a tarball generated with "git archive", "git version"
> > produces v1.7.4-rc1, producing errors from gitk, but after building
> > from the git repo or a tarball generated with "make dist", the version
> > is v1.7.4.rc1 (which gitk accepts).
> > 
> > Anders's fix looks good to me for robustness reasons anyway, so
> > 
> >  Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
> > 
> 
> OK then. Junio? :)

I'll pick it up.

Paul.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gitk: Take only numeric version components when computing $git_version
  2011-01-18 10:47         ` Paul Mackerras
@ 2011-01-18 21:26           ` Junio C Hamano
  0 siblings, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2011-01-18 21:26 UTC (permalink / raw)
  To: Paul Mackerras
  Cc: Mathias Lafeldt, Jonathan Nieder, Anders Kaseorg, Junio C Hamano, git

Paul Mackerras <paulus@samba.org> writes:

>> OK then. Junio? :)
>
> I'll pick it up.

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gitk: Take only numeric version components when computing $git_version
  2011-01-07  0:42 ` [PATCH] gitk: Take only numeric version components when computing $git_version Anders Kaseorg
  2011-01-11 13:46   ` Mathias Lafeldt
@ 2011-01-19  9:35   ` Paul Mackerras
  1 sibling, 0 replies; 8+ messages in thread
From: Paul Mackerras @ 2011-01-19  9:35 UTC (permalink / raw)
  To: Anders Kaseorg; +Cc: Junio C Hamano, Mathias Lafeldt, git

On Thu, Jan 06, 2011 at 05:42:33PM -0700, Anders Kaseorg wrote:

> This fixes errors running with release candidate versions of Git:
>   Error in startup script: expected version number but got "1.7.4-rc0"

Thanks, applied.

Junio, you could do a pull from my gitk repository at your convenience.

Paul.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-01-19  9:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-04 12:44 BUG: gitk fails to parse 1.7.4-rc0 version string Mathias Lafeldt
2011-01-07  0:42 ` [PATCH] gitk: Take only numeric version components when computing $git_version Anders Kaseorg
2011-01-11 13:46   ` Mathias Lafeldt
2011-01-13 19:22     ` Jonathan Nieder
2011-01-18  9:12       ` Mathias Lafeldt
2011-01-18 10:47         ` Paul Mackerras
2011-01-18 21:26           ` Junio C Hamano
2011-01-19  9:35   ` Paul Mackerras

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.