threads / discuss / 39423

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

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

## tl;dr

2 messages between May 26, 2015 and May 26, 2015.

replies: 1people: 2as markdown or json

Paul Tan· May 26, 2015, 02:49 UTC · lore
Hi Junio,

I noticed that you implemented a 3-way merge fallback[1] in git-apply that is meant to be similar to git-am's.

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?

So far, I noticed that:
* git-apply does not handle renames in the index.
* It could probably try harder at merging submodules (perhaps by using
merge_submodule()?)
[1] http://thread.gmane.org/gmane.comp.version-control.git/201238

Thanks, Paul

Junio C Hamano· May 26, 2015, 03:29 UTC · re: Paul Tan · lore

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

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.

← back to recent threads