{"thread":{"id":"32271","subject":"[PATCH v2] gitk: add a checkbox to control the visibility of tags","startedAt":"2012-12-05T00:48:33Z","lastAt":"2012-12-05T00:48:33Z","messageCount":1,"participants":["Łukasz Stelmach"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"204505","messageId":"1354668513-4858-1-git-send-email-stlman@poczta.fm","threadId":"32271","inReplyTo":"7vwqwztv75.fsf@alter.siamese.dyndns.org","subject":"[PATCH v2] gitk: add a checkbox to control the visibility of tags","fromName":"Łukasz Stelmach","fromEmail":"stlman@poczta.fm","sentAt":"2012-12-05T00:48:33Z","receivedAt":"2012-12-05T00:48:33Z","isPatch":true,"sender":{"key":"stlman@poczta.fm","avatar":"https://gravatar.com/avatar/f935fa2cd53deb6667c2c9d2d7fa70569dc64b87bfbb914d1bd1b01765d93a38?d=mp&s=160"},"body":"Enable hiding of tags displayed in the tree as yellow labels.\nIf a repository is used together with a system like Gerrit\nthere may be quite a lot of tags used to control building\nand there may be hardly any place left for commit subjects.\n\nSigned-off-by: Łukasz Stelmach <stlman@poczta.fm>\n---\nRebased onto Paul's repository.\n\n gitk |   23 +++++++++++++++--------\n 1 files changed, 15 insertions(+), 8 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 379582a..46c1a7c 100755\n--- a/gitk\n+++ b/gitk\n@@ -1754,7 +1754,7 @@ proc readrefs {} {\n     global tagids idtags headids idheads tagobjid\n     global otherrefids idotherrefs mainhead mainheadid\n     global selecthead selectheadid\n-    global hideremotes\n+    global hideremotes hidetags\n \n     foreach v {tagids idtags headids idheads otherrefids idotherrefs} {\n \tcatch {unset $v}\n@@ -1776,6 +1776,7 @@ proc readrefs {} {\n \t    set headids($name) $id\n \t    lappend idheads($id) $name\n \t} elseif {[string match \"tags/*\" $name]} {\n+\t    if {$hidetags} continue\n \t    # this lets refs/tags/foo^{} overwrite refs/tags/foo,\n \t    # which is what we want since the former is the commit ID\n \t    set name [string range $name 5 end]\n@@ -2709,7 +2710,7 @@ proc savestuff {w} {\n     global cmitmode wrapcomment datetimeformat limitdiffs\n     global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor\n     global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk\n-    global hideremotes want_ttk\n+    global hideremotes hidetags want_ttk\n \n     if {$stuffsaved} return\n     if {![winfo viewable .]} return\n@@ -2732,6 +2733,7 @@ proc savestuff {w} {\n \tputs $f [list set autosellen $autosellen]\n \tputs $f [list set showneartags $showneartags]\n \tputs $f [list set hideremotes $hideremotes]\n+\tputs $f [list set hidetags $hidetags]\n \tputs $f [list set showlocalchanges $showlocalchanges]\n \tputs $f [list set datetimeformat $datetimeformat]\n \tputs $f [list set limitdiffs $limitdiffs]\n@@ -10924,7 +10926,7 @@ proc create_prefs_page {w} {\n proc prefspage_general {notebook} {\n     global NS maxwidth maxgraphpct showneartags showlocalchanges\n     global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs\n-    global hideremotes want_ttk have_ttk\n+    global hideremotes hidetags want_ttk have_ttk\n \n     set page [create_prefs_page $notebook.general]\n \n@@ -10947,6 +10949,9 @@ proc prefspage_general {notebook} {\n     ${NS}::checkbutton $page.hideremotes -text [mc \"Hide remote refs\"] \\\n \t-variable hideremotes\n     grid x $page.hideremotes -sticky w\n+    ${NS}::checkbutton $page.hidetags -text [mc \"Hide tag labels\"] \\\n+\t-variable hidetags\n+    grid x $page.hidetags -sticky w\n \n     ${NS}::label $page.ddisp -text [mc \"Diff display options\"]\n     grid $page.ddisp - -sticky w -pady 10\n@@ -11048,7 +11053,7 @@ proc doprefs {} {\n     global oldprefs prefstop showneartags showlocalchanges\n     global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor\n     global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs\n-    global hideremotes want_ttk have_ttk\n+    global hideremotes hidetags want_ttk have_ttk\n \n     set top .gitkprefs\n     set prefstop $top\n@@ -11057,7 +11062,7 @@ proc doprefs {} {\n \treturn\n     }\n     foreach v {maxwidth maxgraphpct showneartags showlocalchanges \\\n-\t\t   limitdiffs tabstop perfile_attrs hideremotes want_ttk} {\n+\t\t   limitdiffs tabstop perfile_attrs hideremotes hidetags want_ttk} {\n \tset oldprefs($v) [set $v]\n     }\n     ttk_toplevel $top\n@@ -11177,7 +11182,7 @@ proc prefscan {} {\n     global oldprefs prefstop\n \n     foreach v {maxwidth maxgraphpct showneartags showlocalchanges \\\n-\t\t   limitdiffs tabstop perfile_attrs hideremotes want_ttk} {\n+\t\t   limitdiffs tabstop perfile_attrs hideremotes hidetags want_ttk} {\n \tglobal $v\n \tset $v $oldprefs($v)\n     }\n@@ -11191,7 +11196,7 @@ proc prefsok {} {\n     global oldprefs prefstop showneartags showlocalchanges\n     global fontpref mainfont textfont uifont\n     global limitdiffs treediffs perfile_attrs\n-    global hideremotes\n+    global hideremotes hidetags\n \n     catch {destroy $prefstop}\n     unset prefstop\n@@ -11237,7 +11242,8 @@ proc prefsok {} {\n \t  $limitdiffs != $oldprefs(limitdiffs)} {\n \treselectline\n     }\n-    if {$hideremotes != $oldprefs(hideremotes)} {\n+    if {$hideremotes != $oldprefs(hideremotes) ||\n+        $hidetags != $oldprefs(hidetags)} {\n \trereadrefs\n     }\n }\n@@ -11661,6 +11667,7 @@ set cmitmode \"patch\"\n set wrapcomment \"none\"\n set showneartags 1\n set hideremotes 0\n+set hidetags 0\n set maxrefs 20\n set maxlinelen 200\n set showlocalchanges 1\n-- \n1.7.8.6\n"}]}