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

Re: What's in git.git (stable)

From
Theodore Tso <tytso@mit.edu>
Date
Jul 29, 2007, 16:40 UTC
Message-ID
<20070729164001.GA9597@thunk.org>
In-Reply-To
<85ir83zijd.fsf@lola.goethe.zz>
On Sun, Jul 29, 2007 at 11:05:42AM +0200, David Kastrup wrote:
Show 9 quoted lines
> Theodore Tso <tytso@mit.edu> writes:
> 
> > So I really am beginning to think the right answer is to give up on
> > using git-mergetool to support anything other than basic emacs users
> > (who just use emacs as an editor, what a concept),
> 
> In contrast, you are trying to support only people by using Emacs
> _not_ as an editor, but as a mergetool under the control of git.
> That's a mistake.

The whole *point* of git-mergetool is to automatically call merge tools so you can do three-way merges under the control of git.

If you just want an *editor* then you can just edit the files that are listed as being in conflict after a failed merge or after running "git status". You can do that today without using git-mergetool at all!

> Sorry, but you are way off here.  The normal, standard use of Emacs is
> to start it once and do everything in it.  Its startup time is such
> that other uses are not feasible.

Huh? The startup time of running emacs for me is well under a second (and I have a 20k ~/.emacs.el file that loads a number of other files). I'm sure if you put enough *crap* into your .emacs.el file, you can make it take a huge amount of time, but I suspect your idea of what is "normal" for emacs is more than a little skewed.

> So git's mergetool philosophy is currently _straight_ set against the
> way Emacs is designed to work.

So don't use git-mergetool. Like I said, I suspect the right answer is contrib/git-mergetool.el, and do everything inside emacs. If you are as extreme as someone who pulls in gazillions of emacs packages, and you are using emacs as a desktop, a shell, and a window manager, then you can probably do much better using a pure emacs lisp merge system.

Git mergetool is fundamentally designed to work with tools like meld, kdiff3, xxdiff, tkdiff, etc. These are all merge tools, and they work a certain way. They expect, and need, to be driven a certain way. If you insist on following a fundamentally different paradigm, then past a certain point git-mergetool is not going to make you happy no matter what I can do. The point is, git-mergetool does *need* to do know when you are done doing a merge, and it needs to know if you've decided to abandon a merge. Right now ediff doesn't fit well into that paradigm. And that's fundamentally ediff's fault; we can do some kludgery on the git-mergetool side, but the end result will always be unsatisfactory, and will require that the person using it to *know* that it is done.

I, personally, don't feel like trying to twist git-mergetool into doing the right thing depending on whether you have emacs21, emacs22, emacs23-snapshot, whether or not the desktop package is in use, whether or not the user is using emacsclient or not, yadda, yadda, yaddda. If you want to take a crack at doing *all* of that mess, and provide a complete solution, send me patches and I'll look at them.

I think it will add a huge amount of *crap* into git-mergetool in order to support all possible use cases (I'm not interesting in putting in hackery just for your favorite use case, if it causes other users to scratch their heads in befuddlement and confusion), but feel free to prove me wrong.

As someone who has used emacs for over two decades, and have written very sophisticated emacs lisp code during nearly all of those 21 years (1986--2007; my first use of emacs was on a Vax 750 running BSD 4.3 --- if you want to talk about emacs taking a long time to start up, I remember what it was like 20 years ago), I'm pretty well aware of what you can and can not do in emacs, and I think I can say with fairly good authority that for the amount of effort it would take to try to get git-mergetool to hack around all of these different cases, writing git-mergetool.el will probably be easier, and result in a cleaner, better integration with people who like to live their entire lives in a single emacs session.

					- Ted
Previous: David KastrupNext: Johannes Schindelin
Message 28 of 34 in “What's in git.git (stable)”
  1. Junio C HamanoMay 13, 2007
  2. Junio C HamanoMay 17, 2007
  3. Junio C HamanoMay 19, 2007
  4. Junio C HamanoMay 23, 2007
  5. Junio C HamanoMay 29, 2007
  6. Junio C HamanoJun 2, 2007
  7. Junio C HamanoJun 7, 2007
  8. Junio C HamanoJun 13, 2007
  9. Johannes SchindelinJun 13, 2007
  10. Johannes SixtJun 14, 2007
  11. Junio C HamanoJun 21, 2007
  12. Junio C HamanoJun 25, 2007
  13. Junio C HamanoJul 2, 2007
  14. What's in git.gitJunio C Hamano, Jul 13, 2007
  15. Draft release notes for v1.5.3, as of -rc1Junio C Hamano, Jul 13, 2007
  16. Sven VerdoolaegeJul 13, 2007
  17. Johannes SchindelinJul 14, 2007
  18. Junio C HamanoJul 14, 2007
  19. Johannes SchindelinJul 15, 2007
  20. Brian DowningJul 13, 2007
  21. Junio C HamanoJul 13, 2007
  22. Junio C HamanoJul 28, 2007
  23. David KastrupJul 28, 2007
  24. Junio C HamanoJul 28, 2007
  25. David KastrupJul 28, 2007
  26. Theodore TsoJul 29, 2007
  27. David KastrupJul 29, 2007
  28. Theodore TsoJul 29, 2007
  29. Johannes SchindelinJul 29, 2007
  30. [Untested! proposal] git-mergetool.sh: introduce ediff optionDavid Kastrup, Jul 29, 2007
  31. Theodore TsoJul 29, 2007
  32. David KastrupJul 29, 2007
  33. Thomas GlanzmannJul 28, 2007
  34. Junio C HamanoAug 7, 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.