External mergetool support

39 views
Skip to first unread message

Martin Geisler

unread,
Nov 19, 2016, 10:25:51 AM11/19/16
to ma...@googlegroups.com
Hi there,

Let me start by saying that discovering Magit has been great! I don't
know of a single tool that has had the same impact on my productivity
:-)

The only times were I have to drop back to a terminal and raw Git
commands is when I have merge conflicts. I then run "git mergetool" in
my terminal to have KDiff3 start on the files in question.

I haven't found a way to run an external mergetool from within Magit.
The manual page about conflicts doesn't mention anything about
external tools: https://magit.vc/manual/magit/Resolving-conflicts.html

Is there a keybinding I'm missing?

--
Martin Geisler

Noam Postavsky

unread,
Nov 19, 2016, 11:14:34 AM11/19/16
to Martin Geisler, Magit Maling list
On Sat, Nov 19, 2016 at 10:25 AM, Martin Geisler <mar...@geisler.net> wrote:
>
> The only times were I have to drop back to a terminal and raw Git
> commands is when I have merge conflicts. I then run "git mergetool" in
> my terminal to have KDiff3 start on the files in question.
>
> I haven't found a way to run an external mergetool from within Magit.
> The manual page about conflicts doesn't mention anything about
> external tools: https://magit.vc/manual/magit/Resolving-conflicts.html
>
> Is there a keybinding I'm missing?
>

Maybe `M-!' ;)

There's no special support in Magit for external tools (Real Emacsers
use ediff ;) ). Perhaps you could try putting something into
~/.gitconfig

Kyle Meyer

unread,
Nov 19, 2016, 11:14:51 AM11/19/16
to ma...@googlegroups.com
[I accidentally dropped the list in the reply. Resending.]

Martin Geisler <mar...@geisler.net> writes:

[...]

> The only times were I have to drop back to a terminal and raw Git
> commands is when I have merge conflicts. I then run "git mergetool" in
> my terminal to have KDiff3 start on the files in question.
>
> I haven't found a way to run an external mergetool from within Magit.
> The manual page about conflicts doesn't mention anything about
> external tools: https://magit.vc/manual/magit/Resolving-conflicts.html
>
> Is there a keybinding I'm missing?

No, I don't think there's currently a command or keybinding for "git
mergetool", though running ":mergetool" is a bit shorter than switching
to a shell. I suspect that most Magit users rely on some combination of
smerge and ediff (magit-ediff-resolve) to resolve conflicts within
Emacs, but I don't know. It may be worth mentioning git-mergetool here:
https://github.com/magit/magit/issues/2849.

--
Kyle

Kyle Meyer

unread,
Nov 19, 2016, 11:20:14 AM11/19/16
to Noam Postavsky, Martin Geisler, Magit Maling list
Noam Postavsky <npos...@gmail.com> writes:

[...]

> There's no special support in Magit for external tools (Real Emacsers
> use ediff ;) ).

No, smerge is all you need :)

--
Kyle

Gergely Polonkai

unread,
Nov 19, 2016, 12:53:01 PM11/19/16
to Kyle Meyer, Noam Postavsky, Martin Geisler, Magit Maling list

I’m an ediff fan, but was using meld for a long time. It’s not that hard :)

If running :mergetool is OK, maybe all you need is a command for mergetool. Probably with a dialog where you can select the actual tool.


--
You received this message because you are subscribed to the Google Groups "magit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to magit+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin Geisler

unread,
Nov 19, 2016, 1:10:41 PM11/19/16
to Noam Postavsky, Magit Maling list
On Sat, Nov 19, 2016 at 5:14 PM, Noam Postavsky <npos...@gmail.com> wrote:
> On Sat, Nov 19, 2016 at 10:25 AM, Martin Geisler <mar...@geisler.net> wrote:
>>
>> The only times were I have to drop back to a terminal and raw Git
>> commands is when I have merge conflicts. I then run "git mergetool" in
>> my terminal to have KDiff3 start on the files in question.
>>
>> I haven't found a way to run an external mergetool from within Magit.
>> The manual page about conflicts doesn't mention anything about
>> external tools: https://magit.vc/manual/magit/Resolving-conflicts.html
>>
>> Is there a keybinding I'm missing?
>>
>
> Maybe `M-!' ;)

Yeah, that would work :-D

> There's no special support in Magit for external tools (Real Emacsers
> use ediff ;) ). Perhaps you could try putting something into
> ~/.gitconfig

I already have KDiff3 configured as the default mergetool, so 'git
mergetool' is all I need to run to start the process. A Magit
interface for that could be very light-weight -- I guess it would
simply involve letting the user run the mergetool on some or all files
with conflicts.

--
Martin Geisler

Martin Geisler

unread,
Nov 19, 2016, 1:12:58 PM11/19/16
to Kyle Meyer, Magit Maling list
On Sat, Nov 19, 2016 at 5:14 PM, Kyle Meyer <ky...@kyleam.com> wrote:
> [I accidentally dropped the list in the reply. Resending.]
>
> Martin Geisler <mar...@geisler.net> writes:
>
> [...]
>
>> The only times were I have to drop back to a terminal and raw Git
>> commands is when I have merge conflicts. I then run "git mergetool" in
>> my terminal to have KDiff3 start on the files in question.
>>
>> I haven't found a way to run an external mergetool from within Magit.
>> The manual page about conflicts doesn't mention anything about
>> external tools: https://magit.vc/manual/magit/Resolving-conflicts.html
>>
>> Is there a keybinding I'm missing?
>
> No, I don't think there's currently a command or keybinding for "git
> mergetool", though running ":mergetool" is a bit shorter than switching
> to a shell.

Hey, that's cool! I didn't know about the ":" shortcut for starting
Git commands. I'll try that next time I have a conflict to resolve.

> I suspect that most Magit users rely on some combination of
> smerge and ediff (magit-ediff-resolve) to resolve conflicts within
> Emacs, but I don't know. It may be worth mentioning git-mergetool here:
> https://github.com/magit/magit/issues/2849.

Thanks, I've added it to the list!

--
Martin Geisler
Reply all
Reply to author
Forward
0 new messages