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

Re: Why `git am -3` apply patches that don't normally apply?

From
Yuri Kanivetsky <yuri.kanivetsky@gmail.com>
Date
Jul 6, 2022, 00:19 UTC
Message-ID
<CAMhVC3b+ByoxRn1o1WDvb3Rk07j_YQu9bd4w+STAgzNqkxK5ig@mail.gmail.com>
In-Reply-To
<xmqqmtdnjut5.fsf@gitster.g>

Yep, thanks for the detailed explanations. It let me improve my answer on Stack Overflow:

https://stackoverflow.com/questions/25846189/git-am-error-patch-does-not-apply/72797965#72797965

Although... it'll unlikely receive a lot of views :( But whatever, it can't be helped.

Regards, Yuri

On Tue, Jul 5, 2022 at 9:09 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
>
> Elijah Newren <newren@gmail.com> writes:
>
> > As per the documentation of -3:
> >
> >         When the patch does not apply cleanly, fall back on
> >         3-way merge if the patch records the identity of blobs
> >         it is supposed to apply to and we have those blobs
> >         available locally.
>
> I suspect that we would need to update this part, as the order of
> "fall back" was swapped sometime in the recent past (and we have
> fixed a few bugs that were introduced as fallouts).
>
> Your description on how -3 works when it does the three-way based on
> the concrete example was very clear and easy to understand, by the
> way.
>
> Thanks for writing it up.
Previous: Junio C Hamano
Message 4 of 4 in “Why `git am -3` apply patches that don't normally apply?”
  1. Yuri KanivetskyJul 3, 2022
  2. Elijah NewrenJul 4, 2022
  3. Junio C HamanoJul 5, 2022
  4. Yuri KanivetskyJul 6, 2022

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.