From: Charles Bailey <charles@hashpling.org>
To: Keith Amidon <keith@nicira.com>
Cc: git@vger.kernel.org
Subject: Re: How can a custom merge tool get access to file shell variables?
Date: Thu, 21 Aug 2008 23:15:24 +0100 [thread overview]
Message-ID: <20080821221524.GA25429@hashpling.org> (raw)
In-Reply-To: <1219170751.12921.27.camel@kea-nicira-lt.nicira.com>
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/
next prev parent reply other threads:[~2008-08-21 22:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-19 18:13 How can a custom merge tool get access to file shell variables? Keith Amidon
[not found] ` <1219170004.12921.19.camel@kea-nicira-lt.nicira.com>
2008-08-19 18:32 ` Keith Amidon
2008-08-21 22:15 ` Charles Bailey [this message]
2008-08-21 23:31 ` Keith Amidon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080821221524.GA25429@hashpling.org \
--to=charles@hashpling.org \
--cc=git@vger.kernel.org \
--cc=keith@nicira.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).