From: Michael J Gruber Date: Tue, 14 Dec 2010 09:18:35 +0000 (+0100) Subject: difftool: provide basename to external tools X-Git-Tag: v1.7.4-rc0~3^2~8 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4a689afb030c1cd5aa1c141db94bbf9dde42f05e;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/Documentation/git-difftool.txt b/Documentation/git-difftool.txt index 498b1610f..573843211 100644 --- a/Documentation/git-difftool.txt +++ b/Documentation/git-difftool.txt @@ -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:: diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh index 524f5ea8a..0594bf7ca 100755 --- a/git-difftool--helper.sh +++ b/git-difftool--helper.sh @@ -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"