summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kirillov <max@max630.net>2014-06-24 08:19:44 +0300
committerPaul Mackerras <paulus@samba.org>2014-06-27 16:37:14 +1000
commitbde4a0f9f3035d482a80c32b4a485333b9ed4875 (patch)
tree31df230a1941d2d486c94b949c4dc1ecb8e6ba77
parentac54a4b7715543a29cf72a49a3dd8add32796e86 (diff)
downloadgit-bde4a0f9f3035d482a80c32b4a485333b9ed4875.tar.gz
gitk: Add visiblerefs option, which lists always-shown branches
When many branches contain a commit, the branches used to be shown in the form "A, B and many more", where A, B can be master of current HEAD. But there are more which might be interesting to always know about. For example, "origin/master". The new option, visiblerefs, is stored in ~/.gitk. It contains a list of references which are always shown before "and many more" if they contain the commit. By default it is `{"master"}', which is compatible with previous behavior. Signed-off-by: Max Kirillov <max@max630.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rwxr-xr-xgitk10
1 files changed, 6 insertions, 4 deletions
diff --git a/gitk b/gitk
index 9237830328..c8df35dee5 100755
--- a/gitk
+++ b/gitk
@@ -2787,7 +2787,7 @@ proc savestuff {w} {
global mainheadcirclecolor workingfilescirclecolor indexcirclecolor
global linkfgcolor circleoutlinecolor
global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk
- global hideremotes want_ttk maxrefs
+ global hideremotes want_ttk maxrefs visiblerefs
global config_file config_file_tmp
if {$stuffsaved} return
@@ -2813,6 +2813,7 @@ proc savestuff {w} {
puts $f [list set autosellen $autosellen]
puts $f [list set showneartags $showneartags]
puts $f [list set maxrefs $maxrefs]
+ puts $f [list set visiblerefs $visiblerefs]
puts $f [list set hideremotes $hideremotes]
puts $f [list set showlocalchanges $showlocalchanges]
puts $f [list set datetimeformat $datetimeformat]
@@ -7035,7 +7036,7 @@ proc viewnextline {dir} {
# add a list of tag or branch names at position pos
# returns the number of names inserted
proc appendrefs {pos ids var} {
- global ctext linknum curview $var maxrefs mainheadid
+ global ctext linknum curview $var maxrefs visiblerefs mainheadid
if {[catch {$ctext index $pos}]} {
return 0
@@ -7056,14 +7057,14 @@ proc appendrefs {pos ids var} {
if {[llength $tags] > $maxrefs} {
# If we are displaying heads, and there are too many,
# see if there are some important heads to display.
- # Currently this means "master" and the current head.
+ # Currently that are the current head and heads listed in $visiblerefs option
set itags {}
if {$var eq "idheads"} {
set utags {}
foreach ti $tags {
set hname [lindex $ti 0]
set id [lindex $ti 1]
- if {($hname eq "master" || $id eq $mainheadid) &&
+ if {([lsearch -exact $visiblerefs $hname] != -1 || $id eq $mainheadid) &&
[llength $itags] < $maxrefs} {
lappend itags $ti
} else {
@@ -12045,6 +12046,7 @@ set wrapcomment "none"
set showneartags 1
set hideremotes 0
set maxrefs 20
+set visiblerefs {"master"}
set maxlinelen 200
set showlocalchanges 1
set limitdiffs 1