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

Re: [PATCH] xdl_merge(): fix and simplify conflict handling

From
Junio C Hamano <junkio@cox.net>
Date
Dec 5, 2006, 22:54 UTC
Message-ID
<7v3b7ueyxc.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0612052320320.28348@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Speaking about a builtin merge: I like the fact that git-apply also works 
> outside of git repositories. It makes life easier to have a sane patcher 
> around.

Well, git-apply is designed as a better "patch", so it is natural that it works in a non-git directory [*1*].

I am not sure what you mean by a builtin merge that works outside the context of git. Do you mean a pure RCS merge replacement that takes three files and spits out the result in one of them? If so that would probably deserve to be a separate command, because I do not think of a use for such a thing inside git. We've done merge-recursive.c already so it would not need an external 'merge'. If somebody is so inclined to to do the "merge-resolve" strategy, I think the right way is to make a single program that does what git-merge-index and merge-one-file does without fork nor exec, so it would not need an external 'merge' either.

> Now, I'd like the same with git-diff, and an RCS merge replacement...

Yes, back when I was actively hacking git-diff, I dreamt about a variant that takes two or more (non-git managed) directories and does an equivalent of diff-tree with -M/-C/.../-c/--cc. It would be cool and useful.

I understand your aversion to new commands, but I do not think you can avoid it if what you mean is an RCS merge replacement.

The diff that works on "two or more directories without anything git" could be just a new option to "git diff", though.

But I am not going to do it myself; it's usually a lot faster for me to just do "git init-db; git add . " on an extracted tarball.

[Footnote]

*1* ... and that is one of the reasons why it does not even try to read the index unless it is told to do so.

And we should not make it "detect we are in git repository" and default to --index either. Often running without --index is useful inside a git repository. I would say roughly 50% of the time I use the command with --index and the rest without, so "more often" argument unfortunately does not apply to "apply".

I wish it were "2% without --index, 98% with --index". Then we could easily say "add '--no-index if you do not want to".

Previous: Johannes SchindelinNext: Jakub Narebski
Message 24 of 32 in “Resolving conflicts”
  1. Wink SavilleDec 1, 2006
  2. Alan ChandlerDec 1, 2006
  3. Wink SavilleDec 1, 2006
  4. Alan ChandlerDec 1, 2006
  5. Linus TorvaldsDec 1, 2006
  6. Wink SavilleDec 1, 2006
  7. Linus TorvaldsDec 1, 2006
  8. Linus TorvaldsDec 1, 2006
  9. Alan ChandlerDec 1, 2006
  10. Wink SavilleDec 1, 2006
  11. Alan ChandlerDec 1, 2006
  12. Wink SavilleDec 2, 2006
  13. Linus TorvaldsDec 2, 2006
  14. Junio C HamanoDec 2, 2006
  15. using xdl_merge(), was Re: Resolving conflictsJohannes Schindelin, Dec 2, 2006
  16. Ramsay JonesDec 5, 2006
  17. Linus TorvaldsDec 5, 2006
  18. Junio C HamanoDec 5, 2006
  19. Johannes SchindelinDec 5, 2006
  20. Junio C HamanoDec 5, 2006
  21. xdl_merge(): fix and simplify conflict handlingJohannes Schindelin, Dec 5, 2006
  22. Junio C HamanoDec 5, 2006
  23. Johannes SchindelinDec 5, 2006
  24. Junio C HamanoDec 5, 2006
  25. Jakub NarebskiDec 5, 2006
  26. Johannes SchindelinDec 5, 2006
  27. Junio C HamanoDec 6, 2006
  28. Johannes SchindelinDec 6, 2006
  29. Junio C HamanoDec 6, 2006
  30. Johannes SchindelinDec 6, 2006
  31. Johannes SchindelinDec 5, 2006
  32. Linus TorvaldsDec 1, 2006

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.