]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ml/abandon-old-version' (early part)
authorJohannes Sixt <j6t@kdbg.org>
Tue, 22 Jul 2025 16:29:54 +0000 (18:29 +0200)
committerJohannes Sixt <j6t@kdbg.org>
Tue, 22 Jul 2025 16:29:54 +0000 (18:29 +0200)
* 'ml/abandon-old-version' (early part):
  gitk: allow horizontal commit-graph scrolling
  gitk: update aqua scrolling for TclTk 8.6 / TIP171
  gitk: update x11 scrolling for TclTk 8.6 / TIP 171
  gitk: update win32 scrolling for Tk 8.6 / TIP 171
  gitk: mousewheel scrolling functions for Tk 8.6
  gitk: wheel scrolling multiplier preference
  gitk: separate x11 / win32 / aqua Mouse bindings
  gitk: remove non-ttk support code
  gitk: replace ${NS} with ttk
  gitk: always use themed Tk (ttk)
  gitk: use $config_variables as list for save/restore
  gitk: remove implementations for Tcl/Tk < 8.6
  gitk: Make TclTk 8.6 the minimum, allow 8.7
  gitk: remove code targeting git <= 1.7.2
  gitk: require git >= 2.20

1  2 
gitk

diff --cc gitk
index 153ca3e64037f94c8cfde24cfdc46e0ca45c6162,ba112586bed7e025f55c6ae9ee4f7e2492052900..c6f4758a6cdeb3c511e19b548abaffd462add6a4
--- 1/gitk
--- 2/gitk
+++ b/gitk
@@@ -698,8 -716,6 +717,7 @@@ proc updatecommits {} 
      global mainheadid viewmainheadid viewmainheadid_orig pending_select
      global hasworktree
      global varcid vposids vnegids vflags vrevs
-     global show_notes
 +    global hashlength
  
      set hasworktree [hasworktree]
      rereadrefs
@@@ -2294,10 -2311,8 +2326,8 @@@ proc makewindow {} 
      global headctxmenu progresscanv progressitem progresscoords statusw
      global fprogitem fprogcoord lastprogupdate progupdatepending
      global rprogitem rprogcoord rownumsel numcommits
-     global have_tk85 have_tk86 use_ttk NS
-     global git_version
      global worddiff
-     global hashlength
 -    global scroll_D0
++    global hashlength scroll_D0
  
      # The "mc" arguments here are purely so that xgettext
      # sees the following string as needing to be translated
          -command gotocommit -width 8
      $sha1but conf -disabledforeground [$sha1but cget -foreground]
      pack .tf.bar.sha1label -side left
-     ${NS}::entry $sha1entry -width $hashlength -font textfont -textvariable sha1string
 -    ttk::entry $sha1entry -width 40 -font textfont -textvariable sha1string
++    ttk::entry $sha1entry -width $hashlength -font textfont -textvariable sha1string
      trace add variable sha1string write sha1change
      pack $sha1entry -side left -pady 2
  
