]> git.ipfire.org Git - thirdparty/git.git/commitdiff
difftool: provide basename to external tools
authorMichael J Gruber <git@drmicha.warpmail.net>
Tue, 14 Dec 2010 09:18:35 +0000 (10:18 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Dec 2010 21:01:36 +0000 (13:01 -0800)
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>
Documentation/git-difftool.txt
git-difftool--helper.sh

index 498b1610f46ce7a4778c0e76f36d212d2a605fae..573843211112a6efb7b296bbc5b11894c01dd8cd 100644 (file)
@@ -64,6 +64,7 @@ with custom merge tool commands and has the same value as `$MERGED`.
        Specify a custom command for viewing diffs.
        'git-difftool' ignores the configured defaults and runs
        `$command $LOCAL $REMOTE` when this option is specified.
+       Additionally, `$BASE` is set in the environment.
 
 -g::
 --gui::
index 524f5ea8ab14bb44e5a8e6393e40c0ec5c1ddaa2..0594bf7ca54c6b91d5f96dd86d8962e93459d004 100755 (executable)
@@ -49,6 +49,7 @@ launch_merge_tool () {
        fi
 
        if use_ext_cmd; then
+               export BASE
                eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"'
        else
                run_merge_tool "$merge_tool"