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

Re: whither merge-tree?

From
Jeff King <peff@peff.net>
Date
Feb 23, 2016, 05:14 UTC
Message-ID
<20160223051402.GA23375@sigill.intra.peff.net>
In-Reply-To
<20160223050210.GA17767@sigill.intra.peff.net>
On Tue, Feb 23, 2016 at 12:02:10AM -0500, Jeff King wrote:
Show 13 quoted lines
> > git-merge-resolve (rather, git-merge-one-file) attempts the same
> > "resolve add/add by taking the common" thing, but it implements it
> > in quite a different way.
> 
> I suppose the end result of what merge-tree is trying to do makes sense.
> It's definitely a conflict, but we are interested in showing the minimal
> content-level conflict. But I think xdl_merge() takes care of that for
> us, if we simply feed an empty base. And that is what merge-recursive
> does.
> 
> I do see that merge-one-file tries create_virtual_base(), which does
> some magic with diff. But I'm having trouble conceiving of a case where
> that would do something different or useful.

I dug this all the way down to your cb93c19 (merge-one-file: use common as base, instead of emptiness., 2005-11-09), which states that the goal is just to get:

	common file contents...
	<<<<<< FILENAME
	version from our branch...
	======
	version from their branch...
	>>>>>> .merge_file_XXXXXX
	more common file contents...

But that seems to be what we produce now. Did all of this simply predate xdl_merge, and the crappy rcs merge did not bother minimizing the diff? That certainly seems to be the case in my tests.

If that is the case, I think we can get rid of the complex create_virtual_base(), as well.

-Peff
Previous: Jeff KingNext: Jeff King
Message 7 of 19 in “What's cooking in git.git (Feb 2016, #05; Wed, 17)”
  1. Junio C HamanoFeb 17, 2016
  2. Jeff KingFeb 17, 2016
  3. Junio C HamanoFeb 18, 2016
  4. whither merge-tree? (was: What's cooking in git.git (Feb 2016, #05; Wed, 17))Jeff King, Feb 22, 2016
  5. Junio C HamanoFeb 22, 2016
  6. Jeff KingFeb 23, 2016
  7. Jeff KingFeb 23, 2016
  8. Jeff KingFeb 23, 2016
  9. 1/3 merge-one-file: use empty blob for add/add baseJeff King, Feb 23, 2016
  10. 2/3 merge-tree: drop generate_common strategyJeff King, Feb 23, 2016
  11. 3/3 xdiff: drop XDL_EMIT_COMMONJeff King, Feb 23, 2016
  12. Junio C HamanoFeb 23, 2016
  13. Jeff KingFeb 23, 2016
  14. Stefan FrühwirthFeb 23, 2016
  15. Dennis KaarsemakerFeb 24, 2016
  16. Jeff KingFeb 24, 2016
  17. Jeff KingFeb 24, 2016
  18. Johannes SchindelinFeb 23, 2016
  19. Duy NguyenFeb 23, 2016

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.