aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBert Wesarg <bert.wesarg@googlemail.com>2011-10-14 21:25:21 +0200
committerPat Thoyts <patthoyts@users.sourceforge.net>2011-10-18 09:44:10 +0100
commitbb196e2619652f02f3459ad9464a18ccdebe3ebf (patch)
tree5ce1c609c20b7cf77d904ccdff765524653386b0 /lib
parent526aa2b2033048bc90ff40228a60619ca6872e21 (diff)
downloadgit-bb196e2619652f02f3459ad9464a18ccdebe3ebf.tar.gz
git-bb196e2619652f02f3459ad9464a18ccdebe3ebf.tar.xz
git-gui: new config to control staging of untracked files
The default is the current "ask". Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/index.tcl14
-rw-r--r--lib/option.tcl18
2 files changed, 31 insertions, 1 deletions
diff --git a/lib/index.tcl b/lib/index.tcl
index 014acf931..45094c267 100644
--- a/lib/index.tcl
+++ b/lib/index.tcl
@@ -367,7 +367,19 @@ proc do_add_all {} {
}
}
if {[llength $untracked_paths]} {
- set reply [ask_popup [mc "Stage also untracked files?"]]
+ set reply 0
+ switch -- [get_config gui.stageuntracked] {
+ no {
+ set reply 0
+ }
+ yes {
+ set reply 1
+ }
+ ask -
+ default {
+ set reply [ask_popup [mc "Stage also untracked files?"]]
+ }
+ }
if {$reply} {
set paths [concat $paths $untracked_paths]
}
diff --git a/lib/option.tcl b/lib/option.tcl
index 3807c8d28..719103a42 100644
--- a/lib/option.tcl
+++ b/lib/option.tcl
@@ -156,6 +156,7 @@ proc do_options {} {
{i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}}
{t gui.newbranchtemplate {mc "New Branch Name Template"}}
{c gui.encoding {mc "Default File Contents Encoding"}}
+ {s gui.stageuntracked {mc "Staging of untracked files"} {list "yes" "no" "ask"}}
} {
set type [lindex $option 0]
set name [lindex $option 1]
@@ -208,6 +209,23 @@ proc do_options {} {
}
pack $w.$f.$optid -side top -anchor w -fill x
}
+ s {
+ set opts [eval [lindex $option 3]]
+ ${NS}::frame $w.$f.$optid
+ ${NS}::label $w.$f.$optid.l -text "$text:"
+ if {$use_ttk} {
+ ttk::combobox $w.$f.$optid.v \
+ -textvariable ${f}_config_new($name) \
+ -values $opts -state readonly
+ } else {
+ eval tk_optionMenu $w.$f.$optid.v \
+ ${f}_config_new($name) \
+ $opts
+ }
+ pack $w.$f.$optid.l -side left -anchor w -fill x
+ pack $w.$f.$optid.v -side right -anchor e -padx 5
+ pack $w.$f.$optid -side top -anchor w -fill x
+ }
}
}
}