{"thread":{"id":"56403","subject":"[PATCH v2] gitk: new option to hide prefetch refs","startedAt":"2021-08-30T11:58:40Z","lastAt":"2021-08-30T11:58:40Z","messageCount":1,"participants":["Tal Kelrich"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"434065","messageId":"CADWRo2pN9PrCdDVBWb9CN4SrB-JKNqZw9cZAUtqd5xp8y7f9PQ@mail.gmail.com","threadId":"56403","inReplyTo":"pull.1023.git.1629807301494.gitgitgadget@gmail.com","subject":"[PATCH v2] gitk: new option to hide prefetch refs","fromName":"Tal Kelrich","fromEmail":"hasturkun@gmail.com","sentAt":"2021-08-30T11:58:26Z","receivedAt":"2021-08-30T11:58:40Z","isPatch":true,"sender":{"key":"hasturkun@gmail.com","avatar":"https://avatars.githubusercontent.com/u/10245?v=4"},"body":"The maintenance 'prefetch' task creates refs that mirror remote refs,\nand in repositories with many branches this can clutter the commit list.\n\nAdd a new option to ignore any prefetch refs, enabled by default.\n\nSigned-off-by: Tal Kelrich <hasturkun@gmail.com>\n---\nChanges since v1:\n - Patch made relative to gitk tree.\n\n gitk | 23 ++++++++++++++++-------\n 1 file changed, 16 insertions(+), 7 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 23d9dd1..4e44da5 100755\n--- a/gitk\n+++ b/gitk\n\n@@ -1780,6 +1780,7 @@ proc readrefs {} {\n     global selecthead selectheadid\n     global hideremotes\n     global tclencoding\n+    global hideprefetch\n\n     foreach v {tagids idtags headids idheads otherrefids idotherrefs} {\n         unset -nocomplain $v\n@@ -1814,6 +1815,7 @@ proc readrefs {} {\n             }\n             set tagids($name) $id\n             lappend idtags($id) $name\n+        } elseif {[string match \"prefetch/*\" $name] && $hideprefetch} {\n         } else {\n             set otherrefids($name) $id\n             lappend idotherrefs($id) $name\n@@ -11548,7 +11550,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 maxrefs web_browser\n+    global hideremotes want_ttk have_ttk maxrefs web_browser hideprefetch\n\n     set page [create_prefs_page $notebook.general]\n\n@@ -11572,6 +11574,9 @@ proc prefspage_general {notebook} {\n     ${NS}::checkbutton $page.hideremotes -text [mc \"Hide remote refs\"] \\\n         -variable hideremotes\n     grid x $page.hideremotes -sticky w\n+    ${NS}::checkbutton $page.hideprefetch -text [mc \"Hide prefetch refs\"] \\\n+        -variable hideprefetch\n+    grid x $page.hideprefetch -sticky w\n\n     ${NS}::label $page.ddisp -text [mc \"Diff display options\"]\n     grid $page.ddisp - -sticky w -pady 10\n@@ -11696,7 +11701,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 want_ttk have_ttk hideprefetch\n\n     set top .gitkprefs\n     set prefstop $top\n@@ -11705,7 +11710,8 @@ proc doprefs {} {\n         return\n     }\n     foreach v {maxwidth maxgraphpct showneartags showlocalchanges \\\n-                   limitdiffs tabstop perfile_attrs hideremotes want_ttk} {\n+                   limitdiffs tabstop perfile_attrs hideremotes want_ttk \\\n+                   hideprefetch} {\n         set oldprefs($v) [set $v]\n     }\n     ttk_toplevel $top\n@@ -11831,7 +11837,8 @@ proc prefscan {} {\n     global oldprefs prefstop\n\n     foreach v {maxwidth maxgraphpct showneartags showlocalchanges \\\n-                   limitdiffs tabstop perfile_attrs hideremotes want_ttk} {\n+                   limitdiffs tabstop perfile_attrs hideremotes want_ttk \\\n+                   hideprefetch} {\n         global $v\n         set $v $oldprefs($v)\n     }\n@@ -11845,7 +11852,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 hideprefetch\n\n     catch {destroy $prefstop}\n     unset prefstop\n@@ -11891,7 +11898,8 @@ proc prefsok {} {\n           $limitdiffs != $oldprefs(limitdiffs)} {\n         reselectline\n     }\n-    if {$hideremotes != $oldprefs(hideremotes)} {\n+    if {$hideremotes != $oldprefs(hideremotes) ||\n+          $hideprefetch != $oldprefs(hideprefetch)} {\n         rereadrefs\n     }\n }\n@@ -12365,6 +12373,7 @@ set cmitmode \"patch\"\n set wrapcomment \"none\"\n set showneartags 1\n set hideremotes 0\n+set hideprefetch 1\n set maxrefs 20\n set visiblerefs {\"master\"}\n set maxlinelen 200\n@@ -12477,7 +12486,7 @@ set config_variables {\n     filesepbgcolor filesepfgcolor linehoverbgcolor linehoverfgcolor\n     linehoveroutlinecolor mainheadcirclecolor workingfilescirclecolor\n     indexcirclecolor circlecolors linkfgcolor circleoutlinecolor diffbgcolors\n-    web_browser\n+    web_browser hideprefetch\n }\n foreach var $config_variables {\n     config_init_trace $var\n--\n2.33.0\n"}]}