Skip to content

Commit a865604

Browse files
committed
git-gui: added gui.maxrecentrepo to extend the number of remembered repos
The list of recently opened repositories shown when launching git-gui from outside a repository was hard coded to only show a maximum of 10 items. This config variable allows the user to override this default. Signed-off-by: Pat Thoyts <[email protected]>
1 parent 317797b commit a865604

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/choose_repository.tcl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ field sorted_recent ; # recent repositories (sorted)
2424
constructor pick {} {
2525
global M1T M1B use_ttk NS
2626

27+
if {[set maxrecent [get_config gui.maxrecentrepo]] eq {}} {
28+
set maxrecent 10
29+
}
30+
2731
make_dialog top w
2832
wm title $top [mc "Git Gui"]
2933

@@ -148,7 +152,7 @@ constructor pick {} {
148152
-background [get_bg_color $w_body.recentlabel] \
149153
-wrap none \
150154
-width 50 \
151-
-height 10
155+
-height $maxrecent
152156
$w_recentlist tag conf link \
153157
-foreground blue \
154158
-underline 1
@@ -264,7 +268,11 @@ proc _append_recentrepos {path} {
264268
git config --global --add gui.recentrepo $path
265269
load_config 1
266270

267-
while {[llength $recent] > 10} {
271+
if {[set maxrecent [get_config gui.maxrecentrepo]] eq {}} {
272+
set maxrecent 10
273+
}
274+
275+
while {[llength $recent] > $maxrecent} {
268276
_unset_recentrepo [lindex $recent 0]
269277
set recent [lrange $recent 1 end]
270278
}

0 commit comments

Comments
 (0)