git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] Make difftool.prompt fall back to mergetool.prompt
@ 2010-01-20 15:30 Sebastian Schuberth
  2010-01-20 16:10 ` Sebastian Schuberth
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Schuberth @ 2010-01-20 15:30 UTC (permalink / raw)
  To: git; +Cc: davvid

The documentation states that "git-difftool falls back to git-mergetool
config variables when the difftool equivalents have not been defined".
Until now, this was not the case for "difftool.prompt".

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
 git-difftool--helper.sh |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 57e8e32..a7185b2 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -11,8 +11,9 @@ TOOL_MODE=diff
 
 # difftool.prompt controls the default prompt/no-prompt behavior
 # and is overridden with $GIT_DIFFTOOL*_PROMPT.
-should_prompt () {
-	prompt=$(git config --bool difftool.prompt || echo true)
+should_prompt_diff () {
+	local prompt_merge=$(should_prompt_merge && echo true || echo false)
+	local prompt=$(git config --bool difftool.prompt || echo $prompt_merge)
 	if test "$prompt" = true; then
 		test -z "$GIT_DIFFTOOL_NO_PROMPT"
 	else
@@ -33,7 +34,7 @@ launch_merge_tool () {
 
 	# $LOCAL and $REMOTE are temporary files so prompt
 	# the user with the real $MERGED name before launching $merge_tool.
-	if should_prompt; then
+	if should_prompt_diff; then
 		printf "\nViewing: '$MERGED'\n"
 		printf "Hit return to launch '%s': " "$merge_tool"
 		read ans
-- 
1.6.5.1.1373.g71d1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] Make difftool.prompt fall back to mergetool.prompt
  2010-01-20 15:30 [PATCH 2/2] Make difftool.prompt fall back to mergetool.prompt Sebastian Schuberth
@ 2010-01-20 16:10 ` Sebastian Schuberth
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Schuberth @ 2010-01-20 16:10 UTC (permalink / raw)
  Cc: git, davvid

The documentation states that "git-difftool falls back to git-mergetool
config variables when the difftool equivalents have not been defined".
Until now, this was not the case for "difftool.prompt".

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
 git-difftool--helper.sh |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 57e8e32..1c1fad4 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -11,8 +11,9 @@ TOOL_MODE=diff
 
 # difftool.prompt controls the default prompt/no-prompt behavior
 # and is overridden with $GIT_DIFFTOOL*_PROMPT.
-should_prompt () {
-	prompt=$(git config --bool difftool.prompt || echo true)
+should_prompt_diff () {
+	prompt_merge=$(should_prompt_merge && echo true || echo false)
+	prompt=$(git config --bool difftool.prompt || echo $prompt_merge)
 	if test "$prompt" = true; then
 		test -z "$GIT_DIFFTOOL_NO_PROMPT"
 	else
@@ -33,7 +34,7 @@ launch_merge_tool () {
 
 	# $LOCAL and $REMOTE are temporary files so prompt
 	# the user with the real $MERGED name before launching $merge_tool.
-	if should_prompt; then
+	if should_prompt_diff; then
 		printf "\nViewing: '$MERGED'\n"
 		printf "Hit return to launch '%s': " "$merge_tool"
 		read ans
-- 
1.6.6.266.g55d982.dirty

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-20 16:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20 15:30 [PATCH 2/2] Make difftool.prompt fall back to mergetool.prompt Sebastian Schuberth
2010-01-20 16:10 ` Sebastian Schuberth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).