Make difftool.prompt fall back to mergetool.prompt
PATCH v2 1/1 Make difftool.prompt fall back to mergetool.prompt
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".
--- git-difftool--helper.sh | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
git-difftool--helper.sh +2 -1
@@ -12,7 +12,8 @@ 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) + prompt_merge=$(git config --bool mergetool.prompt || echo true) + prompt=$(git config --bool difftool.prompt || echo $prompt_merge) if test "$prompt" = true; then test -z "$GIT_DIFFTOOL_NO_PROMPT" else
Signature · 1 line
1.6.6.265.ga0f40
A message that is not in the archive (sent off-list or not yet received): [email protected]
David Aguilar
Acked-byQuoted 10 lines · Junio C Hamano
Quoted 5 lines · Sebastian Schuberth
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 <[email protected]>David, does this look ok? It seems to match the discussion between you I saw yesterday, but just checking to make sure (if "yes" please Ack).
I would like to see a testcase to ensure we don't break it in the future, though.
Thanks Sebastian, Junio.
Sebastian, I you don't send a test I'll try to send one tonight.
Quoted 28 lines
Is it Ok that today I see only this patch not two-patch series on the topic (iow, has the other patch been withdrawn)? I didn't folow the discussion very closely.
Thanks.
Quoted 21 lines
---
git-difftool--helper.sh| 3 ++-1 files changed, 2 insertions(+), 1 deletions(-)git-difftool--helper.sh +2
-1@@ -12,7 +12,8 @@ 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) + prompt_merge=$(git config --bool mergetool.prompt || echo true) + prompt=$(git config --bool difftool.prompt || echo $prompt_merge) if test "$prompt" = true; then test -z "$GIT_DIFFTOOL_NO_PROMPT"else
Signature · 1 line
1.6.6.265.ga0f40
Quoted 1 line · David Aguilar
Sebastian, I you don't send a test I'll try to send one tonight.
I'd be glad if you could propose a testcase. Thanks.
Signature · 1 line
Sebastian Schuberth