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

Re: Implementing git-am -3 with git-apply -3?

From
Junio C Hamano <gitster@pobox.com>
Date
May 26, 2015, 03:29 UTC
Message-ID
<xmqqsiak819q.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CACRoPnQWAYPsVVP_ycjBgPVSM_Orx7QmJc96zL5ixRuqi=V_eg@mail.gmail.com>
Paul Tan <pyokagan@gmail.com> writes:
> I wonder if it is possible to implement the 3-way merge in git-am
> using git-apply. Are there any issues/deficiencies that I need to be
> aware of?
Anything is possible ;-)

Even though I suspect it might be of significant complexity, it certainly would be nice if "apply -3" could be taught to do everything "am -3" would do.

> * git-apply does not handle renames in the index.

True. The patch application does not really have a global picture, and that is one of the reasons why I foresee significant complexity as I said above. The three-way merge with synthesized virtual base tree done in "am -3" makes use of established and independent component that is merge-recursive, and that makes things easier and keeps things cleaner.

> * It could probably try harder at merging submodules (perhaps by using
> merge_submodule()?)

I am not sure what you mean. I thought it punts what "am -3" would punt on, and handles what "am -3" would handle.

Previous: Paul Tan
Message 2 of 2 in “Implementing git-am -3 with git-apply -3?”
  1. Paul TanMay 26, 2015
  2. Junio C HamanoMay 26, 2015

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.