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

Re: [PATCH 2/2] Make difftool.prompt fall back to mergetool.prompt

From
Sebastian Schuberth <sschuberth@gmail.com>
Date
Jan 20, 2010, 16:10 UTC
Message-ID
<4B572B12.50907@gmail.com>
In-Reply-To
<4B5721B2.5050703@gmail.com>

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
Previous: Sebastian Schuberth
Message 2 of 2 in “Make difftool.prompt fall back to mergetool.prompt”
  1. 2/2 Make difftool.prompt fall back to mergetool.promptSebastian Schuberth, Jan 20, 2010
  2. Sebastian SchuberthJan 20, 2010

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.