summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Kaseorg <andersk@MIT.EDU>2011-01-06 17:42:33 -0700
committerPaul Mackerras <paulus@samba.org>2011-01-19 20:31:21 +1100
commit7add5aff869746ced2b506801176561d4b80e427 (patch)
tree7cad3afac599e595ca2bdf968886d270c26599b5
parent6758ad94405258294918ca5520acf1a3184a78b9 (diff)
downloadgit-7add5aff869746ced2b506801176561d4b80e427.tar.gz
gitk: Take only numeric version components when computing $git_version
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 194bbf6cc8c2 ("gitk: Handle msysGit version during version comparisons") 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 7defefb13427 ("gitk: Show notes by default (like git log does"). Signed-off-by: Anders Kaseorg <andersk@mit.edu> Reported-by: Mathias Lafeldt <misfire@debugon.org> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rwxr-xr-xgitk2
1 files changed, 1 insertions, 1 deletions
diff --git a/gitk b/gitk
index e82c6bfede..9cbc09de6a 100755
--- a/gitk
+++ b/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} {