gitk
created pr with
71.1
added 71.2
1: 4a4a512 ! 1: 2441e19 gitk: Add user preference to hide specific references
changed status to
closed
cmds
checkout latest patchset:
ssh pr.pico.sh print 71 | git am -3checkout any patchset in a patch request:
ssh pr.pico.sh print 71.[rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 71set PR to open (enables RSS notifications):
ssh pr.pico.sh pr open 71set PR to draft (stops RSS notifications):
ssh pr.pico.sh pr draft 71
Patchset
71.1
gitk: Add user preference to hide custom references
Ori Avtalion
2025-05-21T17:12:35ZExternal 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 {} { | |
| 1903 | 1903 | global otherrefids idotherrefs mainhead mainheadid | |
| 1904 | 1904 | global selecthead selectheadid | |
| 1905 | 1905 | global hideremotes | |
| 1906 | + | global hidecustomrefs | |
| 1906 | 1907 | global tclencoding | |
| 1907 | 1908 | ||
| 1908 | 1909 | foreach v {tagids idtags headids idheads otherrefids idotherrefs} { |
| ... | ... | @@ -1939,6 +1940,10 @@ proc readrefs {} { | |
| 1939 | 1940 | set tagids($name) $id | |
| 1940 | 1941 | lappend idtags($id) $name | |
| 1941 | 1942 | } else { | |
| 1943 | + | if {$hidecustomrefs} { | |
| 1944 | + | if {![string match "stash" $ref] || | |
| 1945 | + | ![string match "replace/*" $ref]} continue | |
| 1946 | + | } | |
| 1942 | 1947 | set otherrefids($name) $id | |
| 1943 | 1948 | lappend idotherrefs($id) $name | |
| 1944 | 1949 | } |
| ... | ... | @@ -11696,7 +11701,7 @@ proc prefspage_general {notebook} { | |
| 11696 | 11701 | global NS maxwidth maxgraphpct showneartags showlocalchanges | |
| 11697 | 11702 | global tabstop wrapcomment wrapdefault limitdiffs | |
| 11698 | 11703 | 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 | |
| 11700 | 11705 | ||
| 11701 | 11706 | set page [create_prefs_page $notebook.general] | |
| 11702 | 11707 |
| ... | ... | @@ -11716,6 +11721,9 @@ proc prefspage_general {notebook} { | |
| 11716 | 11721 | ${NS}::checkbutton $page.hideremotes -text [mc "Hide remote refs"] \ | |
| 11717 | 11722 | -variable hideremotes | |
| 11718 | 11723 | 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 | |
| 11719 | 11727 | ||
| 11720 | 11728 | ${NS}::checkbutton $page.autocopy -text [mc "Copy commit ID to clipboard"] \ | |
| 11721 | 11729 | -variable autocopy |
| ... | ... | @@ -11863,7 +11871,7 @@ proc doprefs {} { | |
| 11863 | 11871 | global oldprefs prefstop showneartags showlocalchanges | |
| 11864 | 11872 | global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor | |
| 11865 | 11873 | 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 | |
| 11867 | 11875 | ||
| 11868 | 11876 | set top .gitkprefs | |
| 11869 | 11877 | set prefstop $top |
| ... | ... | @@ -11872,7 +11880,8 @@ proc doprefs {} { | |
| 11872 | 11880 | return | |
| 11873 | 11881 | } | |
| 11874 | 11882 | 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} { | |
| 11876 | 11885 | set oldprefs($v) [set $v] | |
| 11877 | 11886 | } | |
| 11878 | 11887 | ttk_toplevel $top |
| ... | ... | @@ -11998,7 +12007,8 @@ proc prefscan {} { | |
| 11998 | 12007 | global oldprefs prefstop | |
| 11999 | 12008 | ||
| 12000 | 12009 | 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} { | |
| 12002 | 12012 | global $v | |
| 12003 | 12013 | set $v $oldprefs($v) | |
| 12004 | 12014 | } |
| ... | ... | @@ -12012,7 +12022,7 @@ proc prefsok {} { | |
| 12012 | 12022 | global oldprefs prefstop showneartags showlocalchanges | |
| 12013 | 12023 | global fontpref mainfont textfont uifont | |
| 12014 | 12024 | global limitdiffs treediffs perfile_attrs | |
| 12015 | - | global hideremotes wrapcomment wrapdefault | |
| 12025 | + | global hideremotes hidecustomrefs wrapcomment wrapdefault | |
| 12016 | 12026 | global ctext | |
| 12017 | 12027 | ||
| 12018 | 12028 | catch {destroy $prefstop} |
| ... | ... | @@ -12059,7 +12069,7 @@ proc prefsok {} { | |
| 12059 | 12069 | $limitdiffs != $oldprefs(limitdiffs)} { | |
| 12060 | 12070 | reselectline | |
| 12061 | 12071 | } | |
| 12062 | - | if {$hideremotes != $oldprefs(hideremotes)} { | |
| 12072 | + | if {$hideremotes != $oldprefs(hideremotes) || $hidecustomrefs != $oldprefs(hidecustomrefs)} { | |
| 12063 | 12073 | rereadrefs | |
| 12064 | 12074 | } | |
| 12065 | 12075 | if {$wrapcomment != $oldprefs(wrapcomment)} { |
| ... | ... | @@ -12645,7 +12656,7 @@ set config_variables { | |
| 12645 | 12656 | mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth | |
| 12646 | 12657 | cmitmode wrapcomment wrapdefault autocopy autoselect autosellen | |
| 12647 | 12658 | showneartags maxrefs visiblerefs | |
| 12648 | - | hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk | |
| 12659 | + | hideremotes hidecustomrefs showlocalchanges datetimeformat limitdiffs uicolor want_ttk | |
| 12649 | 12660 | bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors | |
| 12650 | 12661 | markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor | |
| 12651 | 12662 | extdifftool perfile_attrs headbgcolor headfgcolor headoutlinecolor |