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

Re: [PATCH] git-mergetool: add support for ediff

From
Theodore Tso <tytso@mit.edu>
Date
Jul 2, 2007, 21:58 UTC
Message-ID
<20070702215859.GA20597@thunk.org>
In-Reply-To
<46896EF2.70006@vilain.net>
On Tue, Jul 03, 2007 at 09:32:34AM +1200, Sam Vilain wrote:
Show 13 quoted lines
> > Unfortunately, it's not enough.  Ediff doesn't have an "abort" command
> > which returns a non-zero exit status, and when you use the "quit"
> > command, it asks you a series of obnoxious questions:
> > 
> > Quit this Ediff session? (y or n)
> > File /usr/projects/git/test/testfile.c exists, overwrite? (y or n)
> > Merge buffer saved in /usr/projects/git/test/testfile.c
> > <delay for 3 annoying seconds>
> > Merge buffer saved.  Now kill the buffer? (y or n)
> 
> Yeah, I normally just save the merged buffer and quit.  This skips all that.
> 
> But I will add your little snippet to my .emacs :)

You probably don't want to just add that snippet to your .emacs, since it changes the ediff 'quit' command to always cause emacs to immediately exit, and that's probably not the right thing if you are starting ediff from an emacs session.

The correct fix would involve stealing code from emerge's emerge-merge-files-command function to parse the arguments from the command-line --- and in fact, probably the simplest way of fixing things for folks would be to write replacement emerge-*-command functions which call ediff after patching the ediff hooks in the emacs-lisp fragment I sent above.

In fact, maybe that's the right approach. I don't think we want to ship emacs lisp files which git-mergetool depends upon, but what if we instead ship some emacs lisp code in the contrib directory which a user could slip into their .emacs file which replaces the two emerge-*-command functions which ones that call ediff instead?

That way we don't have all of this complexity added into git-mergetool.
		 	   	      	   - Ted
Previous: Sam VilainNext: Theodore Tso
Message 11 of 18 in “git-mergetool: add support for ediff”
  1. git-mergetool: add support for ediffSam Vilain, Jun 29, 2007
  2. Jason SewallJun 29, 2007
  3. Theodore TsoJun 29, 2007
  4. Theodore TsoJul 2, 2007
  5. Junio C HamanoJul 2, 2007
  6. Theodore TsoJul 2, 2007
  7. Junio C HamanoJul 2, 2007
  8. Theodore TsoJul 2, 2007
  9. Junio C HamanoJul 2, 2007
  10. Sam VilainJul 2, 2007
  11. Theodore TsoJul 2, 2007
  12. Theodore TsoJul 2, 2007
  13. Sam VilainJul 2, 2007
  14. Theodore TsoJul 3, 2007
  15. Sam VilainJul 3, 2007
  16. David KastrupJul 28, 2007
  17. Theodore TsoJul 29, 2007
  18. David KastrupJul 29, 2007

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.