Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
difftool: provide basename to external tools
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael J Gruber authored and gitster committed Dec 16, 2010
1 parent 51bacee commit 4a689af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Documentation/git-difftool.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
1 change: 1 addition & 0 deletions git-difftool--helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4a689af

Please sign in to comment.