@@ -903,6 +903,7 @@ set font_descs {
}
set default_config(gui.stageuntracked) ask
set default_config(gui.displayuntracked) true
+set default_config(gui.revertaskconfirmation) true
######################################################################
##
@@ -389,15 +389,19 @@ proc do_add_all {} {
}
proc revert_dialog {query} {
- return [tk_dialog \
- .confirm_revert \
- "[appname] ([reponame])" \
- "$query" \
- question \
- 1 \
- [mc "Do Nothing"] \
- [mc "Revert Changes"] \
- ]
+ if {[is_config_true gui.revertaskconfirmation]} {
+ return [tk_dialog \
+ .confirm_revert \
+ "[appname] ([reponame])" \
+ "$query" \
+ question \
+ 1 \
+ [mc "Do Nothing"] \
+ [mc "Revert Changes"] \
+ ]
+ } else {
+ return 1
+ }
}
proc revert_helper {txt paths} {
@@ -162,6 +162,7 @@ proc do_options {} {
{s gui.stageuntracked {mc "Staging of untracked files"} {list "yes" "no" "ask"}}
{b gui.displayuntracked {mc "Show untracked files"}}
{i-1..99 gui.tabsize {mc "Tab spacing"}}
+ {b gui.revertaskconfirmation {mc "Ask for confirmation when reverting changes"}}
} {
set type [lindex $option 0]
set name [lindex $option 1]
When reverting files (or hunks or lines that future commits will add), a confirmation dialog is shown to make sure the user actually wanted to revert, and did not accidentally click revert. But for some people's workflow this is an hindrance. So add an option to disable this behaviour for people who are comfortable risking accidental reverts. The default behaviour is to ask for confirmation. Signed-off-by: Pratyush Yadav <me@yadavpratyush.com> --- git-gui.sh | 1 + lib/index.tcl | 22 +++++++++++++--------- lib/option.tcl | 1 + 3 files changed, 15 insertions(+), 9 deletions(-)