gitk

created pr with 71.1 on 2025-08-03T05:37:21Z · by 20a05d05
added 71.2 on 2025-08-03T05:40:15Z · by 20a05d05
1: 4a4a512 ! 1: 2441e19 gitk: Add user preference to hide specific references
changed status to closed on 2025-08-03T05:45:12Z · by 20a05d05
cmds
checkout latest patchset:
ssh pr.pico.sh print 71 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print 71.[rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 71
set PR to open (enables RSS notifications):
ssh pr.pico.sh pr open 71
set PR to draft (stops RSS notifications):
ssh pr.pico.sh pr draft 71

Patchset 71.1 on 2025-08-03T05:37:21Z · commit 4a4a512

gitk: Add user preference to hide custom references
Ori Avtalion 2025-05-21T17:12:35Z
External tools such as Jujutsu may add many references that are of no
interest to the user. This preference hides them.

The non-custom refs are those that pass git's default decoration filter
(see set_default_decoration_filter).

The preference is off by default, maintaining current behavior.

Signed-off-by: Ori Avtalion <ori@avtalion.name>
Semantic diff summary
0 added, 0 modified, 0 signature changed, 0 removed across 0 analyzed files (1 file skipped: unsupported file type)
+18 -7 gitk #
......@@ -1903,6 +1903,7 @@ proc readrefs {} {
19031903 global otherrefids idotherrefs mainhead mainheadid
19041904 global selecthead selectheadid
19051905 global hideremotes
1906+ global hidecustomrefs
19061907 global tclencoding
19071908
19081909 foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
......@@ -1939,6 +1940,10 @@ proc readrefs {} {
19391940 set tagids($name) $id
19401941 lappend idtags($id) $name
19411942 } else {
1943+ if {$hidecustomrefs} {
1944+ if {![string match "stash" $ref] ||
1945+ ![string match "replace/*" $ref]} continue
1946+ }
19421947 set otherrefids($name) $id
19431948 lappend idotherrefs($id) $name
19441949 }
......@@ -11696,7 +11701,7 @@ proc prefspage_general {notebook} {
1169611701 global NS maxwidth maxgraphpct showneartags showlocalchanges
1169711702 global tabstop wrapcomment wrapdefault limitdiffs
1169811703 global autocopy autoselect autosellen extdifftool perfile_attrs
11699- global hideremotes want_ttk have_ttk maxrefs web_browser
11704+ global hideremotes hidecustomrefs want_ttk have_ttk maxrefs web_browser
1170011705
1170111706 set page [create_prefs_page $notebook.general]
1170211707
......@@ -11716,6 +11721,9 @@ proc prefspage_general {notebook} {
1171611721 ${NS}::checkbutton $page.hideremotes -text [mc "Hide remote refs"] \
1171711722 -variable hideremotes
1171811723 grid x $page.hideremotes -sticky w
11724+ ${NS}::checkbutton $page.hidecustomrefs -text [mc "Hide custom refs"] \
11725+ -variable hidecustomrefs
11726+ grid x $page.hidecustomrefs -sticky w
1171911727
1172011728 ${NS}::checkbutton $page.autocopy -text [mc "Copy commit ID to clipboard"] \
1172111729 -variable autocopy
......@@ -11863,7 +11871,7 @@ proc doprefs {} {
1186311871 global oldprefs prefstop showneartags showlocalchanges
1186411872 global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
1186511873 global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
11866- global hideremotes want_ttk have_ttk wrapcomment wrapdefault
11874+ global hideremotes hidecustomrefs want_ttk have_ttk wrapcomment wrapdefault
1186711875
1186811876 set top .gitkprefs
1186911877 set prefstop $top
......@@ -11872,7 +11880,8 @@ proc doprefs {} {
1187211880 return
1187311881 }
1187411882 foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
11875- limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {
11883+ limitdiffs tabstop perfile_attrs hideremotes hidecustomrefs \
11884+ want_ttk wrapcomment wrapdefault} {
1187611885 set oldprefs($v) [set $v]
1187711886 }
1187811887 ttk_toplevel $top
......@@ -11998,7 +12007,8 @@ proc prefscan {} {
1199812007 global oldprefs prefstop
1199912008
1200012009 foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
12001- limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {
12010+ limitdiffs tabstop perfile_attrs hideremotes hidecustomrefs \
12011+ want_ttk wrapcomment wrapdefault} {
1200212012 global $v
1200312013 set $v $oldprefs($v)
1200412014 }
......@@ -12012,7 +12022,7 @@ proc prefsok {} {
1201212022 global oldprefs prefstop showneartags showlocalchanges
1201312023 global fontpref mainfont textfont uifont
1201412024 global limitdiffs treediffs perfile_attrs
12015- global hideremotes wrapcomment wrapdefault
12025+ global hideremotes hidecustomrefs wrapcomment wrapdefault
1201612026 global ctext
1201712027
1201812028 catch {destroy $prefstop}
......@@ -12059,7 +12069,7 @@ proc prefsok {} {
1205912069 $limitdiffs != $oldprefs(limitdiffs)} {
1206012070 reselectline
1206112071 }
12062- if {$hideremotes != $oldprefs(hideremotes)} {
12072+ if {$hideremotes != $oldprefs(hideremotes) || $hidecustomrefs != $oldprefs(hidecustomrefs)} {
1206312073 rereadrefs
1206412074 }
1206512075 if {$wrapcomment != $oldprefs(wrapcomment)} {
......@@ -12539,6 +12549,7 @@ set wrapcomment "none"
1253912549 set wrapdefault "none"
1254012550 set showneartags 1
1254112551 set hideremotes 0
12552+set hidecustomrefs 0
1254212553 set maxrefs 20
1254312554 set visiblerefs {"master"}
1254412555 set maxlinelen 200
......@@ -12645,7 +12656,7 @@ set config_variables {
1264512656 mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth
1264612657 cmitmode wrapcomment wrapdefault autocopy autoselect autosellen
1264712658 showneartags maxrefs visiblerefs
12648- hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk
12659+ hideremotes hidecustomrefs showlocalchanges datetimeformat limitdiffs uicolor want_ttk
1264912660 bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors
1265012661 markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor
1265112662 extdifftool perfile_attrs headbgcolor headfgcolor headoutlinecolor
Back to top