All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Schuberth <sschuberth@gmail.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: git@vger.kernel.org, davvid@gmail.com
Subject: Re: [PATCH 1/2] Allow to override mergetool.prompt with $GIT_MERGETOOL*_PROMPT
Date: Wed, 20 Jan 2010 17:10:21 +0100	[thread overview]
Message-ID: <4B572AED.1040801@gmail.com> (raw)
In-Reply-To: <4B572870.6090001@viscovery.net>

This is for symmetry with git-difftool, and to make should_prompt_merge ()
reusable from within git-difftool--helper.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
 git-mergetool--lib.sh |    9 +++++++++
 git-mergetool.sh      |    2 +-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 5b62785..b0e4156 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -7,6 +7,15 @@ merge_mode() {
 	test "$TOOL_MODE" = merge
 }
 
+should_prompt_merge () {
+	prompt=$(git config --bool mergetool.prompt || echo true)
+	if test "$prompt" = true; then
+		test -z "$GIT_MERGETOOL_NO_PROMPT"
+	else
+		test -n "$GIT_MERGETOOL_PROMPT"
+	fi
+}
+
 translate_merge_tool_path () {
 	case "$1" in
 	vimdiff)
diff --git a/git-mergetool.sh b/git-mergetool.sh
index b52a741..69f1627 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -202,7 +202,7 @@ merge_file () {
     return 0
 }
 
-prompt=$(git config --bool mergetool.prompt || echo true)
+prompt=$(should_prompt_merge && echo true || echo false)
 
 while test $# != 0
 do
-- 
1.6.6.266.g55d982.dirty

  reply	other threads:[~2010-01-20 16:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20 15:30 [PATCH 1/2] Allow to override mergetool.prompt with $GIT_MERGETOOL*_PROMPT Sebastian Schuberth
2010-01-20 15:59 ` Johannes Sixt
2010-01-20 16:10   ` Sebastian Schuberth [this message]
2010-01-21  7:44 ` David Aguilar
2010-01-21 10:10   ` Sebastian Schuberth
2010-01-22  1:58     ` David Aguilar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B572AED.1040801@gmail.com \
    --to=sschuberth@gmail.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.