git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sitaram Chamarty <sitaram@atc.tcs.com>
To: git@vger.kernel.org, gitster@pobox.com
Subject: [PATCH] git-difftool: allow skipping file by typing 'n' at prompt
Date: Tue, 4 Oct 2011 16:23:33 +0530	[thread overview]
Message-ID: <20111004105333.GA24331@atcmail.atc.tcs.com> (raw)

Signed-off-by: Sitaram Chamarty <sitaram@atc.tcs.com>
---

I'm using what is pretty much a universal convention to
signify that the default choice is "y"; I hope documentation
for something so small is not needed but if it is, let me
know and I'll do that also.

 git-difftool--helper.sh |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 8452890..bc1b098 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -38,15 +38,16 @@ launch_merge_tool () {
 
 	# $LOCAL and $REMOTE are temporary files so prompt
 	# the user with the real $MERGED name before launching $merge_tool.
+	ans=y
 	if should_prompt
 	then
 		printf "\nViewing: '$MERGED'\n"
 		if use_ext_cmd
 		then
-			printf "Hit return to launch '%s': " \
+			printf "Launch '%s' [y]/n: " \
 				"$GIT_DIFFTOOL_EXTCMD"
 		else
-			printf "Hit return to launch '%s': " "$merge_tool"
+			printf "Launch '%s' [y]/n: " "$merge_tool"
 		fi
 		read ans
 	fi
@@ -54,9 +55,9 @@ launch_merge_tool () {
 	if use_ext_cmd
 	then
 		export BASE
-		eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"'
+		test "$ans" != "n" && eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"'
 	else
-		run_merge_tool "$merge_tool"
+		test "$ans" != "n" && run_merge_tool "$merge_tool"
 	fi
 }
 
-- 
1.7.6

             reply	other threads:[~2011-10-04 11:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 10:53 Sitaram Chamarty [this message]
2011-10-04 15:25 ` [PATCH] git-difftool: allow skipping file by typing 'n' at prompt Junio C Hamano
2011-10-04 17:49   ` Jeff King
2011-10-04 18:02   ` Phil Hord
2011-10-04 19:28     ` Junio C Hamano
2011-10-04 23:05       ` Sitaram Chamarty
2011-10-06 12:56         ` Sitaram Chamarty
2011-10-06 17:36           ` Junio C Hamano
2011-10-06 18:15             ` Sitaram Chamarty
2011-10-07 20:09               ` Junio C Hamano
2011-10-08 13:10                 ` Sitaram Chamarty
2011-10-09 11:26                   ` Charles Bailey
2011-10-10 20:56                   ` Junio C Hamano
2011-10-10 23:39                     ` Sitaram Chamarty

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=20111004105333.GA24331@atcmail.atc.tcs.com \
    --to=sitaram@atc.tcs.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 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).