]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gitk: Make TclTk 8.6 the minimum, allow 8.7
authorMark Levedahl <mlevedahl@gmail.com>
Sun, 13 Jul 2025 20:10:33 +0000 (16:10 -0400)
committerMark Levedahl <mlevedahl@gmail.com>
Wed, 16 Jul 2025 16:07:15 +0000 (12:07 -0400)
gitk runs under wish so naturally has Tcl and Tk available and of the
same version. gitk sets a requirement on Tk version >= 8.4: this is very
outdated, and the earliest Tcl currently shipping on any supported OS is
8.6. As 8.7 is in alpha test and is generally compatible with 8.6, we
should allow 8.7. Tcl 9.0 has planned compatibility breaking changes so
is not yet supported.

Let's change the requirements to 8.6-8.7, but not 9.0. Place this at the
top of file so the requirements are obvious.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
gitk

diff --git a/gitk b/gitk
index b7d30af0fbbf15f65a052d4f30baa9505b921435..b5918008a94d3b5fd1d3a04641a5a5f21491527d 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -7,7 +7,15 @@ exec wish "$0" -- "$@"
 # and distributed under the terms of the GNU General Public Licence,
 # either version 2, or (at your option) any later version.
 
-package require Tk
+if {[catch {package require Tcl 8.6-8.8} err]} {
+    catch {wm withdraw .}
+    tk_messageBox \
+        -icon error \
+        -type ok \
+        -title "gitk: fatal error" \
+        -message $err
+    exit 1
+}
 
 set MIN_GIT_VERSION 2.20
 regexp {^git version ([\d.]*\d)} [exec git version] _ git_version
@@ -12509,13 +12517,6 @@ namespace import ::msgcat::mc
 ## And eventually load the actual message catalog
 ::msgcat::mcload $gitk_msgsdir
 
-# First check that Tcl/Tk is recent enough
-if {[catch {package require Tk 8.4} err]} {
-    show_error {} . [mc "Sorry, gitk cannot run with this version of Tcl/Tk.\n\
-                         Gitk requires at least Tcl/Tk 8.4."]
-    exit 1
-}
-
 # on OSX bring the current Wish process window to front
 if {[tk windowingsystem] eq "aqua"} {
     safe_exec [list osascript -e [format {