* git mergetool
@ 2008-05-17 17:21 Evgeny
2008-05-17 20:21 ` Jakub Narebski
0 siblings, 1 reply; 4+ messages in thread
From: Evgeny @ 2008-05-17 17:21 UTC (permalink / raw)
To: git, tytso
Hello Git developers,
and especially Theodore (whos email is in the footer of man git-mergetool)
Background:
I am trying to use a custom mergetool with git.
P4Merge from http://www.perforce.com/perforce/products/merge.html
The documentation explains that environment variables $BASE,
$LOCAL, $REMOTE, $MERGED
are set for the invocation of the mergetool command.
Problem:
I wrote a wrapper for P4Merge, and I check for these environment
variables - but they are not there.
After a closer inspection of git-mergetool I see that infact these
variables are not being sent to the
external command at all, and are just in the context of the
git-mergetool script.
Solution:
There are two ways, that i know of, to make the executed command
receive these variables :
1. use "export" on them
2. use "env LOCAL=$LOCAL env REMOTE=$REMOTE .... $extcommand" to
set an environment for just that command
My System Information:
git 1.5.5.1 (from macports)
Mac OS X 10.5.2
Hopefully this will get fixed in future versions, so I wont need to
patch git-mergetool locally on my machine with every update.
Regards,
Evgeny
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git mergetool
2008-05-17 17:21 git mergetool Evgeny
@ 2008-05-17 20:21 ` Jakub Narebski
2008-05-17 20:47 ` David Aguilar
0 siblings, 1 reply; 4+ messages in thread
From: Jakub Narebski @ 2008-05-17 20:21 UTC (permalink / raw)
To: Evgeny; +Cc: git, tytso
Evgeny <evgeny.zislis@gmail.com> writes:
> Background:
> I am trying to use a custom mergetool with git.
> P4Merge from http://www.perforce.com/perforce/products/merge.html
>
> The documentation explains that environment variables
> $BASE, $LOCAL, $REMOTE, $MERGED
> are set for the invocation of the mergetool command.
>
> Problem:
> I wrote a wrapper for P4Merge, and I check for these environment
> variables - but they are not there. After a closer inspection
> of git-mergetool I see that infact these variables are not being
> sent to the external command at all, and are just in the context
> of the git-mergetool script.
>From what I know of git-mergetool, you can use one of the predefined
merge tools: kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff,
ecmerge, and opendiff (optionally providing path to the tool)
To add support for P4Merge you would have either modify
git-mergetool.sh (and, optionally, send a patch to git mailing list),
or make use of `mergetool.<tool>.cmd` configuration option.
Unfortunately there is no example...
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git mergetool
2008-05-17 20:21 ` Jakub Narebski
@ 2008-05-17 20:47 ` David Aguilar
2008-05-17 21:32 ` Evgeny
0 siblings, 1 reply; 4+ messages in thread
From: David Aguilar @ 2008-05-17 20:47 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Evgeny, git, tytso
On Sat, May 17, 2008 at 1:21 PM, Jakub Narebski <jnareb@gmail.com> wrote:
> Evgeny <evgeny.zislis@gmail.com> writes:
>
>> Background:
>> I am trying to use a custom mergetool with git.
>> The documentation explains that environment variables
>> $BASE, $LOCAL, $REMOTE, $MERGED
>> are set for the invocation of the mergetool command.
>>
>> Problem:
>> I wrote a wrapper for P4Merge, and I check for these environment
>> variables - but they are not there. After a closer inspection
>> of git-mergetool I see that infact these variables are not being
>> sent to the external command at all, and are just in the context
>> of the git-mergetool script.
>
> From what I know of git-mergetool, you can use one of the predefined
> merge tools: kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff,
> ecmerge, and opendiff (optionally providing path to the tool)
>
> To add support for P4Merge you would have either modify
> git-mergetool.sh (and, optionally, send a patch to git mailing list),
> or make use of `mergetool.<tool>.cmd` configuration option.
> Unfortunately there is no example...
>
> --
> Jakub Narebski
> Poland
> ShadeHawk on #git
I just sent a patch that exports these variables.
Presumably we do not want to modify git-mergetool.sh every single time
someone needs to be able to use a new mergetool, hence the patch I
sent makes sense to me. Let me know if you think otherwise.
Thanks,
--
David
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git mergetool
2008-05-17 20:47 ` David Aguilar
@ 2008-05-17 21:32 ` Evgeny
0 siblings, 0 replies; 4+ messages in thread
From: Evgeny @ 2008-05-17 21:32 UTC (permalink / raw)
To: David Aguilar; +Cc: Jakub Narebski, git, tytso
I was in fact using mergetool.p4merge.cmd ... and the documentation explains
regarding the non-working environment variables.
Hopefully with the new patch it will work okay.
Thanks David!
--
Evgeny
On Sat, May 17, 2008 at 11:47 PM, David Aguilar <davvid@gmail.com> wrote:
> On Sat, May 17, 2008 at 1:21 PM, Jakub Narebski <jnareb@gmail.com> wrote:
>> Evgeny <evgeny.zislis@gmail.com> writes:
>>
>>> Background:
>>> I am trying to use a custom mergetool with git.
>>> The documentation explains that environment variables
>>> $BASE, $LOCAL, $REMOTE, $MERGED
>>> are set for the invocation of the mergetool command.
>>>
>>> Problem:
>>> I wrote a wrapper for P4Merge, and I check for these environment
>>> variables - but they are not there. After a closer inspection
>>> of git-mergetool I see that infact these variables are not being
>>> sent to the external command at all, and are just in the context
>>> of the git-mergetool script.
>>
>> From what I know of git-mergetool, you can use one of the predefined
>> merge tools: kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff,
>> ecmerge, and opendiff (optionally providing path to the tool)
>>
>> To add support for P4Merge you would have either modify
>> git-mergetool.sh (and, optionally, send a patch to git mailing list),
>> or make use of `mergetool.<tool>.cmd` configuration option.
>> Unfortunately there is no example...
>>
>> --
>> Jakub Narebski
>> Poland
>> ShadeHawk on #git
>
> I just sent a patch that exports these variables.
>
> Presumably we do not want to modify git-mergetool.sh every single time
> someone needs to be able to use a new mergetool, hence the patch I
> sent makes sense to me. Let me know if you think otherwise.
> Thanks,
> --
> David
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-05-17 21:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-17 17:21 git mergetool Evgeny
2008-05-17 20:21 ` Jakub Narebski
2008-05-17 20:47 ` David Aguilar
2008-05-17 21:32 ` Evgeny
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).