From ba959de165c6fc0d08d851894a98778e739aafc9 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Sat, 8 Oct 2011 18:40:15 +0530 Subject: git-difftool: allow skipping file by typing 'n' at prompt This is useful if you forgot to restrict the diff to the paths you want to see, or selecting precisely the ones you want is too much typing. [jc: with a change to return from the function upon 'n' by Charles Bailey and a small tweak in stdin_doesnot_contain() in the test] Signed-off-by: Sitaram Chamarty Signed-off-by: Junio C Hamano --- git-difftool--helper.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'git-difftool--helper.sh') diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh index 8452890be9..e6558d1010 100755 --- a/git-difftool--helper.sh +++ b/git-difftool--helper.sh @@ -43,12 +43,15 @@ launch_merge_tool () { 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 + if read ans && test "$ans" = n + then + return fi - read ans fi if use_ext_cmd -- cgit v1.2.3