git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] mergetool: export variables for use by custom mergetools

From
Charles Bailey <charles@hashpling.org>
Date
May 17, 2008, 23:34 UTC
Message-ID
<20080517233414.GA28196@hashpling.org>
In-Reply-To
<8b4e944ac849029f31f403ab75198ed6fb4197c1.1211056369.git.davvid@gmail.com>
On Sat, May 17, 2008 at 01:39:26PM -0700, David Aguilar wrote:
Show 10 quoted lines
> The MERGED, BACKUP, LOCAL, REMOTE and BASE variables were not being
> exported from the git-mergetool.sh script.  This prevented custom
> mergetools from being able to use them.
> 
> We now export them so that arbitrary mergetools can easily interact
> with git mergetool.
> 
> This problem was Reported-By: Evgeny <evgeny.zislis@gmail.com>
> 
> Signed-off-by: David Aguilar <davvid@gmail.com>

I think there must be a misunderstanding here. The variables are not designed to be exported. The point of the custom merge tool patch to git mergetool was to support custom mergetools without the need for a wrapper script, just a git config variable.

I know that (with the right config) git mergetool supports p4merge as it is one of a selection of tools that I tested it with. You should be able to get p4 merge to work by setting the config variable:

mergetool.p4merge.cmd
to the value (IIRC, and I don't have the p4merge documentation to hand):
p4merge "$BASE" "$REMOTE" "$LOCAL" "$MERGED"

Getting the quoting correct on this depends on whether you set it via commandline or via editing a git config file and can be a little tricky.

If you have a wrapper shell script then you can easily pass these as positional parameters and re-export them as necessary.

-- 
Charles Bailey
http://ccgi.hashpling.plus.com/blog/
Previous: David AguilarNext: Evgeny
Message 2 of 5 in “mergetool: export variables for use by custom mergetools”
  1. mergetool: export variables for use by custom mergetoolsDavid Aguilar, May 17, 2008
  2. Charles BaileyMay 17, 2008
  3. EvgenyMay 17, 2008
  4. Charles BaileyMay 18, 2008
  5. EvgenyMay 18, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.