From 7e0abcec103b3649943b236881cf88e8fd6cf3a4 Mon Sep 17 00:00:00 2001 From: Tim Henigan Date: Mon, 23 Apr 2012 14:23:41 -0400 Subject: difftool: teach difftool to handle directory diffs When 'difftool' is called to compare a range of commits that modify more than one file, it opens a separate instance of the diff tool for each file that changed. The new '--dir-diff' option copies all the modified files to a temporary location and runs a directory diff on them in a single instance of the diff tool. Signed-off-by: Tim Henigan Signed-off-by: Junio C Hamano --- git-difftool--helper.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'git-difftool--helper.sh') diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh index e6558d1010..3d0fe0cd93 100755 --- a/git-difftool--helper.sh +++ b/git-difftool--helper.sh @@ -73,9 +73,16 @@ then fi fi -# Launch the merge tool on each path provided by 'git diff' -while test $# -gt 6 -do - launch_merge_tool "$1" "$2" "$5" - shift 7 -done +if test -n "$GIT_DIFFTOOL_DIRDIFF" +then + LOCAL="$1" + REMOTE="$2" + run_merge_tool "$merge_tool" false +else + # Launch the merge tool on each path provided by 'git diff' + while test $# -gt 6 + do + launch_merge_tool "$1" "$2" "$5" + shift 7 + done +fi -- cgit v1.2.1 From 2a9ccfff5553b8ab28eb5a172738cc9f3afadcd5 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sat, 9 Feb 2013 17:21:25 -0800 Subject: difftool--helper: fix printf usage Do not use a random string as if it is a format string for printf when showing it literally; instead feed it to '%s' format. Reported-by: Asheesh Laroia Signed-off-by: David Aguilar Signed-off-by: Junio C Hamano --- git-difftool--helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-difftool--helper.sh') diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh index 3d0fe0cd93..b00ed95dba 100755 --- a/git-difftool--helper.sh +++ b/git-difftool--helper.sh @@ -40,7 +40,7 @@ launch_merge_tool () { # the user with the real $MERGED name before launching $merge_tool. if should_prompt then - printf "\nViewing: '$MERGED'\n" + printf "\nViewing: '%s'\n" "$MERGED" if use_ext_cmd then printf "Launch '%s' [Y/n]: " \ -- cgit v1.2.1