Re: [PATCH] mergetool: support absolute paths to tools by git config merge.<tool>path
- From
Theodore Tso <tytso@mit.edu>
- Date
- Oct 8, 2007, 21:57 UTC
- Message-ID
- <20071008215729.GC31713@thunk.org>
- In-Reply-To
- <11918785613855-git-send-email-prohaska@zib.de>
On Mon, Oct 08, 2007 at 11:22:40PM +0200, Steffen Prohaska wrote:
> This commit adds a mechanism to provide absolute paths to the > commands called by 'git mergetool'. A path can be specified > in the configuation variable merge.<toolname>path.
This patch doesn't work the config file doesn't specify an explicit mergetool via merge.tool. The reason for that is this loop:
for i in $merge_tool_candidates; do
if test $i = emerge ; then
cmd=emacs
else
cmd=$i
fi
if type $cmd > /dev/null 2>&1; then
merge_tool=$i
break
fi
doneis only checking to see if $cmd is in the path; it's not looking up the merge.<toolname>path variable in this loop.
I guess the other question is whether we would be better off simply telling the user to specify an absolute pathname in merge.tool, and then having git-mergetool strip off the directory path via basename, and then on window systems, stripping off the .EXE or .COM suffix, and then downcasing the name so that something like "C:\Program Files\ECMerge\ECMerge.exe" gets translated to "ecmerge". Would I be right in guessing that the reason why you used merge.<toolname>path approach was to avoid this messy headache?
- Ted