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>maint
							parent
							
								
									51baceeec4
								
							
						
					
					
						commit
						4a689afb03
					
				|  | @ -64,6 +64,7 @@ with custom merge tool commands and has the same value as `$MERGED`. | ||||||
| 	Specify a custom command for viewing diffs. | 	Specify a custom command for viewing diffs. | ||||||
| 	'git-difftool' ignores the configured defaults and runs | 	'git-difftool' ignores the configured defaults and runs | ||||||
| 	`$command $LOCAL $REMOTE` when this option is specified. | 	`$command $LOCAL $REMOTE` when this option is specified. | ||||||
|  | 	Additionally, `$BASE` is set in the environment. | ||||||
|  |  | ||||||
| -g:: | -g:: | ||||||
| --gui:: | --gui:: | ||||||
|  |  | ||||||
|  | @ -49,6 +49,7 @@ launch_merge_tool () { | ||||||
| 	fi | 	fi | ||||||
|  |  | ||||||
| 	if use_ext_cmd; then | 	if use_ext_cmd; then | ||||||
|  | 		export BASE | ||||||
| 		eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"' | 		eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"' | ||||||
| 	else | 	else | ||||||
| 		run_merge_tool "$merge_tool" | 		run_merge_tool "$merge_tool" | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Michael J Gruber
						Michael J Gruber