From 84330b019983691e327c42261387baa524f9b533 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 7 Jan 2011 19:08:00 -0700 Subject: [PATCH] Fix gitk error running with release candidate versions of Git After building from a tarball generated with git archive, git version emits v1.7.4-rc1, resulting in "expected version number" errors from gitk. Meanwhile, after building from a git checkout or a tarball generated with "make dist", the version is v1.7.4.rc1, which gitk accepts. Confusing. [jn: changelog entries tweaked based on later discussion] Signed-off-by: Anders Kaseorg Signed-off-by: Jonathan Nieder --- debian/changelog | 2 ++ ...nly-numeric-version-components-when-comput.diff | 42 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 debian/diff/0008-gitk-Take-only-numeric-version-components-when-comput.diff diff --git a/debian/changelog b/debian/changelog index 0649323c59..67eab6efce 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ git (1:1.7.4~rc1-0.1) experimental; urgency=low [ Anders Kaseorg ] * debian/git.docs, debian/rules: deal with RelNotes subdirectory. + * debian/diff/0004-gitk-Take-only-numeric-...diff: new; gitk: do + not error out when git version number contains "-rc". [ Jonathan Nieder ] * debian/diff/0003, 0007, 0010-0034: remove, applied upstream. diff --git a/debian/diff/0008-gitk-Take-only-numeric-version-components-when-comput.diff b/debian/diff/0008-gitk-Take-only-numeric-version-components-when-comput.diff new file mode 100644 index 0000000000..71d48e8958 --- /dev/null +++ b/debian/diff/0008-gitk-Take-only-numeric-version-components-when-comput.diff @@ -0,0 +1,42 @@ +From ab4590afa07a147b17aa80ac10fb938d02c06e77 Mon Sep 17 00:00:00 2001 +From: Anders Kaseorg +Date: Thu, 6 Jan 2011 17:42:33 -0700 +Subject: gitk: Take only numeric version components when computing $git_version +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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. + +Reported-by: Mathias Lafeldt +Signed-off-by: Anders Kaseorg +Signed-off-by: Jonathan Nieder +--- + gitk-git/gitk | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/gitk-git/gitk b/gitk-git/gitk +index 36d3996..233b69b 100644 +--- a/gitk-git/gitk ++++ b/gitk-git/gitk +@@ -11583,7 +11583,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.rc1 + -- 2.11.4.GIT