{"thread":{"id":"39423","subject":"Implementing git-am -3 with git-apply -3?","startedAt":"2015-05-26T02:49:47Z","lastAt":"2015-05-26T03:29:21Z","messageCount":2,"participants":["Paul Tan","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"262109","messageId":"CACRoPnQWAYPsVVP_ycjBgPVSM_Orx7QmJc96zL5ixRuqi=V_eg@mail.gmail.com","threadId":"39423","inReplyTo":null,"subject":"Implementing git-am -3 with git-apply -3?","fromName":"Paul Tan","fromEmail":"pyokagan@gmail.com","sentAt":"2015-05-26T02:49:47Z","receivedAt":"2015-05-26T02:49:47Z","isPatch":false,"sender":{"key":"pyokagan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/109479?v=4"},"body":"Hi Junio,\n\nI noticed that you implemented a 3-way merge fallback[1] in git-apply\nthat is meant to be similar to git-am's.\n\nI wonder if it is possible to implement the 3-way merge in git-am\nusing git-apply. Are there any issues/deficiencies that I need to be\naware of?\n\nSo far, I noticed that:\n\n* git-apply does not handle renames in the index.\n\n* It could probably try harder at merging submodules (perhaps by using\nmerge_submodule()?)\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/201238\n\nThanks,\nPaul\n"},{"id":"262111","messageId":"xmqqsiak819q.fsf@gitster.dls.corp.google.com","threadId":"39423","inReplyTo":"CACRoPnQWAYPsVVP_ycjBgPVSM_Orx7QmJc96zL5ixRuqi=V_eg@mail.gmail.com","subject":"Re: Implementing git-am -3 with git-apply -3?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-26T03:29:21Z","receivedAt":"2015-05-26T03:29:21Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Paul Tan <pyokagan@gmail.com> writes:\n\n> I wonder if it is possible to implement the 3-way merge in git-am\n> using git-apply. Are there any issues/deficiencies that I need to be\n> aware of?\n\nAnything is possible ;-)\n\nEven though I suspect it might be of significant complexity, it\ncertainly would be nice if \"apply -3\" could be taught to do\neverything \"am -3\" would do.\n\n> * git-apply does not handle renames in the index.\n\nTrue.  The patch application does not really have a global picture,\nand that is one of the reasons why I foresee significant complexity\nas I said above.  The three-way merge with synthesized virtual base\ntree done in \"am -3\" makes use of established and independent\ncomponent that is merge-recursive, and that makes things easier and\nkeeps things cleaner.\n\n> * It could probably try harder at merging submodules (perhaps by using\n> merge_submodule()?)\n\nI am not sure what you mean.  I thought it punts what \"am -3\" would\npunt on, and handles what \"am -3\" would handle.\n"}]}