@@ -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,8 +1940,10 @@ proc readrefs {} {
1939
1940
set tagids($name ) $id
1940
1941
lappend idtags($id ) $name
1941
1942
} else {
1942
- set otherrefids($name ) $id
1943
- lappend idotherrefs($id ) $name
1943
+ if [ filter_ref $name ] {
1944
+ set otherrefids($name ) $id
1945
+ lappend idotherrefs($id ) $name
1946
+ }
1944
1947
}
1945
1948
}
1946
1949
catch {close $refd }
@@ -11696,7 +11699,7 @@ proc prefspage_general {notebook} {
11696
11699
global NS maxwidth maxgraphpct showneartags showlocalchanges
11697
11700
global tabstop wrapcomment wrapdefault limitdiffs
11698
11701
global autocopy autoselect autosellen extdifftool perfile_attrs
11699
- global hideremotes want_ttk have_ttk maxrefs web_browser
11702
+ global hideremotes hidecustomrefs want_ttk have_ttk maxrefs web_browser
11700
11703
11701
11704
set page [ create_prefs_page $notebook .general]
11702
11705
@@ -11716,6 +11719,9 @@ proc prefspage_general {notebook} {
11716
11719
${NS} ::checkbutton $page .hideremotes -text [ mc " Hide remote refs" ] \
11717
11720
-variable hideremotes
11718
11721
grid x $page .hideremotes -sticky w
11722
+ ${NS} ::checkbutton $page .hidecustomrefs -text [ mc " Hide custom refs" ] \
11723
+ -variable hidecustomrefs
11724
+ grid x $page .hidecustomrefs -sticky w
11719
11725
11720
11726
${NS} ::checkbutton $page .autocopy -text [ mc " Copy commit ID to clipboard" ] \
11721
11727
-variable autocopy
@@ -11863,7 +11869,7 @@ proc doprefs {} {
11863
11869
global oldprefs prefstop showneartags showlocalchanges
11864
11870
global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
11865
11871
global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
11866
- global hideremotes want_ttk have_ttk wrapcomment wrapdefault
11872
+ global hideremotes hidecustomrefs want_ttk have_ttk wrapcomment wrapdefault
11867
11873
11868
11874
set top .gitkprefs
11869
11875
set prefstop $top
@@ -11872,7 +11878,8 @@ proc doprefs {} {
11872
11878
return
11873
11879
}
11874
11880
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
11875
- limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {
11881
+ limitdiffs tabstop perfile_attrs hideremotes hidecustomrefs \
11882
+ want_ttk wrapcomment wrapdefault} {
11876
11883
set oldprefs($v ) [ set $v ]
11877
11884
}
11878
11885
ttk_toplevel $top
@@ -11998,7 +12005,8 @@ proc prefscan {} {
11998
12005
global oldprefs prefstop
11999
12006
12000
12007
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
12001
- limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {
12008
+ limitdiffs tabstop perfile_attrs hideremotes hidecustomrefs \
12009
+ want_ttk wrapcomment wrapdefault} {
12002
12010
global $v
12003
12011
set $v $oldprefs($v)
12004
12012
}
@@ -12012,7 +12020,7 @@ proc prefsok {} {
12012
12020
global oldprefs prefstop showneartags showlocalchanges
12013
12021
global fontpref mainfont textfont uifont
12014
12022
global limitdiffs treediffs perfile_attrs
12015
- global hideremotes wrapcomment wrapdefault
12023
+ global hideremotes hidecustomrefs wrapcomment wrapdefault
12016
12024
global ctext
12017
12025
12018
12026
catch {destroy $prefstop }
@@ -12059,7 +12067,7 @@ proc prefsok {} {
12059
12067
$limitdiffs != $oldprefs(limitdiffs) } {
12060
12068
reselectline
12061
12069
}
12062
- if {$hideremotes != $oldprefs(hideremotes) } {
12070
+ if {$hideremotes != $oldprefs(hideremotes) || $hidecustomrefs != $oldprefs(hidecustomrefs) } {
12063
12071
rereadrefs
12064
12072
}
12065
12073
if {$wrapcomment != $oldprefs(wrapcomment) } {
@@ -12436,6 +12444,29 @@ proc get_path_encoding {path} {
12436
12444
return $tcl_enc
12437
12445
}
12438
12446
12447
+ set default_refs {
12448
+ " stash"
12449
+ " replace/*"
12450
+ " bisect/*"
12451
+ " rewritten/*"
12452
+ }
12453
+
12454
+ proc filter_ref {ref} {
12455
+ global hidecustomrefs
12456
+ global default_refs
12457
+
12458
+ if {$hidecustomrefs } {
12459
+ foreach pat $default_refs {
12460
+ if {[ string match $pat $ref ] } {
12461
+ return 1
12462
+ }
12463
+ }
12464
+ return 0
12465
+ }
12466
+
12467
+ return 1
12468
+ }
12469
+
12439
12470
## For msgcat loading, first locate the installation location.
12440
12471
if { [ info exists ::env(GITK_MSGSDIR)] } {
12441
12472
## Msgsdir was manually set in the environment.
@@ -12539,6 +12570,7 @@ set wrapcomment "none"
12539
12570
set wrapdefault " none"
12540
12571
set showneartags 1
12541
12572
set hideremotes 0
12573
+ set hidecustomrefs 0
12542
12574
set maxrefs 20
12543
12575
set visiblerefs {" master" }
12544
12576
set maxlinelen 200
@@ -12645,7 +12677,7 @@ set config_variables {
12645
12677
mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth
12646
12678
cmitmode wrapcomment wrapdefault autocopy autoselect autosellen
12647
12679
showneartags maxrefs visiblerefs
12648
- hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk
12680
+ hideremotes hidecustomrefs showlocalchanges datetimeformat limitdiffs uicolor want_ttk
12649
12681
bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors
12650
12682
markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor
12651
12683
extdifftool perfile_attrs headbgcolor headfgcolor headoutlinecolor
0 commit comments