]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gitk: require git >= 2.20
authorMark Levedahl <mlevedahl@gmail.com>
Thu, 5 Jun 2025 21:09:02 +0000 (17:09 -0400)
committerMark Levedahl <mlevedahl@gmail.com>
Wed, 16 Jul 2025 16:06:21 +0000 (12:06 -0400)
gitk has alternate code paths for early git up to 1.72, and has no
defined minimum version. Setting any version > 1.72 as minimum will
allow removing those code paths.

The recent set of advisories published for git, gitk, and git-gui add
updates for v2.43 and later, but Debian has buster withgit 2.20 still
available.  While Debian would be responsible for backporting any fixes
to such an early version, we have no good reason preclude it.
So, make 2.20 the minimum required git version.

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
gitk

diff --git a/gitk b/gitk
index 5be8b2aeb0e7be24a94c02944b792e7eaf152a9a..c05808b353afb18662d07c38d2267120ce46b0fd 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -9,6 +9,22 @@ exec wish "$0" -- "$@"
 
 package require Tk
 
+set MIN_GIT_VERSION 2.20
+regexp {^git version ([\d.]*\d)} [exec git version] _ git_version
+if {[package vcompare $git_version $MIN_GIT_VERSION] < 0} {
+    set message "The git executable found is too old.
+The minimum required version is $MIN_GIT_VERSION.0.
+The version of git found is $git_version."
+
+    catch {wm withdraw .}
+    tk_messageBox \
+        -icon error \
+        -type ok \
+        -title "gitk: fatal error" \
+        -message $message
+    exit 1
+}
+
 ######################################################################
 ##
 ## Enabling platform-specific code paths
@@ -12820,8 +12836,6 @@ if {$use_ttk} {
     setttkstyle
 }
 
-regexp {^git version ([\d.]*\d)} [exec git version] _ git_version
-
 set show_notes {}
 if {[package vcompare $git_version "1.6.6.2"] >= 0} {
     set show_notes "--show-notes"