@@@ -9471,8 -9333,7 +9358,8 @@@ proc doseldiff {oldid newid} 
  }
  
  proc mkpatch {} {
-     global rowmenuid currentid commitinfo patchtop patchnum NS
+     global rowmenuid currentid commitinfo patchtop patchnum
 +    global hashlength
  
      if {![info exists currentid]} return
      set oldid $currentid
      catch {destroy $top}
      ttk_toplevel $top
      make_transient $top .
-     ${NS}::label $top.title -text [mc "Generate patch"]
+     ttk::label $top.title -text [mc "Generate patch"]
      grid $top.title - -pady 10
-     ${NS}::label $top.from -text [mc "From:"]
-     ${NS}::entry $top.fromsha1 -width $hashlength
+     ttk::label $top.from -text [mc "From:"]
 -    ttk::entry $top.fromsha1 -width 40
++    ttk::entry $top.fromsha1 -width $hashlength
      $top.fromsha1 insert 0 $oldid
      $top.fromsha1 conf -state readonly
      grid $top.from $top.fromsha1 -sticky w
      $top.fromhead insert 0 $oldhead
      $top.fromhead conf -state readonly
      grid x $top.fromhead -sticky w
-     ${NS}::label $top.to -text [mc "To:"]
-     ${NS}::entry $top.tosha1 -width $hashlength
+     ttk::label $top.to -text [mc "To:"]
 -    ttk::entry $top.tosha1 -width 40
++    ttk::entry $top.tosha1 -width $hashlength
      $top.tosha1 insert 0 $newid
      $top.tosha1 conf -state readonly
      grid $top.to $top.tosha1 -sticky w
@@@ -9561,18 -9422,17 +9448,18 @@@ proc mkpatchcan {} 
  }
  
  proc mktag {} {
-     global rowmenuid mktagtop commitinfo NS
+     global rowmenuid mktagtop commitinfo
 +    global hashlength
  
      set top .maketag
      set mktagtop $top
      catch {destroy $top}
      ttk_toplevel $top
      make_transient $top .
-     ${NS}::label $top.title -text [mc "Create tag"]
+     ttk::label $top.title -text [mc "Create tag"]
      grid $top.title - -pady 10
-     ${NS}::label $top.id -text [mc "ID:"]
-     ${NS}::entry $top.sha1 -width $hashlength
+     ttk::label $top.id -text [mc "ID:"]
 -    ttk::entry $top.sha1 -width 40
++    ttk::entry $top.sha1 -width $hashlength
      $top.sha1 insert 0 $rowmenuid
      $top.sha1 conf -state readonly
      grid $top.id $top.sha1 -sticky w
@@@ -9694,18 -9553,17 +9581,18 @@@ proc copyreference {} 
  }
  
  proc writecommit {} {
-     global rowmenuid wrcomtop commitinfo wrcomcmd NS
+     global rowmenuid wrcomtop commitinfo wrcomcmd
 +    global hashlength
  
      set top .writecommit
      set wrcomtop $top
      catch {destroy $top}
      ttk_toplevel $top
      make_transient $top .
-     ${NS}::label $top.title -text [mc "Write commit to file"]
+     ttk::label $top.title -text [mc "Write commit to file"]
      grid $top.title - -pady 10
-     ${NS}::label $top.id -text [mc "ID:"]
-     ${NS}::entry $top.sha1 -width $hashlength
+     ttk::label $top.id -text [mc "ID:"]
 -    ttk::entry $top.sha1 -width 40
++    ttk::entry $top.sha1 -width $hashlength
      $top.sha1 insert 0 $rowmenuid
      $top.sha1 conf -state readonly
      grid $top.id $top.sha1 -sticky w
@@@ -9784,17 -9641,16 +9670,17 @@@ proc mvbranch {} 
  }
  
  proc branchdia {top valvar uivar} {
-     global NS commitinfo
+     global commitinfo
 +    global hashlength
      upvar $valvar val $uivar ui
  
      catch {destroy $top}
      ttk_toplevel $top
      make_transient $top .
-     ${NS}::label $top.title -text $ui(title)
+     ttk::label $top.title -text $ui(title)
      grid $top.title - -pady 10
-     ${NS}::label $top.id -text [mc "ID:"]
-     ${NS}::entry $top.sha1 -width $hashlength
+     ttk::label $top.id -text [mc "ID:"]
 -    ttk::entry $top.sha1 -width 40
++    ttk::entry $top.sha1 -width $hashlength
      $top.sha1 insert 0 $val(id)
      $top.sha1 conf -state readonly
      grid $top.id $top.sha1 -sticky w
      $top.head conf -state readonly
      grid x $top.head -sticky ew
      grid columnconfigure $top 1 -weight 1
-     ${NS}::label $top.nlab -text [mc "Name:"]
-     ${NS}::entry $top.name -width $hashlength
+     ttk::label $top.nlab -text [mc "Name:"]
 -    ttk::entry $top.name -width 40
++    ttk::entry $top.name -width $hashlength
      $top.name insert 0 $val(name)
      grid $top.nlab $top.name -sticky w
-     ${NS}::frame $top.buts
-     ${NS}::button $top.buts.go -text $ui(accept) -command $val(command)
-     ${NS}::button $top.buts.can -text [mc "Cancel"] -command "catch {destroy $top}"
+     ttk::frame $top.buts
+     ttk::button $top.buts.go -text $ui(accept) -command $val(command)
+     ttk::button $top.buts.can -text [mc "Cancel"] -command "catch {destroy $top}"
      bind $top <Key-Return> $val(command)
      bind $top <Key-Escape> "catch {destroy $top}"
      grid $top.buts.go $top.buts.can
@@@ -10292,10 -10148,7 +10178,10 @@@ proc showrefs {} 
      pack $top.f.e -side right -fill x -expand 1
      pack $top.f.l -side left
      grid $top.f - -sticky ew -pady 2
-     ${NS}::checkbutton $top.sort -text [mc "Sort refs by type"] \
++    ttk::checkbutton $top.sort -text [mc "Sort refs by type"] \
 +        -variable sortrefsbytype -command {refill_reflist}
 +    grid $top.sort - -sticky w -pady 2
-     ${NS}::button $top.close -command [list destroy $top] -text [mc "Close"]
+     ttk::button $top.close -command [list destroy $top] -text [mc "Close"]
      bind $top <Key-Escape> [list destroy $top]
      grid $top.close -
      grid columnconfigure $top 0 -weight 1
@@@ -11771,25 -11528,22 +11589,21 @@@ proc fontcan {} 
      }
  }
  
