]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
9 days agoMerge branch 'ml/tcltk-9'
Johannes Sixt [Fri, 1 Aug 2025 16:39:15 +0000 (18:39 +0200)] 
Merge branch 'ml/tcltk-9'

* ml/tcltk-9:
  gitk: allow Tcl/Tk 9.0+
  gitk: use -profile tcl8 on encoding conversions
  gitk: use -profile tcl8 for file input with Tcl 9
  gitk: Tcl9 doesn't expand ~, use $env(HOME)
  gitk: switch to -translation binary
  gitk: update scrolling for TclTk 8.7+ / TIP 474

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
9 days agoMerge branch 'oa/hide-more-refs'
Johannes Sixt [Fri, 1 Aug 2025 16:38:08 +0000 (18:38 +0200)] 
Merge branch 'oa/hide-more-refs'

* oa/hide-more-refs:
  gitk: Add user preference to hide specific references

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
9 days agoMerge branch 'ml/abandon-old-version'
Johannes Sixt [Fri, 1 Aug 2025 16:36:15 +0000 (18:36 +0200)] 
Merge branch 'ml/abandon-old-version'

* ml/abandon-old-version:
  gitk: restore ui colors after cancelling config dialog
  gitk: set config dialog color swatches in one place

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
9 days agoMerge branch 'master' of github.com:alshopov/gitk
Johannes Sixt [Fri, 1 Aug 2025 16:35:44 +0000 (18:35 +0200)] 
Merge branch 'master' of github.com:alshopov/gitk

* 'master' of github.com:alshopov/gitk:
  gitk i18n: Remove the locations within the Bulgarian translation
  gitk i18n: Update Bulgarian translation (322t)

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
9 days agoMerge branch 'mr/sort-refs-by-type'
Johannes Sixt [Fri, 1 Aug 2025 16:35:16 +0000 (18:35 +0200)] 
Merge branch 'mr/sort-refs-by-type'

* mr/sort-refs-by-type:
  gitk: filter invisible upstream refs from reference list
  gitk: avoid duplicated upstream refs

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
10 days agogitk: filter invisible upstream refs from reference list
Michael Rappazzo [Thu, 31 Jul 2025 11:53:21 +0000 (07:53 -0400)] 
gitk: filter invisible upstream refs from reference list

In refill_reflist, upstream refs are now only included if their
commits are visible in the current view. This prevents display
issues like multiple highlighted branches when clicking entries.

Signed-off-by: Michael Rappazzo <michael.rappazzo@infor.com>
11 days agogitk: avoid duplicated upstream refs
Johannes Sixt [Tue, 29 Jul 2025 12:52:54 +0000 (14:52 +0200)] 
gitk: avoid duplicated upstream refs

It is possible that multiple local branches track the same upstream.
In this case, the refs dialog lists the tracked upstream branch
multiple times. This is undesirable. Make them unique.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
12 days agogitk i18n: Remove the locations within the Bulgarian translation
Alexander Shopov [Tue, 29 Jul 2025 17:50:36 +0000 (19:50 +0200)] 
gitk i18n: Remove the locations within the Bulgarian translation

