{"thread":{"id":"28500","subject":"emacs as mergetool","startedAt":"2011-09-26T16:21:27Z","lastAt":"2011-09-28T17:03:47Z","messageCount":4,"participants":["Thomas Koch","Rémi Vanicat","Vijay Lakshminarayanan","Nick"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"176230","messageId":"201109261821.28382.thomas@koch.ro","threadId":"28500","inReplyTo":null,"subject":"emacs as mergetool","fromName":"Thomas Koch","fromEmail":"thomas@koch.ro","sentAt":"2011-09-26T16:21:27Z","receivedAt":"2011-09-26T16:21:27Z","isPatch":false,"sender":{"key":"thomas@koch.ro","avatar":null},"body":"Hi,\n\nwould you be so kind and give an emacs newbie (and vim refugee) a hint about \nusing emacs as mergetool?\n\n- Which one? ediff vs. emerge (I don't bother learning, just give me the best)\n- I'd like to have a setup, where I can run mergetool with different options \nto\n  - connect to a running emacs server\n  - run emacs in X\n  - or in the terminal (default)\n- Is it possible to resolve all conflicting files in one session instead of \nhaving emacs called again for every file?\n- Do you know a tutorial on emacs as a mergetool?\n\nThank you,\n\nThomas Koch, http://www.koch.ro\n"},{"id":"176233","messageId":"87ty7zjjqd.dlv@debian.org","threadId":"28500","inReplyTo":"201109261821.28382.thomas@koch.ro","subject":"Re: emacs as mergetool","fromName":"Rémi Vanicat","fromEmail":"vanicat@debian.org","sentAt":"2011-09-26T17:28:58Z","receivedAt":"2011-09-26T17:28:58Z","isPatch":false,"sender":{"key":"vanicat@debian.org","avatar":"https://gravatar.com/avatar/cd491a7f4c221349809a60f88fc21326b97cce2a705e318898aa74851db92409?d=mp&s=160"},"body":"Thomas Koch <thomas@koch.ro> writes:\n\n> Hi,\n>\n> would you be so kind and give an emacs newbie (and vim refugee) a hint about \n> using emacs as mergetool?\n\nIn fact, I use magit like that: after the merge, if there was a\nconflict, I launch magit (M-x magit) and go on the unmerged file, then I\nuse \"e\" (magit-ediff) to merge them. ediff merge tool is self\ndocumented, and I never needed more than its documentation.\n\nOf course for this you need to install magit, and you don't really use\nEmacs as mergetool...\n\n-- \nRémi Vanicat\n"},{"id":"176380","messageId":"87d3elfh4c.fsf@gmail.com","threadId":"28500","inReplyTo":"201109261821.28382.thomas@koch.ro","subject":"Re: emacs as mergetool","fromName":"Vijay Lakshminarayanan","fromEmail":"laksvij@gmail.com","sentAt":"2011-09-28T04:03:31Z","receivedAt":"2011-09-28T04:03:31Z","isPatch":false,"sender":{"key":"laksvij@gmail.com","avatar":null},"body":"Thomas Koch <thomas@koch.ro> writes:\n\n> Hi,\n>\n> would you be so kind and give an emacs newbie (and vim refugee) a hint about \n> using emacs as mergetool?\n>\n> - Which one? ediff vs. emerge (I don't bother learning, just give me the best)\n> - I'd like to have a setup, where I can run mergetool with different options \n> to\n>   - connect to a running emacs server\n>   - run emacs in X\n>   - or in the terminal (default)\n> - Is it possible to resolve all conflicting files in one session instead of \n> having emacs called again for every file?\n> - Do you know a tutorial on emacs as a mergetool?\n\nhttp://www.emacswiki.org/emacs/EmergeDiff works for me.\n\n> Thank you,\n>\n> Thomas Koch, http://www.koch.ro\n\n-- \nCheers\n~vijay\n"},{"id":"176442","messageId":"4E835373.1070006@letterboxes.org","threadId":"28500","inReplyTo":"201109261821.28382.thomas@koch.ro","subject":"Re: emacs as mergetool","fromName":"Nick","fromEmail":"oinksocket@letterboxes.org","sentAt":"2011-09-28T17:03:47Z","receivedAt":"2011-09-28T17:03:47Z","isPatch":false,"sender":{"key":"oinksocket@letterboxes.org","avatar":null},"body":"On 26/09/11 17:21, Thomas Koch wrote:\n> would you be so kind and give an emacs newbie (and vim refugee) a hint about \n> using emacs as mergetool?\n> \n> - Which one? ediff vs. emerge (I don't bother learning, just give me the best)\n\nI tend to use git.el - which provides the M-x git-status command - and therefore\nediff.  It's not necessarily the best git interface, but I've been too lazy\nlearn anything else so far.  git-status allows you to do basic git\nadding/committing etc. and will show modification diffs.\n\nGiven a git-status buffer, a conflicted merge will show up with certain files in\nred.  You can then view the conflicted versions side-by-side positioning the\ncursor over the conflicted file, and using the key-sequence 'd E' to start\ninteractive merges in ediff mode.  Afterwards you have to save the buffers and\nmark the file as 'resolved' in git-status ('r').\n\nThere are other things you can do in a git-status buffer. M-x describe-mode (C-h\nm) and M-x describe-bindings (C-h b) will provide some idea.\n\n> - I'd like to have a setup, where I can run mergetool with different options \n> to\n>   - connect to a running emacs server\n>   - run emacs in X\n>   - or in the terminal (default)\n\ngit-status works with all the above.  I don't use git-mergetool at all.\n\nTo keep things in one emacs session I sometimes use git directly in emacs shell\nbuffers. i.e.\n\n - Run emacs\n - Open the repo in dired: M-x find-file <path to your git repo>\n - Invoke git-status:      M-x git-status\n - (do stuff)\n - Open a shell            M-x shell, M-x eshell, or M-x ansi-term\n - (do more stuff)\n\n> - Is it possible to resolve all conflicting files in one session instead of\n> having emacs called again for every file?\n\nAs I said, I don't use git-mergetool, but git-status should allow most basic\nthings in fairly straightforward way. For anything more complicated (e.g. git\ncommit --amend, or git add --interactive) I open an shell in emacs.\n\nIf you tell git to use emacsclient as the editor, and then git commit and co.\nwill open an emacs buffer so you can invoke git from the command line without\nleaving your emacs session.  To do this:\n\n - invoke: git config --global core.editor emacsclient\n - in emacs: M-x server-start\n   (or add \"(server-start)\" to your ~/.emacs file)\n\nAt some point I might check out magit. I'd be interested to hear about\ncomparisons between git.el and the alternatives.\n\nCheers,\n\nN\n"}]}