Skip to content

Commit cae0977

Browse files
committed
Merge branch 'th/difftool-diffall'
Rolls the two-directory-diff logic from diffall script (in contrib/) into "git difftool" framework. By Tim Henigan * th/difftool-diffall: difftool: print list of valid tools with '--tool-help' difftool: teach difftool to handle directory diffs difftool: eliminate setup_environment function difftool: stop appending '.exe' to git difftool: remove explicit change of PATH difftool: exit(0) when usage is printed difftool: add '--no-gui' option difftool: parse options using Getopt::Long
2 parents ad799ea + bf73fc2 commit cae0977

File tree

4 files changed

+398
-87
lines changed

4 files changed

+398
-87
lines changed

Documentation/git-difftool.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ linkgit:git-diff[1].
1919

2020
OPTIONS
2121
-------
22+
-d::
23+
--dir-diff::
24+
Copy the modified files to a temporary location and perform
25+
a directory diff on them. This mode never prompts before
26+
launching the diff tool.
27+
2228
-y::
2329
--no-prompt::
2430
Do not prompt before launching a diff tool.
@@ -30,11 +36,9 @@ OPTIONS
3036

3137
-t <tool>::
3238
--tool=<tool>::
33-
Use the diff tool specified by <tool>.
34-
Valid diff tools are:
35-
araxis, bc3, deltawalker, diffuse, emerge, ecmerge, gvimdiff,
36-
kdiff3, kompare, meld, opendiff, p4merge, tkdiff, vimdiff and
37-
xxdiff.
39+
Use the diff tool specified by <tool>. Valid values include
40+
emerge, kompare, meld, and vimdiff. Run `git difftool --tool-help`
41+
for the list of valid <tool> settings.
3842
+
3943
If a diff tool is not specified, 'git difftool'
4044
will use the configuration variable `diff.tool`. If the
@@ -62,6 +66,9 @@ of the diff post-image. `$MERGED` is the name of the file which is
6266
being compared. `$BASE` is provided for compatibility
6367
with custom merge tool commands and has the same value as `$MERGED`.
6468

69+
--tool-help::
70+
Print a list of diff tools that may be used with `--tool`.
71+
6572
-x <command>::
6673
--extcmd=<command>::
6774
Specify a custom command for viewing diffs.

git-difftool--helper.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,16 @@ then
7373
fi
7474
fi
7575

76-
# Launch the merge tool on each path provided by 'git diff'
77-
while test $# -gt 6
78-
do
79-
launch_merge_tool "$1" "$2" "$5"
80-
shift 7
81-
done
76+
if test -n "$GIT_DIFFTOOL_DIRDIFF"
77+
then
78+
LOCAL="$1"
79+
REMOTE="$2"
80+
run_merge_tool "$merge_tool" false
81+
else
82+
# Launch the merge tool on each path provided by 'git diff'
83+
while test $# -gt 6
84+
do
85+
launch_merge_tool "$1" "$2" "$5"
86+
shift 7
87+
done
88+
fi

0 commit comments

Comments
 (0)