Re: How can a custom merge tool get access to file shell variables?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 19, 2008 at 11:32:31AM -0700, Keith Amidon wrote:
> In case anyone is interested, the following does exactly what I want.
> Hopefully this example will help someone else that wants to do something
> similar avoid spending time on writing an unnecessary shell script
> wrapper tool.
> 
> [mergetool "xxdiff-2way-ignorews"]
>     cmd = xxdiff -w $REMOTE $LOCAL --merged-filename $MERGED
>     trustExitCode = false
> 
> I think I was thrown off by the description of mergetool.<name>.cmd in
> the git-config man page.  While on close reading it is definitely
> correct, for me at least it seemed natural to assume that the invoked
> command was supposed to get its information from the environment, not
> that the command line itself could substitute from the environment.
> Would an example such as the above in the man page might help direct
> people toward the best way to do this?
> 
>            --- Keith

Did you also try the git mergetool man page (not that it's much
better!)?

The point of the custom mergetool patch was to make using a new,
previously unknown merge tool a 'simple' configuration exercise rather
than a patch or scripting exercise. At the time, an 'eval' approach
was the compromise between ease of implementation and preventing
environmental pollution.

It's not the most beautiful of solutions, especially since escaping
quotes and spaces in either .gitconfig or in a git config command line
of something that is later going to be expanded by the shell is
something of a mind bender.

An example in the documentation would be a really good idea - you are
not the first person to have asked about how to use the custom merge
tool feature. I'm feeling a little guilty about not adding my name to
the man page when I submitted the patch. It's not Ted's fault that the
custom merge tool section is badly explained; it's mine.

-- 
Charles Bailey
http://ccgi.hashpling.plus.com/blog/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux