{"thread":{"id":"36988","subject":"[PATCH] gitk: add visiblerefs option, which lists always shown branches","startedAt":"2014-06-24T05:19:44Z","lastAt":"2014-06-24T05:19:44Z","messageCount":1,"participants":["Max Kirillov"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"244910","messageId":"20140624051944.GA14064@wheezy.local","threadId":"36988","inReplyTo":null,"subject":"[PATCH] gitk: add visiblerefs option, which lists always shown branches","fromName":"Max Kirillov","fromEmail":"max@max630.net","sentAt":"2014-06-24T05:19:44Z","receivedAt":"2014-06-24T05:19:44Z","isPatch":true,"sender":{"key":"max@max630.net","avatar":"https://avatars.githubusercontent.com/u/381560?v=4"},"body":"When many branches contain the commit, they used to be shown in\nthe form \"A, B and many more\", where A, B can be master of current\nHEAD. But there are more which might be interesting to always know about.\nFor example, \"origin/master\".\n\nThe new option, visiblerefs, is stored in ~/.gitk. It contains a list\nof references which are always shown before \"and many more\" if they\ncontain the commit. By default it is `{\"master\"}', which is compatible\nwith previous behavior.\n\nSigned-off-by: Max Kirillov <max@max630.net>\n---\n gitk | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 41e5071..7ce6014 100755\n--- a/gitk\n+++ b/gitk\n@@ -2787,7 +2787,7 @@ proc savestuff {w} {\n     global mainheadcirclecolor workingfilescirclecolor indexcirclecolor\n     global linkfgcolor circleoutlinecolor\n     global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk\n-    global hideremotes want_ttk maxrefs\n+    global hideremotes want_ttk maxrefs visiblerefs\n     global config_file config_file_tmp\n \n     if {$stuffsaved} return\n@@ -2813,6 +2813,7 @@ proc savestuff {w} {\n \tputs $f [list set autosellen $autosellen]\n \tputs $f [list set showneartags $showneartags]\n \tputs $f [list set maxrefs $maxrefs]\n+\tputs $f [list set visiblerefs $visiblerefs]\n \tputs $f [list set hideremotes $hideremotes]\n \tputs $f [list set showlocalchanges $showlocalchanges]\n \tputs $f [list set datetimeformat $datetimeformat]\n@@ -7033,7 +7034,7 @@ proc viewnextline {dir} {\n # add a list of tag or branch names at position pos\n # returns the number of names inserted\n proc appendrefs {pos ids var} {\n-    global ctext linknum curview $var maxrefs mainheadid\n+    global ctext linknum curview $var maxrefs visiblerefs mainheadid\n \n     if {[catch {$ctext index $pos}]} {\n \treturn 0\n@@ -7054,14 +7055,14 @@ proc appendrefs {pos ids var} {\n     if {[llength $tags] > $maxrefs} {\n \t# If we are displaying heads, and there are too many,\n \t# see if there are some important heads to display.\n-\t# Currently this means \"master\" and the current head.\n+\t# Currently that are the current head and heads listed in $visiblerefs option\n \tset itags {}\n \tif {$var eq \"idheads\"} {\n \t    set utags {}\n \t    foreach ti $tags {\n \t\tset hname [lindex $ti 0]\n \t\tset id [lindex $ti 1]\n-\t\tif {($hname eq \"master\" || $id eq $mainheadid) &&\n+\t\tif {([lsearch -exact $visiblerefs $hname] != -1 || $id eq $mainheadid) &&\n \t\t    [llength $itags] < $maxrefs} {\n \t\t    lappend itags $ti\n \t\t} else {\n@@ -12043,6 +12044,7 @@ set wrapcomment \"none\"\n set showneartags 1\n set hideremotes 0\n set maxrefs 20\n+set visiblerefs {\"master\"}\n set maxlinelen 200\n set showlocalchanges 1\n set limitdiffs 1\n-- \n2.0.0.526.g5318336\n"}]}