All of lore.kernel.org
 help / color / mirror / Atom feed
* emacs as mergetool
@ 2011-09-26 16:21 Thomas Koch
  2011-09-26 17:28 ` Rémi Vanicat
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Koch @ 2011-09-26 16:21 UTC (permalink / raw)
  To: git

Hi,

would you be so kind and give an emacs newbie (and vim refugee) a hint about 
using emacs as mergetool?

- Which one? ediff vs. emerge (I don't bother learning, just give me the best)
- I'd like to have a setup, where I can run mergetool with different options 
to
  - connect to a running emacs server
  - run emacs in X
  - or in the terminal (default)
- Is it possible to resolve all conflicting files in one session instead of 
having emacs called again for every file?
- Do you know a tutorial on emacs as a mergetool?

Thank you,

Thomas Koch, http://www.koch.ro

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: emacs as mergetool
  2011-09-26 16:21 emacs as mergetool Thomas Koch
@ 2011-09-26 17:28 ` Rémi Vanicat
  2011-09-28  4:03 ` Vijay Lakshminarayanan
  2011-09-28 17:03 ` Nick
  2 siblings, 0 replies; 4+ messages in thread
From: Rémi Vanicat @ 2011-09-26 17:28 UTC (permalink / raw)
  To: git

Thomas Koch <thomas@koch.ro> writes:

> Hi,
>
> would you be so kind and give an emacs newbie (and vim refugee) a hint about 
> using emacs as mergetool?

In fact, I use magit like that: after the merge, if there was a
conflict, I launch magit (M-x magit) and go on the unmerged file, then I
use "e" (magit-ediff) to merge them. ediff merge tool is self
documented, and I never needed more than its documentation.

Of course for this you need to install magit, and you don't really use
Emacs as mergetool...

-- 
Rémi Vanicat

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: emacs as mergetool
  2011-09-26 16:21 emacs as mergetool Thomas Koch
  2011-09-26 17:28 ` Rémi Vanicat
@ 2011-09-28  4:03 ` Vijay Lakshminarayanan
  2011-09-28 17:03 ` Nick
  2 siblings, 0 replies; 4+ messages in thread
From: Vijay Lakshminarayanan @ 2011-09-28  4:03 UTC (permalink / raw)
  To: thomas; +Cc: git

Thomas Koch <thomas@koch.ro> writes:

> Hi,
>
> would you be so kind and give an emacs newbie (and vim refugee) a hint about 
> using emacs as mergetool?
>
> - Which one? ediff vs. emerge (I don't bother learning, just give me the best)
> - I'd like to have a setup, where I can run mergetool with different options 
> to
>   - connect to a running emacs server
>   - run emacs in X
>   - or in the terminal (default)
> - Is it possible to resolve all conflicting files in one session instead of 
> having emacs called again for every file?
> - Do you know a tutorial on emacs as a mergetool?

http://www.emacswiki.org/emacs/EmergeDiff works for me.

> Thank you,
>
> Thomas Koch, http://www.koch.ro

-- 
Cheers
~vijay

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: emacs as mergetool
  2011-09-26 16:21 emacs as mergetool Thomas Koch
  2011-09-26 17:28 ` Rémi Vanicat
  2011-09-28  4:03 ` Vijay Lakshminarayanan
@ 2011-09-28 17:03 ` Nick
  2 siblings, 0 replies; 4+ messages in thread
From: Nick @ 2011-09-28 17:03 UTC (permalink / raw)
  To: git; +Cc: thomas

On 26/09/11 17:21, Thomas Koch wrote:
> would you be so kind and give an emacs newbie (and vim refugee) a hint about 
> using emacs as mergetool?
> 
> - Which one? ediff vs. emerge (I don't bother learning, just give me the best)

I tend to use git.el - which provides the M-x git-status command - and therefore
ediff.  It's not necessarily the best git interface, but I've been too lazy
learn anything else so far.  git-status allows you to do basic git
adding/committing etc. and will show modification diffs.

Given a git-status buffer, a conflicted merge will show up with certain files in
red.  You can then view the conflicted versions side-by-side positioning the
cursor over the conflicted file, and using the key-sequence 'd E' to start
interactive merges in ediff mode.  Afterwards you have to save the buffers and
mark the file as 'resolved' in git-status ('r').

There are other things you can do in a git-status buffer. M-x describe-mode (C-h
m) and M-x describe-bindings (C-h b) will provide some idea.

> - I'd like to have a setup, where I can run mergetool with different options 
> to
>   - connect to a running emacs server
>   - run emacs in X
>   - or in the terminal (default)

git-status works with all the above.  I don't use git-mergetool at all.

To keep things in one emacs session I sometimes use git directly in emacs shell
buffers. i.e.

 - Run emacs
 - Open the repo in dired: M-x find-file <path to your git repo>
 - Invoke git-status:      M-x git-status
 - (do stuff)
 - Open a shell            M-x shell, M-x eshell, or M-x ansi-term
 - (do more stuff)

> - Is it possible to resolve all conflicting files in one session instead of
> having emacs called again for every file?

As I said, I don't use git-mergetool, but git-status should allow most basic
things in fairly straightforward way. For anything more complicated (e.g. git
commit --amend, or git add --interactive) I open an shell in emacs.

If you tell git to use emacsclient as the editor, and then git commit and co.
will open an emacs buffer so you can invoke git from the command line without
leaving your emacs session.  To do this:

 - invoke: git config --global core.editor emacsclient
 - in emacs: M-x server-start
   (or add "(server-start)" to your ~/.emacs file)

At some point I might check out magit. I'd be interested to hear about
comparisons between git.el and the alternatives.

Cheers,

N

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-28 17:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-26 16:21 emacs as mergetool Thomas Koch
2011-09-26 17:28 ` Rémi Vanicat
2011-09-28  4:03 ` Vijay Lakshminarayanan
2011-09-28 17:03 ` Nick

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.