mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
difftool: add support for a difftool.prompt config variable
difftool now supports difftool.prompt so that users do not have to pass --no-prompt or hit enter each time a diff tool is launched. The --prompt flag overrides the configuration variable. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
f92f2038a5
commit
a904392eae
@@ -5,9 +5,15 @@
|
||||
#
|
||||
# Copyright (c) 2009 David Aguilar
|
||||
|
||||
# Set GIT_DIFFTOOL_NO_PROMPT to bypass the per-file prompt.
|
||||
# difftool.prompt controls the default prompt/no-prompt behavior
|
||||
# and is overridden with $GIT_DIFFTOOL*_PROMPT.
|
||||
should_prompt () {
|
||||
test -z "$GIT_DIFFTOOL_NO_PROMPT"
|
||||
prompt=$(git config --bool difftool.prompt || echo true)
|
||||
if test "$prompt" = true; then
|
||||
test -z "$GIT_DIFFTOOL_NO_PROMPT"
|
||||
else
|
||||
test -n "$GIT_DIFFTOOL_PROMPT"
|
||||
fi
|
||||
}
|
||||
|
||||
# This function prepares temporary files and launches the appropriate
|
||||
|
||||
Reference in New Issue
Block a user