Skip to content

Commit

Permalink
git-gui: added gui.maxrecentrepo to extend the number of remembered r…
Browse files Browse the repository at this point in the history
…epos

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 <patthoyts@users.sourceforge.net>
  • Loading branch information
Pat Thoyts committed Aug 27, 2013
1 parent 317797b commit a865604
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/choose_repository.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ field sorted_recent ; # recent repositories (sorted)
constructor pick {} {
global M1T M1B use_ttk NS

if {[set maxrecent [get_config gui.maxrecentrepo]] eq {}} {
set maxrecent 10
}

make_dialog top w
wm title $top [mc "Git Gui"]

Expand Down Expand Up @@ -148,7 +152,7 @@ constructor pick {} {
-background [get_bg_color $w_body.recentlabel] \
-wrap none \
-width 50 \
-height 10
-height $maxrecent
$w_recentlist tag conf link \
-foreground blue \
-underline 1
Expand Down Expand Up @@ -264,7 +268,11 @@ proc _append_recentrepos {path} {
git config --global --add gui.recentrepo $path
load_config 1

while {[llength $recent] > 10} {
if {[set maxrecent [get_config gui.maxrecentrepo]] eq {}} {
set maxrecent 10
}

while {[llength $recent] > $maxrecent} {
_unset_recentrepo [lindex $recent 0]
set recent [lrange $recent 1 end]
}
Expand Down

0 comments on commit a865604

Please sign in to comment.