Testing tangled. Original: https://github.com/j6t/gitk

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>

Changed files
+31 -3
+31 -3
gitk
··· 2033 2033 set tagids($name) $id 2034 2034 lappend idtags($id) $name 2035 2035 } else { 2036 - set otherrefids($name) $id 2037 - lappend idotherrefs($id) $name 2036 + if [is_other_ref_visible $name] { 2037 + set otherrefids($name) $id 2038 + lappend idotherrefs($id) $name 2039 + } 2038 2040 } 2039 2041 } 2040 2042 catch {close $refd} ··· 11649 11651 -variable hideremotes 11650 11652 grid x $page.hideremotes -sticky w 11651 11653 11654 + ttk::entry $page.refstohide -textvariable refstohide 11655 + ttk::frame $page.refstohidef 11656 + ttk::label $page.refstohidef.l -text [mc "Refs to hide (space-separated)" ] 11657 + pack $page.refstohidef.l -side left 11658 + pack configure $page.refstohidef.l -padx 10 11659 + grid x $page.refstohidef $page.refstohide -sticky ew 11660 + 11652 11661 ttk::checkbutton $page.autocopy -text [mc "Copy commit ID to clipboard"] \ 11653 11662 -variable autocopy 11654 11663 grid x $page.autocopy -sticky w ··· 11983 11992 $limitdiffs != $oldprefs(limitdiffs)} { 11984 11993 reselectline 11985 11994 } 11986 - if {$hideremotes != $oldprefs(hideremotes)} { 11995 + if {$hideremotes != $oldprefs(hideremotes) || $refstohide != $oldprefs(refstohide)} { 11987 11996 rereadrefs 11988 11997 } 11989 11998 if {$wrapcomment != $oldprefs(wrapcomment)} { ··· 12360 12369 return $tcl_enc 12361 12370 } 12362 12371 12372 + proc is_other_ref_visible {ref} { 12373 + global refstohide 12374 + 12375 + if {$refstohide eq {}} { 12376 + return 1 12377 + } 12378 + 12379 + foreach pat [split $refstohide " "] { 12380 + if {$pat eq {}} continue 12381 + if {[string match $pat $ref]} { 12382 + return 0 12383 + } 12384 + } 12385 + 12386 + return 1 12387 + } 12388 + 12363 12389 ## For msgcat loading, first locate the installation location. 12364 12390 if { [info exists ::env(GITK_MSGSDIR)] } { 12365 12391 ## Msgsdir was manually set in the environment. ··· 12467 12493 set wrapdefault "none" 12468 12494 set showneartags 1 12469 12495 set hideremotes 0 12496 + set refstohide "" 12470 12497 set sortrefsbytype 1 12471 12498 set maxrefs 20 12472 12499 set visiblerefs {"master"} ··· 12610 12637 mergecolors 12611 12638 perfile_attrs 12612 12639 reflinecolor 12640 + refstohide 12613 12641 remotebgcolor 12614 12642 selectbgcolor 12615 12643 showlocalchanges