summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPat Thoyts <patthoyts@users.sourceforge.net>2013-07-10 13:31:13 +0100
committerPat Thoyts <patthoyts@users.sourceforge.net>2013-08-27 20:06:41 +0100
commita86560453ba8a81527d5d119ea8985a3269af1fa (patch)
treea8f7d1d376784599716d12ba07266b839a319548
parent317797bce44f57b0fcdb735a42a6340de09b4257 (diff)
downloadgit-a86560453ba8a81527d5d119ea8985a3269af1fa.tar.gz
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 <patthoyts@users.sourceforge.net>
-rw-r--r--lib/choose_repository.tcl12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/choose_repository.tcl b/lib/choose_repository.tcl
index ee58981f53..3c10bc656d 100644
--- a/lib/choose_repository.tcl
+++ b/lib/choose_repository.tcl
@@ -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"]
@@ -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
@@ -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]
}