This makes sending diffs via mail list easier and
brings the po-file in line with git po-file.

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
12 days agogitk i18n: Update Bulgarian translation (322t)
Alexander Shopov [Mon, 28 Jul 2025 12:06:26 +0000 (14:06 +0200)] 
gitk i18n: Update Bulgarian translation (322t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2 weeks agogitk: remove header of now empty section "General options"
Johannes Sixt [Fri, 18 Jul 2025 20:49:21 +0000 (22:49 +0200)] 
gitk: remove header of now empty section "General options"

An earlier commit remove the only option that was available under
"General options". We don't need the header for the empty section.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2 weeks agoMerge branch 'ml/abandon-old-version' (early part)
Johannes Sixt [Tue, 22 Jul 2025 16:29:54 +0000 (18:29 +0200)] 
Merge branch 'ml/abandon-old-version' (early part)

* '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

2 weeks agoMerge branch 'mr/sort-refs-by-type'
Johannes Sixt [Tue, 22 Jul 2025 16:13:31 +0000 (18:13 +0200)] 
Merge branch 'mr/sort-refs-by-type'

* mr/sort-refs-by-type:
  gitk: separate upstream refs when using the sort-by-type option
  gitk: make 'sort-refs-by-type' optional and persistent
  gitk: sort by ref type on the 'tags and heads' view

2 weeks agoMerge branch 'ti/support-sha256'
Johannes Sixt [Tue, 22 Jul 2025 16:04:55 +0000 (18:04 +0200)] 
Merge branch 'ti/support-sha256'

* ti/support-sha256:
  gitk: Add support of SHA256 repositories

3 weeks agogitk: separate upstream refs when using the sort-by-type option
Michael Rappazzo [Sat, 19 Jul 2025 19:24:39 +0000 (15:24 -0400)] 
gitk: separate upstream refs when using the sort-by-type option

Since the upstream refs of local refs may be of more significance in the
context of the local refs, they are sorted after local refs and before the
remainder of the remote refs.

Signed-off-by: Michael Rappazzo <michael.rappazzo@infor.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
3 weeks agogitk: make 'sort-refs-by-type' optional and persistent
Michael Rappazzo [Fri, 18 Jul 2025 20:33:08 +0000 (16:33 -0400)] 
gitk: make 'sort-refs-by-type' optional and persistent

On the 'tags and heads' view, add an option to enable or disable
'Sort refs by type'.  This option is read from and written to the
config file.  Clicking on the option will update the refs in the
view.

Signed-off-by: Michael Rappazzo <michael.rappazzo@infor.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
3 weeks agogitk: sort by ref type on the 'tags and heads' view
Michael Rappazzo [Mon, 1 Jun 2015 15:05:25 +0000 (11:05 -0400)] 
gitk: sort by ref type on the 'tags and heads' view

In the 'tags and heads' view, the list of refs was globally sorted,
which caused the local ref list to be split around other ref list types.

This change re-orders the view to be: local refs, remote refs, tags,
and then other refs.

Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
3 weeks agogitk: choosefont - remove a stray debugging line
Johannes Sixt [Thu, 17 Jul 2025 11:11:55 +0000 (13:11 +0200)] 
gitk: choosefont - remove a stray debugging line

This output was added in d93f1713b0 ("gitk: Use themed tk widgets",
2009-04-17), we can assume, by accident.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
3 weeks agogitk: allow Tcl/Tk 9.0+
Mark Levedahl [Thu, 20 Mar 2025 18:16:07 +0000 (14:16 -0400)] 
gitk: allow Tcl/Tk 9.0+

Tcl/Tk 9.0 has been released, and has shipped in Fedora 42. Prior
patches in this sequence have addressed known incompatibilities, so gitk
is now operating with Tcl9. So, let's allow Tcl9.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: use -profile tcl8 on encoding conversions
Mark Levedahl [Sun, 18 May 2025 14:41:30 +0000 (10:41 -0400)] 
gitk: use -profile tcl8 on encoding conversions

gitk in the prior commit learned to apply -profile tcl8 to all input
data streams, avoiding errors on non-binary data streams whose encoding
is not utf-8. But, gitk also consumes binary data streams (generally blobs
from commits), and internally decodes this to support various displays.

With Tcl9, errors occur in this decoding for the same reasons described
in the previous commit: basically, the underlying data was not validated
to conform to the given encoding, and this source encoding may not be
utf-8. gitk performs this decoding using Tcl's '[encoding convert from'
operator.

For example, the 7th commit in gitk's history has the extended ascii
value 0xA9, so

gitk 9a40c50c1e

in gitk's repository raises an exception. The error log has:

unexpected byte sequence starting at index 11: '\xA9'
    while executing
"encoding convertfrom $diffencoding $line"
    (procedure "parseblobdiffline" line 135)
    invoked from within
"parseblobdiffline $ids $line"
    (procedure "getblobdiffline" line 16)
    invoked from within
"getblobdiffline file6 9a40c50c1e05c0658b7a7c68b56d615eb6f170dd"
    ("eval" body line 1)
    invoked from within
"eval $script"
    (procedure "dorunq" line 11)
    invoked from within
"dorunq"
    ("after" script)

This problem has a similar fix to the prior issue: we must use the tlc8
profile when converting this data. Do so, again only on Tcl9 as Tcl8.6
does not recognize -profile, and only Tcl 9.0 makes strict the default.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: use -profile tcl8 for file input with Tcl 9
Mark Levedahl [Fri, 14 Mar 2025 15:45:35 +0000 (11:45 -0400)] 
gitk: use -profile tcl8 for file input with Tcl 9

gitk invokes many git commands expecting output in utf-8 encoding, but
git accepts extended ascii (code page unknown) as utf-8 without
validating, so cannot guarantee valid utf-8 on output.  In particular,
using any extended ascii code page, of which there are many, has long
been acceptable given that everyone on a project is aware of and uses
that same code page to view all data. utf-8 accepts only 7-bit ascii
characters in single bytes, and any characters outside of that base set
require at least two bytes.

Tcl is a string based language, and transcodes all input data to an
internal unicode format, and to whatever format is requested on output:
"pure" binary is recoded using iso8859-1.  Tcl8.x silently recodes
invalid utf-8 as binary data, so extended ascii characters maintain
their binary value on output but may not display correctly.

Tcl 8.7 added three profiles to control this behaviour: strict (raises
exceptions), replace (replaces each invalid byte with ?), and the
default tcl8 maintaining the old behavior.  Tcl 9 changes the default
profile to strict, meaning any invalid utf-8 raises an exception that
gitk does not handle.

An example of this in the git repository is commit 7eb93c8965 ("[PATCH]
Simplify git script", 2005-09-07). This includes extended ascii
characters in the author name and commit message. As a result, gitk +
Tcl 9 cannot view the git repository at any point beyond that commit.
Note: Tcl 9.0 has a bug, to be fixed in 9.1, where this particular
condition results in a memory error causing Tcl to crash [1].

The tcl8 profile used so far has acceptable behavior given gitk's
acceptance: this allows gitk to accept extended ascii though it may
display incorrectly.  Let's continue that behavior by overriding open to
use the tcl8 profile on Tcl9 and later: Tcl 8.6 does not understand
fconfigure -profile, and Tcl 8.7 maintains the tcl8 profile.

[1] Per https://core.tcl-lang.org/tcl/tktview/73bb42fb3f35cd613af6fcea465e35bbfd352216

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: Tcl9 doesn't expand ~, use $env(HOME)
Mark Levedahl [Mon, 24 Mar 2025 12:45:32 +0000 (08:45 -0400)] 
gitk: Tcl9 doesn't expand ~, use $env(HOME)

gitk looks for configuration files under $(HOME)/.., and uses the
typical shortcut formats to find this, e.g., ~/.config/. This relies
upon Tcl expanding such constructs to replace ~ with $(HOME). But, Tcl 9
has stopped doing that for various reasons, and now supplies [file
tildeexpand ...] to perform this expansion.

There are a very few places that need this expansion, and all must be
modified regardless of approach taken.

POSIX specifies that $HOME be defined at the time of login, and both
Cygwin and MSYS (underlying git for windows) set this variable. Tcl8
uses the POSIX defined pwnam to look up the underlying database record
on Unix, but will get the same result as using $HOME on any POSIX
compliant system. On Windows, Tcl just accesses $HOME, falling back to
other environment variables if $HOME is not set.  Git for Windows has
$HOME defined by MSYS, so this works just as on the others.

As $env(HOME) works in Tcl 8 and 9, while anything using [file
tildeexpand ... ] will not, let's use the simpler approach as doing so
adds no lines of code.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: switch to -translation binary
Mark Levedahl [Tue, 25 Mar 2025 20:53:20 +0000 (16:53 -0400)] 
gitk: switch to -translation binary

gitk uses '-encoding binary' in several places to handle non-text data.
Per TIP 699, this is not recommended as there has been too much
confusion and misconfiguration of binary channels, and this option is
removed in Tcl 9.

Tcl defines a binary channel as one that reproduces the input data
exactly. As Tcl stores all data internally in unicode format, a binary
channel requires 3 things:
-  -encoding iso8859-1 : this causes each byte of input to be translated
   to its unicode equivalent (may be multi-byte).
-  -translation lf : this avoids any translation of line endings, which
   by default are translated to \n on input.
-  -eofchar {} : this avoids any use of an end of file character, which
   is ctrl-z by default on Windows.

The recommended '-translation binary' makes all three settings, but this
is not done in gitk now. Rather, gitk uses '-encoding binary', which is
an alias to '-encoding iso8859-1' removed by TIP 699, in multiple places,
and -eofchar {} in one place but not all. All other files, configured in
non-binary fashion, have -eofchar {}.

Unix and Windows differ on line ending conventions, Tcl by default
converts line endings to \n on input, and to those common on the
platform on output. git emits only \n on Unix or Windows. Also, Tcl's
proc gets recognizes and removes \n, \r, or \r\n as line endings, and
this is used by gitk except in procs selectline and parsecommit. But,
those two procs recognize any combination of \n and \r as terminating a
line. So, there is no need to translate line endings on input, and using
-translation binary avoids any such translation.

Tcl sets eofchar to ctrl-z (ascii \0x1a) only on Windows, otherwise
eofchar is {}. This provides compatibility to old DOS based codes and
files originating when file systems recorded only sectors allocated, and
not bytes used. git does not use ctrl-z to terminate data anywhere. Only
two channels in gitk leave eofchar at the default value, both use
-encoding binary now. A third one was converted in commit 681c3290e3
("gitk: Handle blobs containing a DOS end-of-file marker", 2009-03-16),
fixing such a problem of early data termination. Using eofchar {} is
correct, even if not always necessary.

Tcl 9 forces change, using -translation binary per TIP 699 does what
gitk needs and is backwards compatible to Tcl 8.x. Do it.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: update scrolling for TclTk 8.7+ / TIP 474
Mark Levedahl [Fri, 6 Jun 2025 16:28:02 +0000 (12:28 -0400)] 
gitk: update scrolling for TclTk 8.7+ / TIP 474

TclTk 8.7 (still in alpha), and 9.0 (released), implement TIP 474 that
delivers uniform handling of mouse and touchpad scrolling events on all
platforms, and by default bound to most widgets. TIP 474 also implements
use of the Option- modifier key (Alt- key on PC, Option- key on Macs) to
indicate desire for more motion per scroll wheel event, the
amplification is not defined but seems to be 5x to 10x.

So, for TclTk >= 8.7 we can use identical MouseWheel bindings on all
platforms, and should enable use of the Option- modifier to enable
larger motion. Let's do all of this, and use a 5x multiplier for the
Option- modifier.

This largely follows the prior win32 model, except that Tk 8.6 does not
reliably use the Option- modifier because the Alt- key conflicts with
builtin behavior to activate the main menubar. Presumably this conflict
is addressed in the win32 Tcl9.x package.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: restore ui colors after cancelling config dialog
Mark Levedahl [Fri, 6 Jun 2025 15:34:04 +0000 (11:34 -0400)] 
gitk: restore ui colors after cancelling config dialog

gitk provides a dialog to configure many ui colors. Any color element
changed in the dialog takes immediate effect before closing the dialog.
While cancelling the dialog after changing one or more colors avoids
saving the modified colors, the user must restart gitk to restore the
prior color set. This unfortunate behavior results because gitk does not
have a single routine to update all of the ui colors. The prior commit
eliminated the key impediment to having such a routine. So, let's create
a routine to update all configured colors at once, use this when
modifying colors, and also invoke this after restoring the prior set if
the dialog is cancelled.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: allow horizontal commit-graph scrolling
Mark Levedahl [Tue, 27 May 2025 03:47:39 +0000 (23:47 -0400)] 
gitk: allow horizontal commit-graph scrolling

gitk commit 5fdcbb1390 ("gitk: Fixes for Mac OS X TkAqua", 2009-03-23),
adds horizontal scrolling of the commit graph pane on aqua, but not on
x11 or win32. Also, the horizontal scrolling is triggered by MouseWheel
events attached to any of the three panes, not just the commit graph
that is the only one that scrolls. It is unusual to scroll a widget that
is not under the mouse, many would consider this a bug. No horizontal
scrollbar is provided for this, so there is no real cue for the user
that horizontal scrolling is available. We removed this aqua only
feature by transitioning aqua to use the common MouseWheel bindings set.

Let's add this as a feature on all platforms, and use the same approach
for scaling scroll motion as we do elsewhere.  For horizontal scrolling,
honor only events received by the commit graph in conformance with
normal GUI design.  Vertical scrolling is unchanged, and events received
by any of the 3 panes continue to scroll all 3 in unison.

Per the ancient and long ignored CUA standards, we should add a
horizontal scrollbar to the commit-graph, but gitk's interface is
already very cluttered: adding a scrollbar to only one of these three
panes is difficult while maintaining common pane vertical size,
especially so considering the movable sash separating panes 1 & 2, and
will consume yet more space. So, leave this as a hidden feature, now
available on all platforms.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: set config dialog color swatches in one place
Mark Levedahl [Thu, 5 Jun 2025 16:23:37 +0000 (12:23 -0400)] 
gitk: set config dialog color swatches in one place

gitk's color selection dialog uses a number of "label" widgets to show
the current value of each selectable color. This uses the -background
color property of label widgets, and this property is overwritten when
the full ui color set is refreshed. The swatch colors are set
individually using code passed into the chooser dialog, so there is no
common routine to set all after updating the global ui colors.

Let's replace this with a single routine that does set all swatches,
removing a key impediment to restoring the ui colors if the dialog is
cancelled.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: update aqua scrolling for TclTk 8.6 / TIP171
Mark Levedahl [Tue, 3 Jun 2025 19:04:27 +0000 (15:04 -0400)] 
gitk: update aqua scrolling for TclTk 8.6 / TIP171

Tk provides MouseWheel events to aqua, similar to win32. But, these
events on aqua have a nominal motion value (%D) of 1, not 120 as on
win32. gitk on aqua provides specific bindings only for the top 3 panes,
giving a nominal scrolling amount of +/- 1 for all events. gitk includes
a hidden feature providing horizontal scrolling of the commit graph,
added in 5fdcbb1390 ("gitk: Fixes for Mac OS X TkAqua", 2009-03-23).
This horizontal scrolling is triggered by mouse events in any of the top
3 panes, and thus violates normal gui design where the object under the
mouse cursor scrolls.

Let's update this using the common bindings in 'proc bind_mousewheel',
allowing user preferences on motion scaling to apply to all windows.
The commit graph scrolling feature is removed by this, and will be added
back for all platforms in a later commit.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: update x11 scrolling for TclTk 8.6 / TIP 171
Mark Levedahl [Fri, 6 Jun 2025 04:03:33 +0000 (00:03 -0400)] 
gitk: update x11 scrolling for TclTk 8.6 / TIP 171

gitk has x11 mouse bindings that receive button presses, not MouseWheel
events, as this is the Tk implementation through Tk 8.6. On x11, gitk
translates each button event to a scrolling value of +/- 5 for the upper
three panes that scroll vertically as one unit. gitk applies similar
scaling for horizontal scaling of the lower-left commit details pane
(ctext), but not for vertical scrolling of either of the bottom panes.
Rather, the Tk default scrolling actions are used for vertical
scrolling.

Let's make X11 behave similarly to the just modified win32 platform. Do
so by connecting vertical and horizontal scrolling events for the same
items bound in 'proc bind_mousewheel' and using the same user preference
values.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: update win32 scrolling for Tk 8.6 / TIP 171
Mark Levedahl [Sat, 6 Jul 2024 15:08:32 +0000 (11:08 -0400)] 
gitk: update win32 scrolling for Tk 8.6 / TIP 171

gitk on win32 binds windows_mousewheel_redirector to all MouseWheel
events in the main window. This proc determines the widget under the
cursor, then determines what scroll command to give, possibly none, and
issues scroll commands to the widget. The top panes get only vertical
scroll events, as does the lower right Patch/Tree pane. All others get
both vertical and horizontal events. These are all hard coded at +/-
five lines.

We now have common MouseWheel event bindings that follow user
preferences for the scrolling amount, bind for only the five main
display widgets, and leave the other gui elements untouched. Let's use
this instead. With the scrolling preference set at 5, the users should
not notice much, if any, difference.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: mousewheel scrolling functions for Tk 8.6
Mark Levedahl [Fri, 6 Jun 2025 01:45:22 +0000 (21:45 -0400)] 
gitk: mousewheel scrolling functions for Tk 8.6

gitk supports scrolling of 5 windows, but does this differently on the
aqua, x11, and win32 platforms as Tk provides different events on each.
TIP 171 removes some differences on win32 while altering the required
bindings on x11. TIP 474, which is in Tk 8.7 and later, finally unifies
all platforms on using common MouseWheel bindings. Importantly for now,
TIP 171 causes delivery of MouseWheel events to the widget under the
mouse cursor on win32, eliminating the need for completely different
bindings on win32.

Let's make some common functions to unify as much as we can in Tk 8.6.
Examining the platforms shows that the default platform scrolling is
overridden differently on the 3 platforms, and the nominal amount of
motion achieved per mouse wheel "click" is different. win32 nominally
makes everything move 5 lines per click, aqua 1 line per click, and x11
is a mixture. Part of this is due to win32 overriding all scroll events,
while x11 and aqua override smaller sets. Also, note that the text
widgets (the lower two panes) always scroll by 2-3 lines when given a
smaller scroll amount, while the upper three canvas objects follow the
requested scrolling value more accurately.

First, let's have a common routine to calculate the scroll value to give
to a widget in an event. This accounts for the user preference, the
scale of the %D (delta) value given by the event (120 on win32, 1 on
aqua, assumed 1 on x11), and must always be integer. Include negation as
by convention the screen moves opposite to the MouseWheel delta. Allow
setting an offset value to account for the larger minimum scrolling of
text widgets.

Second, let's have a common declaration of MouseWheel event bindings, as
those are shared by all in Tcl9, and by aqua/win32 earlier. Bind all
five display windows here. Note that the Patch/Tree widget (cflist)
cannot scroll horizontally.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: wheel scrolling multiplier preference
Mark Levedahl [Tue, 3 Jun 2025 11:36:44 +0000 (07:36 -0400)] 
gitk: wheel scrolling multiplier preference

gitk provides scrolling of several windows, uses hard-coded values for
the amount of scrolling, and these values differ across platforms and
widgets. The nominal value used is either 1 text line per mouse /
touchpad / button event, or 5 lines. Furthermore, Tk does not scroll
text widgets by 1 line when told to, this usually gets 2-3 lines of
motion. The upper canvas objects holding the commit graph do scroll as
defined. But, clearly no value is universally preferred, so let's give
the user some control over this. Provide a single multiplier to be
applied for all scroll bindings, with a value of 3 to mean the default
nominal value of 3 line. This is selected both as a compromise between
the various defaults across platforms, and because it is the smallest
value honored by the two text widgets on the bottom of the screen.

Later commits will connect this variable for actual scrolling events.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: separate x11 / win32 / aqua Mouse bindings
Mark Levedahl [Sat, 6 Jul 2024 17:12:01 +0000 (13:12 -0400)] 
gitk: separate x11 / win32 / aqua Mouse bindings

Tk through 8.6 has different approaches for handling mouse wheel /
touchpad scrolling events on the different platforms, and gitk has
separate code for these. But, some x11 bindings are applied on aqua as
we do not have these in a clean if / then / else tree based upon
platform.  Let's split these bindings apart.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: remove non-ttk support code
Mark Levedahl [Sun, 8 Jun 2025 12:53:49 +0000 (08:53 -0400)] 
gitk: remove non-ttk support code

gitk has code and variables to use the earlier non-themed widget set,
but this code is now irrelevant as gitk now always uses ttk.  Clean this
up.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: replace ${NS} with ttk
Mark Levedahl [Sun, 8 Jun 2025 12:45:30 +0000 (08:45 -0400)] 
gitk: replace ${NS} with ttk

gitk uses ${NS} to select between the original Tk widgets and the newer
themed widgets in ttk.  As gitk uses only themed widgets from ttk::,
this indirection now serves no purpose, so let's switch to explicit use
of ttk:: via global search/replace. More simplification, including
removal of the NS variable, is kept for a later patch to keep this one
smaller.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: always use themed Tk (ttk)
Mark Levedahl [Sun, 8 Jun 2025 12:16:34 +0000 (08:16 -0400)] 
gitk: always use themed Tk (ttk)

gitk added the option to used themed Tk (ttk) in 0cc08ff7dd ("gitk: Add
a user preference to enable/disable use of themed widgets", 2009-09-05).
Using ttk had to be optional as Tk 8.4, then in common use, does not
have ttk. ttk is the default when available, so the ttk code paths are
by now very well tested. gitk also has code paths for the older default
widgets, increasing the maintenance burden. Let's make ttk non-optional
to reduce code complexity in later commits.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: use $config_variables as list for save/restore
Mark Levedahl [Tue, 3 Jun 2025 20:17:15 +0000 (16:17 -0400)] 
gitk: use $config_variables as list for save/restore

gitk includes many user defined configuration variables, has all of
these are listed in $config_variables. But this list is not used to
define the variables to be loaded, saved, or restored when cancelling
the configuration dialog, and developers must maintain separate lists of
variables for these purposes. This leads to unnecessary errors and merge
conflicts. Let's replace those separate lists with $config_variables to
make maintenance easier.

While we are on topic, sort the list of names in $config_variables.
This makes it simpler to scan and has fewer chances of conflicts
when new names are introduced.

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: remove implementations for Tcl/Tk < 8.6
Mark Levedahl [Mon, 19 May 2025 16:54:32 +0000 (12:54 -0400)] 
gitk: remove implementations for Tcl/Tk < 8.6

gitk includes code specifically for Tcl 8.4 and 8.5, but the requirement
is now for at least 8.6. Remove the now unusable code targeting earlier
Tcl.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: Make TclTk 8.6 the minimum, allow 8.7
Mark Levedahl [Sun, 13 Jul 2025 20:10:33 +0000 (16:10 -0400)] 
gitk: Make TclTk 8.6 the minimum, allow 8.7

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>
3 weeks agogitk: remove code targeting git <= 1.7.2
Mark Levedahl [Thu, 5 Jun 2025 21:18:19 +0000 (17:18 -0400)] 
gitk: remove code targeting git <= 1.7.2

gitk has a few code fragments that are used only for git versions <=
1.7.2 that do not support submodules, notes, word differences, or
textconv filters. We just set the minimum git version higher than 1.7.2
so these code fragments have no effect. Delete them.

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
3 weeks agogitk: require git >= 2.20
Mark Levedahl [Thu, 5 Jun 2025 21:09:02 +0000 (17:09 -0400)] 
gitk: require git >= 2.20

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>
3 weeks agogitk: Add user preference to hide specific references
Ori Avtalion [Wed, 21 May 2025 17:12:35 +0000 (20:12 +0300)] 
gitk: Add user preference to hide specific references

External tools such as Jujutsu may add many references that are of no
interest to the user. This preference allows hiding them.

Signed-off-by: Ori Avtalion <ori@avtalion.name>
3 weeks agogitk: Add support of SHA256 repositories
Takashi Iwai [Tue, 17 Jun 2025 05:59:54 +0000 (07:59 +0200)] 
gitk: Add support of SHA256 repositories

This patch adds a basic support of SHA256 Git repository to Gitk, so
that Gitk can show and operate on both SHA1 and SHA256 repos
gracefully.  Since SHA256 has a longer ID length (64 char) than SHA1
(40 char), many field widths are adjusted to fit with it.

A caveat is that the configuration of auto selection length is shared
between SHA1 and SHA256 repos.  That is, once when this value is saved
and read, it's applied to both repo types, which may result in shorter
selection than the full SHA256 ID.  We may introduce another
individual config for sha256 (actually I did write in the first
version), but for simplicity, the common config is used as of writing
this.

Many lines still refer "sha1" although they may point to both SHA1 and
SHA256.  They are left untouched for making the changes simpler.

This patch is based on the early work by Rostislav Krasny:
  https://patchwork.kernel.org/project/git/patch/pull.979.git.1623687519832.gitgitgadget@gmail.com
I refreshed, revised and extended to the latest state.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
4 weeks agoMerge branch 'js/fix-open-exec'
Johannes Sixt [Tue, 8 Jul 2025 19:00:34 +0000 (21:00 +0200)] 
Merge branch 'js/fix-open-exec'

This addresses CVE-2025-27613, Gitk can create and truncate a user's
files:

When a user clones an untrusted repository and runs gitk without
additional command arguments, files for which the user has write
permission can be created and truncated. The option "Support per-file
encoding" must have been enabled before in Gitk's Preferences.  This
option is disabled by default.

The same happens when "Show origin of this line" is used in the main
window (regardless of whether "Support per-file encoding" is enabled or
not).

* js/fix-open-exec:
  gitk: sanitize 'open' arguments: revisit recently updated 'open' calls
  gitk: sanitize 'open' arguments: command pipeline
  gitk: collect construction of blameargs into a single conditional
  gitk: sanitize 'open' arguments: simple commands, readable and writable
  gitk: sanitize 'open' arguments: simple commands with redirections
  gitk: sanitize 'open' arguments: simple commands
  gitk: sanitize 'exec' arguments: redirect to process
  gitk: sanitize 'exec' arguments: redirections and background
  gitk: sanitize 'exec' arguments: redirections
  gitk: sanitize 'exec' arguments: 'eval exec'
  gitk: sanitize 'exec' arguments: simple cases
  gitk: have callers of diffcmd supply pipe symbol when necessary
  gitk: treat file names beginning with "|" as relative paths

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
4 weeks agoMerge branch 'ah/fix-open-with-stdin'
Johannes Sixt [Tue, 8 Jul 2025 18:46:24 +0000 (20:46 +0200)] 
Merge branch 'ah/fix-open-with-stdin'

This addresses CVE-2025-27614, Arbitrary command execution with Gitk:

A Git repository can be crafted in such a way that with some social
engineering a user who has cloned the repository can be tricked into
running any script (e.g., Bourne shell, Perl, Python, ...) supplied by
the attacker by invoking `gitk filename`, where `filename` has a
particular structure. The script is run with the privileges of the user.

* ah/fix-open-with-stdin:
  gitk: encode arguments correctly with "open"

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2 months agogitk: sanitize 'open' arguments: revisit recently updated 'open' calls
Johannes Sixt [Sat, 29 Mar 2025 17:49:05 +0000 (18:49 +0100)] 
gitk: sanitize 'open' arguments: revisit recently updated 'open' calls

The previous commits bb5cb23daf75 (gitk: prevent overly long command
lines, 2023-01-24) rewrote a set of the 'open' calls substantially.
These were then later updated by 7dd272eca153 (gitk: escape file paths
before piping to git log, 2023-01-24) and d5d1b91e5327 (gitk: encode
arguments correctly with "open", 2025-03-07). In the preceding merge,
the conversions to a safe_open variant were undone to ensure that the
principal operation of the new 'open' calls is not modified by accident.

Since the 'open' calls now pass a redirection from a Tcl string as
stdin, convert the calls to 'safe_open_command_redirect'.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agoMerge branch 'js/fix-open-exec-2.40.0' into js/fix-open-exec
Taylor Blau [Fri, 23 May 2025 21:04:21 +0000 (17:04 -0400)] 
Merge branch 'js/fix-open-exec-2.40.0' into js/fix-open-exec

Branch js/fix-open-exec-2.40.0 converts `open` and `exec` calls to call
wrappers that sanitze the command arguments. This side branch updates
three `open` calls that are in conflict with the fix in the preceding
commit.  To keep the intended operation of the 'open' calls, this merge
does not try to merge and resolve the conflicts, but ignores the
conversions that are brought in by the side branch, taking "ours" side
of the code in these three cases.

New fixes are the topic of the next commit.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agogitk: encode arguments correctly with "open"
Avi Halachmi (:avih) [Fri, 7 Mar 2025 11:48:57 +0000 (13:48 +0200)] 
gitk: encode arguments correctly with "open"

While "exec" uses a normal arguments list which is applied as
command + arguments (and redirections, etc), "open" uses a single
argument which is this command+arguments, where the command and
arguments are a list inside this one argument to "open".

Commit bb5cb23 (gitk: prevent overly long command lines 2023-05-08)
changed several values from individual arguments in that list (hashes
and file names), to a single value which is fed to git via redirection
to its stdin using "open" [1].

However, it didn't ensure correctly that this aggregate value in this
string is interpreted as a single element in this command+args list.

It did just enough so that newlines (which is how these elements are
concatenated) don't split this single list element.

A followup commit at the same patchset: 7dd272e (gitk: escape file
paths before piping to git log 2023-05-08) added a bit more, by
escaping backslahes and spaces at the file names, so that at least
it doesn't break when such file names get used there.

But these are not enough. At the very least tab is missing, and more,
and trying to manually escape every possible thing which can affect
how this string is interpreted in a list is a sub-par approach.

The solution is simply to tell tcl "this is a single list element".
which we can do by aggregating this value completely normally (hashes
and files separated by newlines), and then do [list $value].

So this is what this commit does, for all 3 places where bb5cb23
changed individual elements into an aggregate value.

[1]
That was not a fully accurate description. The accurate version
is that this string originally included two lists: hashes and files.
When used with "open" these lists correctly become the individual
elements of these lists, even if they contain spaces etc, so the
arguments which were used at this "git" commands were correct.

Commit bb5cb23 couldn't use these two lists as-is, because it needed
to process the individual elements in them (one element per line of
the aggregate value), and the issue is that ensuring this aggregate
is indeed interpreted as a single list element was sub-par.

Note: all the (double) quotes before/after the modification are not
required and with zero effect, even for \n. But this commit preserves
the original quoting form intentionally. It can be cleaned up later.

Signed-off-by: Avi Halachmi (:avih) <avihpit@yahoo.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agogitk: sanitize 'open' arguments: command pipeline
Johannes Sixt [Sun, 23 Mar 2025 21:45:39 +0000 (22:45 +0100)] 
gitk: sanitize 'open' arguments: command pipeline

As in the earlier commits, introduce a function that constructs a
pipeline of commands after sanitizing the arguments.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agogitk: collect construction of blameargs into a single conditional
Johannes Sixt [Sun, 23 Mar 2025 21:34:11 +0000 (22:34 +0100)] 
gitk: collect construction of blameargs into a single conditional

The command line to invoke 'git blame' for a single line is constructed
using several if-conditionals, each with the same condition
{$from_index new {}}. Merge all of them into a single conditional.
This requires to duplicate significant parts of the command, but it
helps the next change, where we will have to deal with a nested list
structure.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agogitk: sanitize 'open' arguments: simple commands, readable and writable
Johannes Sixt [Fri, 21 Mar 2025 22:34:14 +0000 (23:34 +0100)] 
gitk: sanitize 'open' arguments: simple commands, readable and writable

As in the previous commits, introduce a function that sanitizes
arguments and also keeps the returned file handle writable to pass
data to stdin.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agogitk: sanitize 'open' arguments: simple commands with redirections
Johannes Sixt [Thu, 20 Mar 2025 19:00:57 +0000 (20:00 +0100)] 
gitk: sanitize 'open' arguments: simple commands with redirections

As in the previous commits, introduce a function that sanitizes
arguments intended for the process and in addition allows to pass
redirections, which are passed to Tcl's 'open' verbatim.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agogitk: sanitize 'open' arguments: simple commands
Johannes Sixt [Thu, 20 Mar 2025 18:32:56 +0000 (19:32 +0100)] 
gitk: sanitize 'open' arguments: simple commands

Tcl 'open' treats the second argument as a command when it begins
with |. The remainder of the argument is a list comprising the command
and its arguments. It assigns special meaning to these arguments when
they begin with a redirection, pipe or background operator. There are a
number of invocations of 'open' which construct arguments that are
taken from the Git repository or a user input. However, when file names
or ref names are taken from the repository, it is possible to find
names which have these special forms. They must not be interpreted by
'open' lest it redirects input or output, or attempts to build a
pipeline using a command name controlled by the repository.

Introduce a helper function that identifies such arguments and prepends
"./" to force such a name to be regarded as a relative file name.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agogitk: sanitize 'exec' arguments: redirect to process
Johannes Sixt [Sat, 29 Mar 2025 16:35:19 +0000 (17:35 +0100)] 
gitk: sanitize 'exec' arguments: redirect to process

Convert one 'exec' call that sends output to a process (pipeline).
Fortunately, the command does not contain any variables. For this
reason, just treat it as a "redirection".

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agogitk: sanitize 'exec' arguments: redirections and background
Johannes Sixt [Sat, 29 Mar 2025 16:21:27 +0000 (17:21 +0100)] 
gitk: sanitize 'exec' arguments: redirections and background

Convert 'exec' calls that both redirect output to a file and run the
process in the background. 'safe_exec_redirect' can take both these
"redirections" in the second argument simultaneously.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agogitk: sanitize 'exec' arguments: redirections
Johannes Sixt [Sat, 29 Mar 2025 16:01:54 +0000 (17:01 +0100)] 
gitk: sanitize 'exec' arguments: redirections

As in the previous commits, introduce a function that sanitizes
arguments intended for the process and in addition allows to pass
redirections verbatim, which are interpreted by Tcl's 'exec'.
Redirections can include the background operator '&'.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agogitk: sanitize 'exec' arguments: 'eval exec'
Johannes Sixt [Sat, 29 Mar 2025 15:51:29 +0000 (16:51 +0100)] 
gitk: sanitize 'exec' arguments: 'eval exec'

Convert calls of 'exec' where the arguments are already available in
a list and 'eval' is used to unpack the list. Use 'concat' to unite
the arguments into a single list before passing them to 'safe_exec'.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agogitk: sanitize 'exec' arguments: simple cases
Johannes Sixt [Mon, 17 Mar 2025 21:59:27 +0000 (22:59 +0100)] 
gitk: sanitize 'exec' arguments: simple cases

Tcl 'exec' assigns special meaning to its argument when they begin with
redirection, pipe or background operator. There are a number of
invocations of 'exec' which construct arguments that are taken from the
Git repository or a user input. However, when file names or ref names
are taken from the repository, it is possible to find names with have
these special forms. They must not be interpreted by 'exec' lest it
redirects input or output, or attempts to build a pipeline using a
command name controlled by the repository.

Introduce a helper function that identifies such arguments and prepends
"./" to force such a name to be regarded as a relative file name.

Convert those 'exec' calls where the arguments can simply be packed
into a list.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agogitk: have callers of diffcmd supply pipe symbol when necessary
Johannes Sixt [Mon, 17 Mar 2025 20:39:58 +0000 (21:39 +0100)] 
gitk: have callers of diffcmd supply pipe symbol when necessary

Function 'diffcmd' derives which of git diff-files, git diff-index, or
git diff-tree must be invoked depending on the ids provided. It puts
the pipe symbol as the first element of the returned command list.

Note though that of the four callers only two use the command with
Tcl 'open' and need the pipe symbol. The other two callers pass the
command to Tcl 'exec' and must remove the pipe symbol.

Do not include the pipe symbol in the constructed command list, but let
the call sites decide whether to add it or not. Note that Tcl 'open'
inspects only the first character of the command list, which is also
the first character of the first element in the list. For this reason,
it is valid to just tack on the pipe symbol with |$cmd and it is not
necessary to use [concat | $cmd].

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agogitk: treat file names beginning with "|" as relative paths
Johannes Sixt [Mon, 17 Mar 2025 19:36:04 +0000 (20:36 +0100)] 
gitk: treat file names beginning with "|" as relative paths

The Tcl 'open' function has a vary wide interface. It can open files as
well as pipes to external processes. The difference is made only by the
first character of the file name: if it is "|", an process is spawned.

We have a number of calls of Tcl 'open' that take a file name from the
environment in which Gitk is running. Be prepared that insane values are
injected. In particular, when we intend to open a file, do not mistake
a file name that happens to begin with "|" as a request to run a process.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2 months agoMerge branch 'top-panel-search-highlight' of github.com:bnfour/gitk
Johannes Sixt [Thu, 22 May 2025 17:15:31 +0000 (19:15 +0200)] 
Merge branch 'top-panel-search-highlight' of github.com:bnfour/gitk

* 'top-panel-search-highlight' of github.com:bnfour/gitk:
  gitk: do not hard-code color of search results in commit list

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2 months agoMerge branch 'yh/fix-non-themed-combobox'
Johannes Sixt [Tue, 20 May 2025 17:42:52 +0000 (19:42 +0200)] 
Merge branch 'yh/fix-non-themed-combobox'

* yh/fix-non-themed-combobox:
  gitk: Legacy widgets doesn't have combobox

2 months agogitk: do not hard-code color of search results in commit list
Alexander Ogorodov [Tue, 18 Mar 2025 06:27:04 +0000 (13:27 +0700)] 
gitk: do not hard-code color of search results in commit list

A global variable exists that holds the color name used to highlight
search results everywhere, except that in the commit list the color
is still hard-coded to "yellow". Use the global variable there as well.

Signed-off-by: Alexander Ogorodov <bnfour@bnfour.net>
2 months agogitk: place file name arguments after options in msgfmt call
Johannes Sixt [Tue, 13 May 2025 20:38:41 +0000 (22:38 +0200)] 
gitk: place file name arguments after options in msgfmt call

The build process fails in POSIXLY_CORRECT mode:

  $ gitk@master:1005> POSIXLY_CORRECT=1 make
      * new Tcl/Tk interpreter location
      GEN gitk-wish
  Generating catalog po/zh_cn.msg
  msgfmt --statistics --tcl po/zh_cn.po -l zh_cn -d po/
  msgfmt: --tcl requires a "-l locale" specification
  Try 'msgfmt --help' for more information.
  make: *** [Makefile:76: po/zh_cn.msg] Error 1

The reason is that option arguments cannot occur after the first
non-option argument. Move the file name last.

Reported-by: Nathan Royce <nroycea+kernel@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
3 months agogitk: Legacy widgets doesn't have combobox
YOKOTA Hiroshi [Sun, 4 May 2025 17:57:07 +0000 (02:57 +0900)] 
gitk: Legacy widgets doesn't have combobox

Use "proc makedroplist" function to support combobox on legacy widgets
mode. "proc makedroplist" uses "ttk::combobox" for themed mode, and uses
"tk_optionMenu" for legacy mode to get rid of the problem.

Signed-off-by: YOKOTA Hiroshi <yokota.hgml@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
3 months agoMerge branch 'at/translation-tamil'
Johannes Sixt [Fri, 9 May 2025 16:01:02 +0000 (18:01 +0200)] 
Merge branch 'at/translation-tamil'

* at/translation-tamil:
  gitk: add Tamil translation

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
3 months agogitk: add Tamil translation
தமிழ் நேரம் [Wed, 7 May 2025 15:54:35 +0000 (21:24 +0530)] 
gitk: add Tamil translation

Signed-off-by: தமிழ் நேரம் <anishprabu.t@gmail.com>
4 months agogitk: limit PATH search to bare executable names
Mark Levedahl [Tue, 1 Apr 2025 03:01:02 +0000 (23:01 -0400)] 
gitk: limit PATH search to bare executable names

The path search overrides used by gitk on Windows are applied to any
executable whose name is not 'absolute', meaning that
[exec foo/bar ...]
will search each element of $PATH to find one with subdirectory foo
containing bar. But, per POSIX, and Tcl implementation on all platforms,
foo/bar is taken as $(pwd)/foo/bar, and is not searched on $PATH.

Fix this descrepency using the same approach applied to git-gui in
commit 3f71c97e. The key is that the executable name must have no path
component, indicated by [file split $exename] having array length 1.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
4 months agogitk: _search_exe is no longer needed
Mark Levedahl [Tue, 1 Apr 2025 03:01:01 +0000 (23:01 -0400)] 
gitk: _search_exe is no longer needed

The _search_exe variable allows specifying the suffix used for executables,
typically {} on unix, .exe on Windows. But, the override code is now
used only on Windows, so _search_exe is no longer needed. Eliminate it.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
4 months agogitk: override $PATH search only on Windows
Mark Levedahl [Tue, 1 Apr 2025 03:01:00 +0000 (23:01 -0400)] 
gitk: override $PATH search only on Windows

Commit 4cbe9e0e2 was written to address problems that result from Tcl's
documented behavior on Windows where the current working directory and a
number of Windows system directories are automatically prepended to
$PATH when searching for executables [1].  This basic Windows behavior
has resulted in more than one CVE against git for Windows:
CVE-2023-23618, CVE-2022-41953 are listed on the git for Windows github
website for the Tcl components of git (gitk, git-gui).

4cbe9e0e2 is intended to restrict the search to looking only in
directories given in $PATH and in the given order, which is exactly the
Tcl behavior documented to exist on non-Windows platforms [1]. Thus,
this change could have been written to affect only Windows, leaving
other platforms alone.

However, 4cbe9e0e2 implements the override for all platforms. This
includes specialized code for Cygwin, copied from git-gui prior to
commit 7145c654 on https://github.com/j6t/git-gui, so targets a
long retired Cygwin port of the Windows Tcl/Tk using Windows pathnames.
Since 2012, Cygwin uses a Unix/X11 port requiring Unix pathnames,
meaning 4cbe9e0e2 is incompatible.  4cbe9e0e2 also induces an infinite
recursion as _which now invokes the exec wrapper that invokes _which.
This is part of git v2.49.0, so gitk on Cygwin is broken in that
release.

Rather than fix the unnecessary override code for Cygwin, let's just
limit the override of exec/open to Windows, leaving all other platforms
using their native exec/open as they did prior to 4cbe9e0e2. This patch
wraps the override code in an "if {[is_Windows]} { ... }" block while
removing the non-Windows code added in 4cbe9e0e2.

[1] see https://www.tcl-lang.org/man/tcl8.6/TclCmd/exec.htm

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
4 months agogitk: adjust indentation to match the style used in this script
Johannes Sixt [Sun, 12 Jan 2025 17:35:27 +0000 (18:35 +0100)] 
gitk: adjust indentation to match the style used in this script

We do not use tab characters for intentation in general. A recent patch
introduced many lines that do use them. Replace them by 4 spaces each.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
5 months agoMerge branch 'pks-meson-support' of https://github.com/pks-t/gitk
Johannes Sixt [Thu, 20 Feb 2025 09:54:37 +0000 (10:54 +0100)] 
Merge branch 'pks-meson-support' of https://github.com/pks-t/gitk

* 'pks-meson-support' of https://github.com/pks-t/gitk:
  gitk: introduce support for the Meson build system
  gitk: extract script to build executable

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
5 months agoMerge branch 'g4w-gitk' of https://github.com/dscho/gitk
Johannes Sixt [Thu, 20 Feb 2025 09:53:53 +0000 (10:53 +0100)] 
Merge branch 'g4w-gitk' of https://github.com/dscho/gitk

* 'g4w-gitk' of https://github.com/dscho/gitk:
  gitk: make the "list references" default window width wider
  gitk: fix arrow keys in input fields with Tcl/Tk >= 8.6
  gitk: Use an external icon file on Windows
  gitk: Unicode file name support
  gitk(Windows): avoid inadvertently calling executables in the worktree

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
5 months agogitk: introduce support for the Meson build system
Patrick Steinhardt [Wed, 19 Feb 2025 12:42:50 +0000 (13:42 +0100)] 
gitk: introduce support for the Meson build system

Upstream Git has introduced support for the Meson build system.
Introduce support for Meson into gitk, as well, so that Git can easily
build its vendored copy of Gitk via a `subproject()` directive. The
instructions can be set up as follows:

  $ meson setup build
  $ meson compile -C build
  $ meson install -C build

Specific options, like for example where Gitk shall be installed to, can
be specified at setup time via `-D`. Available options can be discovered
by running `meson configure` either in the source or build directory.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
5 months agogitk: extract script to build executable
Patrick Steinhardt [Wed, 19 Feb 2025 12:34:30 +0000 (13:34 +0100)] 
gitk: extract script to build executable

Extract the scrip that "builds" Gitk from our Makefile so that we can
reuse it in Meson.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
6 months agogitk: make the "list references" default window width wider
James J. Raden [Thu, 21 Jan 2016 17:07:47 +0000 (12:07 -0500)] 
gitk: make the "list references" default window width wider

When using remotes (with git-flow especially), the remote reference names
are almost always wordwrapped in the "list references" window because it's
somewhat narrow by default. It's possible to resize it with a mouse,
but it's annoying to have to do this every time, especially on Windows 10,
where the window border seems to be only one (1) pixel wide, thus making
the grabbing of the window border tricky.

Signed-off-by: James J. Raden <james.raden@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
6 months agogitk: fix arrow keys in input fields with Tcl/Tk >= 8.6
Johannes Schindelin [Tue, 16 Feb 2016 15:42:06 +0000 (16:42 +0100)] 
gitk: fix arrow keys in input fields with Tcl/Tk >= 8.6

Tcl/Tk 8.6 introduced new events for the cursor left/right keys and
apparently changed the behavior of the previous event.

Let's work around that by using the new events when we are running with
Tcl/Tk 8.6 or later.

This fixes https://github.com/git-for-windows/git/issues/495

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
6 months agogitk: Use an external icon file on Windows
Sebastian Schuberth [Sun, 22 Jul 2012 21:19:24 +0000 (23:19 +0200)] 
gitk: Use an external icon file on Windows

Git for Windows now ships with the new Git icon from git-scm.com. Use that
icon file if it exists instead of the old procedurally drawn one.

This patch was sent upstream but so far no decision on its inclusion was
made, so commit it to our fork.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
6 months agogitk: Unicode file name support
Karsten Blees [Sat, 4 Feb 2012 20:54:36 +0000 (21:54 +0100)] 
gitk: Unicode file name support

Assumes file names in git tree objects are UTF-8 encoded.

On most unix systems, the system encoding (and thus the TCL system
encoding) will be UTF-8, so file names will be displayed correctly.

On Windows, it is impossible to set the system encoding to UTF-8.
Changing the TCL system encoding (via 'encoding system ...', e.g. in the
startup code) is explicitly discouraged by the TCL docs.

Change gitk functions dealing with file names to always convert
from and to UTF-8.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
6 months agogitk(Windows): avoid inadvertently calling executables in the worktree
Johannes Schindelin [Thu, 19 Jan 2023 12:40:31 +0000 (13:40 +0100)] 
gitk(Windows): avoid inadvertently calling executables in the worktree

Just like CVE-2022-41953 for Git GUI, there exists a vulnerability of
`gitk` where it looks for `taskkill.exe` in the current directory before
searching `PATH`.

Note that the many `exec git` calls are unaffected, due to an obscure
quirk in Tcl's `exec` function. Typically, `git.exe` lives next to
`wish.exe` (i.e. the program that is run to execute `gitk` or Git GUI)
in Git for Windows, and that is the saving grace for `git.exe because
`exec` searches the directory where `wish.exe` lives even before the
current directory, according to
https://www.tcl-lang.org/man/tcl/TclCmd/exec.htm#M24:

If a directory name was not specified as part of the application
name, the following directories are automatically searched in
order when attempting to locate the application:

    The directory from which the Tcl executable was loaded.

    The current directory.

    The Windows 32-bit system directory.

    The Windows home directory.

    The directories listed in the path.

The same is not true, however, for `taskkill.exe`: it lives in the
Windows system directory (never mind the 32-bit, Tcl's documentation is
outdated on that point, it really means `C:\Windows\system32`).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 months agogitk: Update Bulgarian translation (327t)
Alexander Shopov [Tue, 24 Dec 2024 10:17:58 +0000 (11:17 +0100)] 
gitk: Update Bulgarian translation (327t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
7 months agoMerge branch 'ah/commit-id-to-clipboard'
Johannes Sixt [Tue, 17 Dec 2024 20:54:58 +0000 (21:54 +0100)] 
Merge branch 'ah/commit-id-to-clipboard'

* ah/commit-id-to-clipboard:
  gitk: offer "Copy commit ID to X11 selection" only on X11
  gitk: support auto-copy comit ID to primary clipboard
  gitk: prefs dialog: refine Auto-select UI
  gitk: UI text: change "SHA1 ID" to "Commit ID"

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
7 months agogitk: offer "Copy commit ID to X11 selection" only on X11
Johannes Sixt [Sat, 14 Dec 2024 14:53:35 +0000 (15:53 +0100)] 
gitk: offer "Copy commit ID to X11 selection" only on X11

This option is only useful where a selection clipboard is available, which
is only the case on X11. Do not clutter the UI in other environments.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
7 months agogitk: support auto-copy comit ID to primary clipboard
Avi Halachmi (:avih) [Wed, 11 Dec 2024 09:22:03 +0000 (11:22 +0200)] 
gitk: support auto-copy comit ID to primary clipboard

Auto-select ("Copy commit ID to X11 selection") is useful when a
selection cliboard exists, but otherwise generally meaningless, for
instance on Windows.

Add a similar pref and behavior which copies the commit ID to the
primary clipboard - for platforms without a selection clipboard, but
which can also be useful additionally on platforms with selection.

Note that while autoselect is enabled by default, autocopy isn't.

That's because the selection clipboard is typically dispensable, while
the primary clipboard can be considered a more precious resource,
which we don't want to (clear and) overwrite by default.

Signed-off-by: Avi Halachmi (:avih) <avihpit@yahoo.com>
7 months agogitk: prefs dialog: refine Auto-select UI
Avi Halachmi (:avih) [Wed, 11 Dec 2024 08:18:31 +0000 (10:18 +0200)] 
gitk: prefs dialog: refine Auto-select UI

Tl;DR: change Auto-select text, move the length input to a new line.

The Auto-select preference auto-selects [part of] the commit ID text
at the respective widget on startup, and when the current commit at
the graph changes.

Its real premise, however, is to populate the selection clipboard
with the commit ID. Consider, for instance, how meaningless it is on
platforms without a selection clipboard - like Windows or macOS (on
Windows the selection is not even visible with the default Tk theme,
because it's only visible in focused widgets - which the commit ID
widget is not during normal application of this selection).

So rename the Auto-select label to "Copy commit ID to X11 selection",
to reflect better the ultimate outcome of its application

Note that there exists other, non-X11 platforms with a selection
clipboard, like Wayland, and if a native Tk client exists on such
platforms, then the description will not be accurate, but hopefully
it's not too misleading either.

Additionally, move the length input widget to a new line, because:
- This length applies to both Auto-select and "Copy commit reference"
  context menu item, so it's not exclusive to the selection length.
- The next commit will add support for primary clipboard as well,
  where this length will also be used.

Also, move the "Hide remotes" item above these selection prefs, to
keep the selection prefs semi-grouped before the spacing of the
following title "Diff display options".

Signed-off-by: Avi Halachmi (:avih) <avihpit@yahoo.com>
7 months agogitk: UI text: change "SHA1 ID" to "Commit ID"
Avi Halachmi (:avih) [Wed, 11 Dec 2024 08:07:54 +0000 (10:07 +0200)] 
gitk: UI text: change "SHA1 ID" to "Commit ID"

SHA1 might not stay forever, and plans to use SHA256 already exist,
so use the official name for it - "Commit ID".

Only visible UI texts are modified to reduce the noise when using
git-blame, while comments and variable names still contain SHA1/sha1.

Signed-off-by: Avi Halachmi (:avih) <avihpit@yahoo.com>
8 months agogitk: add text wrapping preferences
Christoph Sommer [Thu, 5 Dec 2024 19:33:44 +0000 (20:33 +0100)] 
gitk: add text wrapping preferences

Add a new preference "wrapdefault" which allows enabling char/word wrap.
Impacts all text in the ctext widget for which no other preference exists.

Also make the (existing) preference "wrapcomment" configurable graphically.
Its setting impacts only the "comment" part of the ctext widget.

Signed-off-by: Christoph Sommer <sommer@cms-labs.org>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
8 months agogitk: make headings of preferences bold
Christoph Sommer [Thu, 5 Dec 2024 19:29:39 +0000 (20:29 +0100)] 
gitk: make headings of preferences bold

Make preference groups like "Diff display options" stand out more.

Signed-off-by: Christoph Sommer <sommer@cms-labs.org>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
8 months agoMerge branch 'sv-20231026' of https://github.com/nafmo/gitk-l10n-sv
Johannes Sixt [Thu, 28 Nov 2024 20:36:58 +0000 (21:36 +0100)] 
Merge branch 'sv-20231026' of https://github.com/nafmo/gitk-l10n-sv

* 'sv-20231026' of https://github.com/nafmo/gitk-l10n-sv:
  gitk: sv.po: Update Swedish translation (323t)

8 months agogitk: check main window visibility before waiting for it to show
Tobias Pietzsch [Sat, 9 Jan 2021 22:14:08 +0000 (23:14 +0100)] 
gitk: check main window visibility before waiting for it to show

If the main window is already visible when gitk waits for it to
become visible, gitk hangs forever.
This commit adds a check whether the window is already visible.
See https://wiki.tcl-lang.org/page/tkwait+visibility

Signed-off-by: Tobias Pietzsch <pietzsch@mycroft.speedport.ip>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
8 months agoMakefile(s): avoid recipe prefix in conditional statements
Taylor Blau [Mon, 8 Apr 2024 15:51:44 +0000 (11:51 -0400)] 
Makefile(s): avoid recipe prefix in conditional statements

In GNU Make commit 07fcee35 ([SV 64815] Recipe lines cannot contain
conditional statements, 2023-05-22) and following, conditional
statements may no longer be preceded by a tab character (which Make
refers to as the recipe prefix).

There are a handful of spots in our various Makefile(s) which will break
in a future release of Make containing 07fcee35. For instance, trying to
compile the pre-image of this patch with the tip of make.git results in
the following:

    $ make -v | head -1 && make
    GNU Make 4.4.90
    config.mak.uname:842: *** missing 'endif'.  Stop.

The kernel addressed this issue in 82175d1f9430 (kbuild: Replace tabs
with spaces when followed by conditionals, 2024-01-28). Address the
issues in Git's tree by applying the same strategy.

When a conditional word (ifeq, ifneq, ifdef, etc.) is preceded by one or
more tab characters, replace each tab character with 8 space characters
with the following:

    find . -type f -not -path './.git/*' -name Makefile -or -name '*.mak' |
      xargs perl -i -pe '
        s/(\t+)(ifn?eq|ifn?def|else|endif)/" " x (length($1) * 8) . $2/ge unless /\\$/
      '

The "unless /\\$/" removes any false-positives (like "\telse \"
appearing within a shell script as part of a recipe).

After doing so, Git compiles on newer versions of Make:

    $ make -v | head -1 && make
    GNU Make 4.4.90
    GIT_VERSION = 2.44.0.414.gfac1dc44ca9
    [...]

    $ echo $?
    0

Reported-by: Dario Gjorgjevski <dario.gjorgjevski@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Cherry-picked-from: 728b9ac0c3b93aaa4ea80280c591deb198051785
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
8 months agodoc: switch links to https
Josh Soref [Fri, 24 Nov 2023 03:35:13 +0000 (03:35 +0000)] 
doc: switch links to https

These sites offer https versions of their content.
Using the https versions provides some protection for users.

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Cherry-picked-from: d05b08cd52cfda627f1d865bdfe6040a2c9521b5
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
8 months agodoc: update links to current pages
Josh Soref [Fri, 24 Nov 2023 03:35:12 +0000 (03:35 +0000)] 
doc: update links to current pages

It's somewhat traditional to respect sites' self-identification.

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Cherry-picked-from: 65175d9ea26bebeb9d69977d0e75efc0e88dbced
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
21 months agogitk: sv.po: Update Swedish translation (323t)
Peter Krefting [Thu, 26 Oct 2023 20:47:18 +0000 (21:47 +0100)] 
gitk: sv.po: Update Swedish translation (323t)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2 years agogitk: escape file paths before piping to git log
Nico Rieck [Tue, 24 Jan 2023 11:23:17 +0000 (11:23 +0000)] 
gitk: escape file paths before piping to git log

We just started piping the file paths via `stdin` instead of passing
them via the command-line, to avoid running into command-line
limitations.

However, since we now pipe the file paths, we need to take care of
special characters.

This fixes https://github.com/git-for-windows/git/issues/2293

Signed-off-by: Nico Rieck <nico.rieck@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogitk: prevent overly long command lines
Johannes Schindelin [Tue, 24 Jan 2023 11:23:16 +0000 (11:23 +0000)] 
gitk: prevent overly long command lines

To avoid running into command line limitations, some of Git's commands
support the `--stdin` option.

Let's use exactly this option in the three rev-list/log invocations in
gitk that would otherwise possibly run the danger of trying to invoke a
too-long command line.

While it is easy to redirect either stdin or stdout in Tcl/Tk scripts,
what we need here is both. We need to capture the output, yet we also
need to pipe in the revs/files arguments via stdin (because stdin does
not have any limit, unlike the command line). To help this, we use the
neat Tcl feature where you can capture stdout and at the same time feed
a fixed string as stdin to the spawned process.

One non-obvious aspect about this change is that the `--stdin` option
allows to specify revs, the double-dash, and files, but *no* other
options such as `--not`. This is addressed by prefixing the "negative"
revs with `^` explicitly rather than relying on the `--not` option
(thanks for coming up with that idea, Max!).

This fixes https://github.com/git-for-windows/git/issues/1987

Analysis-and-initial-patch-by: Max Kirillov <max@max630.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agogitk: include y coord in recorded sash position
halilsen [Sun, 20 Feb 2022 19:47:36 +0000 (19:47 +0000)] 
gitk: include y coord in recorded sash position

6cd80496e9 ("gitk: Resize panes correctly when reducing window size",
2020-10-03) introduces a mechanism to record previously-set sash
positions to make sure that correct values are used while computing
resize proportions. However, if we are not using ttk, then sash
represents only the x coordinate and the recorded sash (`oldsash`) only
includes the x coordinate. When we need to access the y coordinate via
the recorded sash position, we generate the following Application Error
popup:

Error: expected integer but got ""

expected integer but got ""

expected integer but got ""

     while executing

"$win sash place 0 $sash0 [lindex $s0 1]"

     (procedure "resizeclistpanes" line 38)

     invoked from within

"resizeclistpanes .tf.histframe.pwclist 2818"

     (command bound to event)

To fix this, if we are not using ttk, we append the sash positions with
the y coordinates before recording them to match the use_ttk case.

Signed-off-by: Halil Sen <halil.sen@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
3 years agogitk: trivial indentation fix
halilsen [Sun, 20 Feb 2022 19:47:35 +0000 (19:47 +0000)] 
gitk: trivial indentation fix

No functional changes.

Signed-off-by: Halil Sen <halil.sen@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
4 years agogitk: Resize panes correctly when reducing window size
Paul Mackerras [Sat, 3 Oct 2020 05:20:33 +0000 (15:20 +1000)] 
gitk: Resize panes correctly when reducing window size

The resizeclistpanes and resizecdetpanes procedures attempt to keep
the horizontal proportions of the panes of the gitk window
approximately constant when the gitk window is resized.  However, if
the size is reduced enough that an existing sash position would go
outside the window, Tk moves the sash to the left to keep it inside
the window (without moving other sash positions to keep the
proportions).  This happens before these resize procedures get
control, and so they work with incorrect proportions.

To fix this, we record the sash positions we set previously and use
those previously-set sash positions rather than the current sash
positions when computing the proportions.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
4 years agogitk: replace tabs with spaces
Denton Liu [Fri, 11 Sep 2020 04:36:33 +0000 (21:36 -0700)] 
gitk: replace tabs with spaces

The source code is a mix of tabs and spaces. The indentation style
currently is four spaces per indent level but uses tabs every other
level (at eight spaces). Fix this inconsistent spacing and tabbing by
just using a space-indent for everything.

This was done mechanically by running:

$ expand -i gitk >gitk.new
$ mv gitk.new gitk

This patch should be empty with `--ignore-all-space`.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
5 years agogitk: fix the context menu not appearing in the presence of submodule diffs
Роман Донченко [Sun, 15 Dec 2019 18:25:50 +0000 (21:25 +0300)] 
gitk: fix the context menu not appearing in the presence of submodule diffs

Currently, submodule diffs can cause the diff context menu to fail
to appear because of a couple bugs in parseblobdiffline:

* it appends the submodule name to ctext_file_lines instead of
  a line number, which breaks the binary search in find_ctext_fileinfo;

* it can desynchronize ctext_file_names and ctext_file_lines
  by appending to the former but not the latter, which also breaks
  find_ctext_fileinfo.

Fix both of these.

Note: a side effect of this patch is that the context menu also
starts appearing when you right-click on submodule diffs (and not just
regular diffs). The menu is non-functional in this case, though,
since you can't run blame on submodules.

Signed-off-by: Роман Донченко <dpb@corrigendum.ru>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>