From 28f96e0173b4de1543ce45978837ddc49b532a83 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Wed, 14 Jan 2026 19:27:53 +0100 Subject: [PATCH 1/2] gitk: fix highlighted remote prefix of branches with directories The decoration of a remote ref is colored in two parts: (1) the prefix that mentions the remove (including "remote/"); and (2) the branch name. To extract the prefix from the ref name, a regular expression is used. However, the expression is not restrictive enough: it picks everything before the last slash character as prefix, so that, for example, the ref name "remotes/orgin/ml/themes" is split into "remotes/origin/ml" and "themes". Tighten the regular expression so that only the name of the remote is pulled into the prefix, but no part of the branch name. This gives the desired result in the example: "remotes/origin" and "ml/themes". Signed-off-by: Johannes Sixt --- gitk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitk b/gitk index 7f62c8041d1c77..cbaaee994e0aa8 100755 --- a/gitk +++ b/gitk @@ -6841,7 +6841,7 @@ proc drawtags {id x xt y1} { set xl [expr {$xl - $delta/2}] $canv create polygon $x $yt $xr $yt $xr $yb $x $yb \ -width 1 -outline black -fill $col -tags tag.$id - if {[regexp {^(remotes/.*/|remotes/)} $tag match remoteprefix]} { + if {[regexp {^(remotes/[^/]*/|remotes/)} $tag match remoteprefix]} { set rwid [font measure mainfont $remoteprefix] set xi [expr {$x + 1}] set yti [expr {$yt + 1}] From 97121bb0174f5c3604de989e1bad0663edcc0b39 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 5 Feb 2026 12:50:13 +0100 Subject: [PATCH 2/2] gitk: fix msgfmt being required While the Meson build instructions already handle the case where msgfmt wasn't found, we forgot to mark the dependency itself as optional. This causes an error in case the executable could not be found: Project name: gitk Project version: undefined Program sh found: YES (C:\Program Files\Git\bin\sh.EXE) Program wish found: YES (C:\Program Files\Git\mingw64\bin\wish.EXE) Program chmod found: YES (C:\Program Files\Git\usr\bin\chmod.EXE) Program mv found: YES (C:\Program Files\Git\usr\bin\mv.EXE) Program sed found: YES (C:\Program Files\Git\usr\bin\sed.EXE) Program msgfmt found: NO subprojects\gitk\meson.build:28:3: ERROR: Program 'msgfmt' not found or not executable Fix the issue by adding the `required: false` parameter. Signed-off-by: Patrick Steinhardt --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ca3c0cec583247..aecc068d30ccc0 100644 --- a/meson.build +++ b/meson.build @@ -25,6 +25,6 @@ custom_target( install_dir: get_option('bindir'), ) -if find_program('msgfmt').found() +if find_program('msgfmt', required: false).found() subdir('po') endif