difftool: provide basename to external tools
Currently, only configured diff helpers get the basename of the file being compared. Tools specified with "git difftool -x" only get the names of temporary files for the different versions. Export BASE so that an external tool can read the name from the environment. Rather than using a third argument, this avoids breaking existing scripts which may somewhat carelessly be using "$@" rather than "$1" "$2". Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael J Gruber committed
Dec 14, 2010 at 10:18 UTC
4a689afb030c1cd5aa1c141db94bbf9dde42f05e
2 files changed
+2
Documentation/git-difftool.txt
+1
@@ -64,6 +64,7 @@ with custom merge tool commands and has the same value as `$MERGED`.
64
Specify a custom command for viewing diffs.
65
'git-difftool' ignores the configured defaults and runs
66
`$command $LOCAL $REMOTE` when this option is specified.
67
+ Additionally, `$BASE` is set in the environment.
68
69
-g::
70
--gui::
git-difftool--helper.sh
+1
@@ -49,6 +49,7 @@ launch_merge_tool () {
49
fi
50
51
if use_ext_cmd; then
52
+ export BASE
53
eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"'
54
else
55
run_merge_tool "$merge_tool"