Skip to content

Commit

Permalink
Merge branch 'th/difftool-diffall'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed May 7, 2012
2 parents ad799ea + bf73fc2 commit cae0977
Show file tree
Hide file tree
Showing 4 changed files with 398 additions and 87 deletions.
17 changes: 12 additions & 5 deletions Documentation/git-difftool.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ linkgit:git-diff[1].

OPTIONS
-------
-d::
--dir-diff::
Copy the modified files to a temporary location and perform
a directory diff on them. This mode never prompts before
launching the diff tool.

-y::
--no-prompt::
Do not prompt before launching a diff tool.
Expand All @@ -30,11 +36,9 @@ OPTIONS

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

--tool-help::
Print a list of diff tools that may be used with `--tool`.

-x <command>::
--extcmd=<command>::
Specify a custom command for viewing diffs.
Expand Down
19 changes: 13 additions & 6 deletions git-difftool--helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading

0 comments on commit cae0977

Please sign in to comment.