Slightly older version of master from https://github.com/j6t/gitk

gitk: Add user preference to hide custom references #1

open opened by ilyagr.bsky.social targeting test from pr/16

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

Labels

None yet.

Participants 1
AT URI
at://did:plc:jp6rly3c67o3zlwarw2ttafu/sh.tangled.repo.pull/3lvhz3l64ku22
+31 -3
Diff #2
+31 -3
gitk
··· 2033 set tagids($name) $id 2034 lappend idtags($id) $name 2035 } else { 2036 - set otherrefids($name) $id 2037 - lappend idotherrefs($id) $name 2038 } 2039 } 2040 catch {close $refd} ··· 11649 -variable hideremotes 11650 grid x $page.hideremotes -sticky w 11651 11652 ttk::checkbutton $page.autocopy -text [mc "Copy commit ID to clipboard"] \ 11653 -variable autocopy 11654 grid x $page.autocopy -sticky w ··· 11983 $limitdiffs != $oldprefs(limitdiffs)} { 11984 reselectline 11985 } 11986 - if {$hideremotes != $oldprefs(hideremotes)} { 11987 rereadrefs 11988 } 11989 if {$wrapcomment != $oldprefs(wrapcomment)} { ··· 12360 return $tcl_enc 12361 } 12362 12363 ## For msgcat loading, first locate the installation location. 12364 if { [info exists ::env(GITK_MSGSDIR)] } { 12365 ## Msgsdir was manually set in the environment. ··· 12467 set wrapdefault "none" 12468 set showneartags 1 12469 set hideremotes 0 12470 set sortrefsbytype 1 12471 set maxrefs 20 12472 set visiblerefs {"master"} ··· 12610 mergecolors 12611 perfile_attrs 12612 reflinecolor 12613 remotebgcolor 12614 selectbgcolor 12615 showlocalchanges
··· 2033 set tagids($name) $id 2034 lappend idtags($id) $name 2035 } else { 2036 + if [is_other_ref_visible $name] { 2037 + set otherrefids($name) $id 2038 + lappend idotherrefs($id) $name 2039 + } 2040 } 2041 } 2042 catch {close $refd} ··· 11651 -variable hideremotes 11652 grid x $page.hideremotes -sticky w 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 + 11661 ttk::checkbutton $page.autocopy -text [mc "Copy commit ID to clipboard"] \ 11662 -variable autocopy 11663 grid x $page.autocopy -sticky w ··· 11992 $limitdiffs != $oldprefs(limitdiffs)} { 11993 reselectline 11994 } 11995 + if {$hideremotes != $oldprefs(hideremotes) || $refstohide != $oldprefs(refstohide)} { 11996 rereadrefs 11997 } 11998 if {$wrapcomment != $oldprefs(wrapcomment)} { ··· 12369 return $tcl_enc 12370 } 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 + 12389 ## For msgcat loading, first locate the installation location. 12390 if { [info exists ::env(GITK_MSGSDIR)] } { 12391 ## Msgsdir was manually set in the environment. ··· 12493 set wrapdefault "none" 12494 set showneartags 1 12495 set hideremotes 0 12496 + set refstohide "" 12497 set sortrefsbytype 1 12498 set maxrefs 20 12499 set visiblerefs {"master"} ··· 12637 mergecolors 12638 perfile_attrs 12639 reflinecolor 12640 + refstohide 12641 remotebgcolor 12642 selectbgcolor 12643 showlocalchanges

History

4 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
gitk: Add user preference to hide specific references
merge conflicts detected
expand
  • gitk:11696
expand 0 comments
1 commit
expand
fix merge conflicts
expand 0 comments
1 commit
expand
gitk: Add user preference to hide specific references
expand 0 comments
1 commit
expand
gitk: Add user preference to hide custom references
expand 0 comments