Skip to content

gitk: new option to hide prefetch refs #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -1904,6 +1904,7 @@ proc readrefs {} {
global selecthead selectheadid
global hideremotes
global tclencoding
global hideprefetch

foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
unset -nocomplain $v
Expand Down Expand Up @@ -1938,6 +1939,8 @@ proc readrefs {} {
}
set tagids($name) $id
lappend idtags($id) $name
} elseif {[string match "prefetch/*" $name] && $hideprefetch} {
# ignore
} else {
set otherrefids($name) $id
lappend idotherrefs($id) $name
Expand Down Expand Up @@ -11696,7 +11699,7 @@ proc prefspage_general {notebook} {
global NS maxwidth maxgraphpct showneartags showlocalchanges
global tabstop wrapcomment wrapdefault limitdiffs
global autocopy autoselect autosellen extdifftool perfile_attrs
global hideremotes want_ttk have_ttk maxrefs web_browser
global hideremotes want_ttk have_ttk maxrefs web_browser hideprefetch

set page [create_prefs_page $notebook.general]

Expand All @@ -11716,6 +11719,9 @@ proc prefspage_general {notebook} {
${NS}::checkbutton $page.hideremotes -text [mc "Hide remote refs"] \
-variable hideremotes
grid x $page.hideremotes -sticky w
${NS}::checkbutton $page.hideprefetch -text [mc "Hide prefetch refs"] \
-variable hideprefetch
grid x $page.hideprefetch -sticky w

${NS}::checkbutton $page.autocopy -text [mc "Copy commit ID to clipboard"] \
-variable autocopy
Expand Down Expand Up @@ -11861,7 +11867,7 @@ proc doprefs {} {
global oldprefs prefstop showneartags showlocalchanges
global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
global hideremotes want_ttk have_ttk wrapcomment wrapdefault
global hideremotes want_ttk have_ttk wrapcomment wrapdefault hideprefetch

set top .gitkprefs
set prefstop $top
Expand All @@ -11870,7 +11876,8 @@ proc doprefs {} {
return
}
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {
limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault \
hideprefetch} {
set oldprefs($v) [set $v]
}
ttk_toplevel $top
Expand Down Expand Up @@ -11996,7 +12003,8 @@ proc prefscan {} {
global oldprefs prefstop

foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault} {
limitdiffs tabstop perfile_attrs hideremotes want_ttk wrapcomment wrapdefault \
hideprefetch} {
global $v
set $v $oldprefs($v)
}
Expand All @@ -12011,7 +12019,7 @@ proc prefsok {} {
global fontpref mainfont textfont uifont
global limitdiffs treediffs perfile_attrs
global hideremotes wrapcomment wrapdefault
global ctext
global ctext hideprefetch

catch {destroy $prefstop}
unset prefstop
Expand Down Expand Up @@ -12057,7 +12065,8 @@ proc prefsok {} {
$limitdiffs != $oldprefs(limitdiffs)} {
reselectline
}
if {$hideremotes != $oldprefs(hideremotes)} {
if {$hideremotes != $oldprefs(hideremotes) ||
$hideprefetch != $oldprefs(hideprefetch)} {
rereadrefs
}
if {$wrapcomment != $oldprefs(wrapcomment)} {
Expand Down Expand Up @@ -12537,6 +12546,7 @@ set wrapcomment "none"
set wrapdefault "none"
set showneartags 1
set hideremotes 0
set hideprefetch 1
set maxrefs 20
set visiblerefs {"master"}
set maxlinelen 200
Expand Down Expand Up @@ -12651,7 +12661,7 @@ set config_variables {
filesepbgcolor filesepfgcolor linehoverbgcolor linehoverfgcolor
linehoveroutlinecolor mainheadcirclecolor workingfilescirclecolor
indexcirclecolor circlecolors linkfgcolor circleoutlinecolor diffbgcolors
web_browser
web_browser hideprefetch
}
foreach var $config_variables {
config_init_trace $var
Expand Down