{"thread":{"id":"20362","subject":"[PATCH] gitk: new option to hide remote refs","startedAt":"2009-08-03T21:53:36Z","lastAt":"2009-08-13T11:53:35Z","messageCount":6,"participants":["Thomas Rast","Junio C Hamano","Santi Béjar","Thell Fowler","Paul Mackerras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"119434","messageId":"55b7e43bcd59aa64c70edde83ac87147aa0091bb.1249336225.git.trast@student.ethz.ch","threadId":"20362","inReplyTo":null,"subject":"[PATCH] gitk: new option to hide remote refs","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-08-03T21:53:36Z","receivedAt":"2009-08-03T21:53:36Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"In repositories with lots of remotes, looking at the history in gitk\ncan be borderline insane with all the red labels for remote refs.\nIntroduce a new option in the preferences that hides them.\n\nWished-for-by: Thell Fowler <tbfowler4@gmail.com>\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nI hope the IRC-to-mail matching worked out right.  I needed this too,\nfor a repo where I deploy for testing directly through git (with\nhooks) -- to several machines, resulting in a forest of remote labels.\n\n\n gitk |   18 +++++++++++++++---\n 1 files changed, 15 insertions(+), 3 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 4604c83..aabebac 100755\n--- a/gitk\n+++ b/gitk\n@@ -1677,6 +1677,7 @@ proc readrefs {} {\n     global tagids idtags headids idheads tagobjid\n     global otherrefids idotherrefs mainhead mainheadid\n     global selecthead selectheadid\n+    global hideremotes\n \n     foreach v {tagids idtags headids idheads otherrefids idotherrefs} {\n \tcatch {unset $v}\n@@ -1689,7 +1690,7 @@ proc readrefs {} {\n \tif {![string match \"refs/*\" $ref]} continue\n \tset name [string range $ref 5 end]\n \tif {[string match \"remotes/*\" $name]} {\n-\t    if {![string match \"*/HEAD\" $name]} {\n+\t    if {![string match \"*/HEAD\" $name] && !$hideremotes} {\n \t\tset headids($name) $id\n \t\tlappend idheads($id) $name\n \t    }\n@@ -2520,6 +2521,7 @@ proc savestuff {w} {\n     global cmitmode wrapcomment datetimeformat limitdiffs\n     global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor\n     global autoselect extdifftool perfile_attrs markbgcolor\n+    global hideremotes\n \n     if {$stuffsaved} return\n     if {![winfo viewable .]} return\n@@ -2539,6 +2541,7 @@ proc savestuff {w} {\n \tputs $f [list set wrapcomment $wrapcomment]\n \tputs $f [list set autoselect $autoselect]\n \tputs $f [list set showneartags $showneartags]\n+\tputs $f [list set hideremotes $hideremotes]\n \tputs $f [list set showlocalchanges $showlocalchanges]\n \tputs $f [list set datetimeformat $datetimeformat]\n \tputs $f [list set limitdiffs $limitdiffs]\n@@ -10383,6 +10386,7 @@ proc doprefs {} {\n     global oldprefs prefstop showneartags showlocalchanges\n     global bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor\n     global tabstop limitdiffs autoselect extdifftool perfile_attrs\n+    global hideremotes\n \n     set top .gitkprefs\n     set prefstop $top\n@@ -10391,7 +10395,7 @@ proc doprefs {} {\n \treturn\n     }\n     foreach v {maxwidth maxgraphpct showneartags showlocalchanges \\\n-\t\t   limitdiffs tabstop perfile_attrs} {\n+\t\t   limitdiffs tabstop perfile_attrs hideremotes} {\n \tset oldprefs($v) [set $v]\n     }\n     toplevel $top\n@@ -10423,6 +10427,9 @@ proc doprefs {} {\n     checkbutton $top.ntag -text [mc \"Display nearby tags\"] \\\n \t-font optionfont -variable showneartags\n     grid x $top.ntag -sticky w\n+    checkbutton $top.hideremotes -text [mc \"Hide remote refs\"] \\\n+\t-font optionfont -variable hideremotes\n+    grid x $top.hideremotes -sticky w\n     checkbutton $top.ldiff -text [mc \"Limit diffs to listed paths\"] \\\n \t-font optionfont -variable limitdiffs\n     grid x $top.ldiff -sticky w\n@@ -10547,7 +10554,7 @@ proc prefscan {} {\n     global oldprefs prefstop\n \n     foreach v {maxwidth maxgraphpct showneartags showlocalchanges \\\n-\t\t   limitdiffs tabstop perfile_attrs} {\n+\t\t   limitdiffs tabstop perfile_attrs hideremotes} {\n \tglobal $v\n \tset $v $oldprefs($v)\n     }\n@@ -10561,6 +10568,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 \n     catch {destroy $prefstop}\n     unset prefstop\n@@ -10606,6 +10614,9 @@ proc prefsok {} {\n \t  $limitdiffs != $oldprefs(limitdiffs)} {\n \treselectline\n     }\n+    if {$hideremotes != $oldprefs(hideremotes)} {\n+\trereadrefs\n+    }\n }\n \n proc formatdate {d} {\n@@ -11011,6 +11022,7 @@ set mingaplen 100\n set cmitmode \"patch\"\n set wrapcomment \"none\"\n set showneartags 1\n+set hideremotes 0\n set maxrefs 20\n set maxlinelen 200\n set showlocalchanges 1\n-- \n1.6.4.249.gea1ec\n"},{"id":"119464","messageId":"7vab2g6qkd.fsf@alter.siamese.dyndns.org","threadId":"20362","inReplyTo":"55b7e43bcd59aa64c70edde83ac87147aa0091bb.1249336225.git.trast@student.ethz.ch","subject":"Re: [PATCH] gitk: new option to hide remote refs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-04T06:28:18Z","receivedAt":"2009-08-04T06:28:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Rast <trast@student.ethz.ch> writes:\n\n> @@ -1689,7 +1690,7 @@ proc readrefs {} {\n>  \tif {![string match \"refs/*\" $ref]} continue\n>  \tset name [string range $ref 5 end]\n>  \tif {[string match \"remotes/*\" $name]} {\n> -\t    if {![string match \"*/HEAD\" $name]} {\n> +\t    if {![string match \"*/HEAD\" $name] && !$hideremotes} {\n>  \t\tset headids($name) $id\n>  \t\tlappend idheads($id) $name\n>  \t    }\n\nHmm, I wonder if it would be more useful to extend this by using $skiprefs\npattern instead, like so:\n\n>  \tif {![string match \"refs/*\" $ref]} continue\n>  \tset name [string range $ref 5 end]\n+\tif {$skiprefs != \"\" && [string match $skiprefs $name]} continue\n>  \tif {[string match \"remotes/*\" $name]} {\n> \t    if {![string match \"*/HEAD\" $name]} {\n\t...\n"},{"id":"119480","messageId":"200908041108.19108.trast@student.ethz.ch","threadId":"20362","inReplyTo":"7vab2g6qkd.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] gitk: new option to hide remote refs","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-08-04T09:08:17Z","receivedAt":"2009-08-04T09:08:17Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Junio C Hamano wrote:\n> Thomas Rast <trast@student.ethz.ch> writes:\n> \n> > -\t    if {![string match \"*/HEAD\" $name]} {\n> > +\t    if {![string match \"*/HEAD\" $name] && !$hideremotes} {\n> \n> Hmm, I wonder if it would be more useful to extend this by using $skiprefs\n> pattern instead, like so:\n[...]\n> +\tif {$skiprefs != \"\" && [string match $skiprefs $name]} continue\n\nShortly after sending the patch, I had another idea: how about an\noption to only show refs that were given on the command line, if any?\nThat way 'gitk --branches' or 'gitk HEAD' would hide the whole remotes\nmess (and of course also all other refs in the process).  I think I\nmight be able to voodoo enough Tk to implement this.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"119484","messageId":"adf1fd3d0908040244m1c7d45ffw67be74091da74730@mail.gmail.com","threadId":"20362","inReplyTo":"200908041108.19108.trast@student.ethz.ch","subject":"Re: [PATCH] gitk: new option to hide remote refs","fromName":"Santi Béjar","fromEmail":"santi@agolina.net","sentAt":"2009-08-04T09:44:31Z","receivedAt":"2009-08-04T09:44:31Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"2009/8/4 Thomas Rast <trast@student.ethz.ch>:\n> Junio C Hamano wrote:\n>> Thomas Rast <trast@student.ethz.ch> writes:\n>>\n>> > -       if {![string match \"*/HEAD\" $name]} {\n>> > +       if {![string match \"*/HEAD\" $name] && !$hideremotes} {\n>>\n>> Hmm, I wonder if it would be more useful to extend this by using $skiprefs\n>> pattern instead, like so:\n> [...]\n>> +     if {$skiprefs != \"\" && [string match $skiprefs $name]} continue\n>\n> Shortly after sending the patch, I had another idea: how about an\n> option to only show refs that were given on the command line, if any?\n> That way 'gitk --branches' or 'gitk HEAD' would hide the whole remotes\n> mess (and of course also all other refs in the process).  I think I\n> might be able to voodoo enough Tk to implement this.\n\nAnother possibility could be to have just an indication that the\ncommit has branches and/or tags pointing to it. Maybe just as it is\nnow but without the branch/tag name.\n\nTo mimic the current UI it could be:\n\no-<|-|_| Commit summary\n\nwith:\n\n o the current circle\n <| a yellow triangle\n |_| a green square\n\nand then if you click on them you could get the current view, or a\nlist of branches/tags in the lower panel.\n\nmy 2 cents,\nSanti\n"},{"id":"120102","messageId":"alpine.DEB.2.00.0908091909140.3470@GWPortableVCS","threadId":"20362","inReplyTo":"55b7e43bcd59aa64c70edde83ac87147aa0091bb.1249336225.git.trast@student.ethz.ch","subject":"Re: [PATCH] gitk: new option to hide remote refs","fromName":"Thell Fowler","fromEmail":"git@tbfowler.name","sentAt":"2009-08-10T00:14:12Z","receivedAt":"2009-08-10T00:14:12Z","isPatch":true,"sender":{"key":"git@tbfowler.name","avatar":"https://gravatar.com/avatar/8b82510e07f3a8a77c8f41ce04c75c3b59b7e9c2d6f495b8f2ed834359efa6de?d=mp&s=160"},"body":"Thomas Rast (trast@student.ethz.ch) wrote on Aug 3, 2009:\n\n> In repositories with lots of remotes, looking at the history in gitk\n> can be borderline insane with all the red labels for remote refs.\n> Introduce a new option in the preferences that hides them.\n\nThanks for doing this!  It definitely is saving the sanity and is working \ngreat!\n\n-- \nThell\n"},{"id":"120513","messageId":"19075.65215.120894.823187@cargo.ozlabs.ibm.com","threadId":"20362","inReplyTo":"55b7e43bcd59aa64c70edde83ac87147aa0091bb.1249336225.git.trast@student.ethz.ch","subject":"Re: [PATCH] gitk: new option to hide remote refs","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2009-08-13T11:53:35Z","receivedAt":"2009-08-13T11:53:35Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Thomas Rast writes:\n\n> In repositories with lots of remotes, looking at the history in gitk\n> can be borderline insane with all the red labels for remote refs.\n> Introduce a new option in the preferences that hides them.\n\nThanks, applied.  I modified the patch description slightly since the\npatched gitk doesn't just hide the remote refs, it ignores them\ncompletely (\"hide\" implies to me that gitk still knows about them but\nchooses not to show them).\n\nPaul.\n"}]}