- if {[package vsatisfies [package provide Tk] 8.6]} {
-     # In Tk 8.6 we have a native font chooser dialog. Overwrite the above
-     # function to make use of it.
-     proc choosefont {font which} {
-         tk fontchooser configure -title $which -font $font \
-             -command [list on_choosefont $font $which]
-         tk fontchooser show
-     }
-     proc on_choosefont {font which newfont} {
-         global fontparam
-         array set f [font actual $newfont]
-         set fontparam(which) $which
-         set fontparam(font) $font
-         set fontparam(family) $f(-family)
-         set fontparam(size) $f(-size)
-         set fontparam(weight) $f(-weight)
-         set fontparam(slant) $f(-slant)
-         fontok
-     }
+ proc choosefont {font which} {
+     tk fontchooser configure -title $which -font $font \
+         -command [list on_choosefont $font $which]
+     tk fontchooser show
+ }
+ proc on_choosefont {font which newfont} {
+     global fontparam
 -    puts stderr "$font $newfont"
+     array set f [font actual $newfont]
+     set fontparam(which) $which
+     set fontparam(font) $font
+     set fontparam(family) $f(-family)
+     set fontparam(size) $f(-size)
+     set fontparam(weight) $f(-weight)
+     set fontparam(slant) $f(-slant)
+     fontok
  }
  
  proc selfontfam {} {
@@@ -11819,11 -11567,7 +11627,8 @@@ proc create_prefs_page {w} 
  }
  
  proc prefspage_general {notebook} {
-     global NS maxwidth maxgraphpct showneartags showlocalchanges
-     global tabstop wrapcomment wrapdefault limitdiffs
-     global autocopy autoselect autosellen extdifftool perfile_attrs
-     global hideremotes want_ttk have_ttk maxrefs web_browser
+     global {*}$::config_variables
 +    global hashlength
  
      set page [create_prefs_page $notebook.general]
  
              -variable autoselect
          grid x $page.autoselect -sticky w
      }
 -    spinbox $page.autosellen -from 1 -to 40 -width 4 -textvariable autosellen
 +
 +    spinbox $page.autosellen -from 1 -to $hashlength -width 4 -textvariable autosellen
-     ${NS}::label $page.autosellenl -text [mc "Length of commit ID to copy"]
+     ttk::label $page.autosellenl -text [mc "Length of commit ID to copy"]
      grid x $page.autosellenl $page.autosellen -sticky w
+     ttk::label $page.kscroll1 -text [mc "Wheel scrolling multiplier"]
+     spinbox $page.kscroll -from 1 -to 20 -width 4 -textvariable kscroll
+     grid x $page.kscroll1 $page.kscroll -sticky w
  
-     ${NS}::label $page.ddisp -text [mc "Diff display options"] -font mainfontbold
+     ttk::label $page.ddisp -text [mc "Diff display options"] -font mainfontbold
      grid $page.ddisp - -sticky w -pady 10
-     ${NS}::label $page.tabstopl -text [mc "Tab spacing"]
+     ttk::label $page.tabstopl -text [mc "Tab spacing"]
      spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
      grid x $page.tabstopl $page.tabstop -sticky w
  
@@@ -12685,9 -12382,8 +12456,8 @@@ set kscroll 
  set datetimeformat "%Y-%m-%d %H:%M:%S"
  set autocopy 0
  set autoselect 1
 -set autosellen 40
 +set autosellen $hashlength
  set perfile_attrs 0
- set want_ttk 1
  
  if {[tk windowingsystem] eq "aqua"} {
      set extdifftool "opendiff"
@@@ -12780,19 -12476,65 +12550,66 @@@ catch 
  config_check_tmp_exists 50
  
  set config_variables {
-     mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth
-     cmitmode wrapcomment wrapdefault autocopy autoselect autosellen
-     showneartags maxrefs visiblerefs
-     hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk
-     bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors
-     markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor
-     extdifftool perfile_attrs headbgcolor headfgcolor headoutlinecolor
-     remotebgcolor tagbgcolor tagfgcolor tagoutlinecolor reflinecolor
-     filesepbgcolor filesepfgcolor linehoverbgcolor linehoverfgcolor
-     linehoveroutlinecolor mainheadcirclecolor workingfilescirclecolor
-     indexcirclecolor circlecolors linkfgcolor circleoutlinecolor diffbgcolors
-     sortrefsbytype web_browser
+     autocopy
+     autoselect
+     autosellen
+     bgcolor
+     circlecolors
+     circleoutlinecolor
+     cmitmode
+     colors
+     currentsearchhitbgcolor
+     datetimeformat
+     diffbgcolors
+     diffcolors
+     diffcontext
+     extdifftool
+     fgcolor
+     filesepbgcolor
+     filesepfgcolor
+     findmergefiles
+     foundbgcolor
+     headbgcolor
+     headfgcolor
+     headoutlinecolor
+     hideremotes
+     indexcirclecolor
+     kscroll
+     limitdiffs
+     linehoverbgcolor
+     linehoverfgcolor
+     linehoveroutlinecolor
+     linkfgcolor
+     mainfont
+     mainheadcirclecolor
+     markbgcolor
+     maxgraphpct
+     maxrefs
+     maxwidth
+     mergecolors
+     perfile_attrs
+     reflinecolor
+     remotebgcolor
+     selectbgcolor
+     showlocalchanges
+     showneartags
++    sortrefsbytype
+     tabstop
+     tagbgcolor
+     tagfgcolor
+     tagoutlinecolor
+     textfont
+     uicolor
+     uifgcolor
+     uifgdisabledcolor
+     uifont
+     visiblerefs
+     web_browser
+     workingfilescirclecolor
+     wrapcomment
+     wrapdefault
  }
  foreach var $config_variables {
      config_init_trace $var
      trace add variable $var write config_variable_change_cb