git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] git-gui: new config to control staging of untracked files

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Oct 14, 2011, 19:25 UTC
Message-ID
<03727ea04f20c953e7de3f84ab1724a8360ca2c4.1318620267.git.bert.wesarg@googlemail.com>
In-Reply-To
<446a8233349fd7d084fd01bf1176a4073ff17593.1318620267.git.bert.wesarg@googlemail.com>
The default is the current "ask".
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 git-gui.sh     |    1 +
 lib/index.tcl  |   14 +++++++++++++-
 lib/option.tcl |   18 ++++++++++++++++++
 3 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index f897160..77deff7 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -859,6 +859,7 @@ set font_descs {
 	{fontui   font_ui   {mc "Main Font"}}
 	{fontdiff font_diff {mc "Diff/Console Font"}}
 }
+set default_config(gui.stageuntracked) ask
 
 ######################################################################
 ##
diff --git a/lib/index.tcl b/lib/index.tcl
index 014acf9..45094c2 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 3807c8d..719103a 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
+			}
 			}
 		}
 	}
-- 
1.7.6.789.gb4599
Previous: Bert WesargNext: Heiko Voigt
Message 3 of 9 in “git-gui: fix unintended line break in message string”
  1. 1/3 git-gui: fix unintended line break in message stringBert Wesarg, Oct 14, 2011
  2. 2/3 git-gui: use "untracked" for files which are not known to gitBert Wesarg, Oct 14, 2011
  3. 3/3 git-gui: new config to control staging of untracked filesBert Wesarg, Oct 14, 2011
  4. Heiko VoigtOct 17, 2011
  5. Bert WesargOct 17, 2011
  6. Heiko VoigtOct 17, 2011
  7. Pat ThoytsOct 17, 2011
  8. Bert WesargOct 18, 2011
  9. Pat ThoytsOct 18, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.