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

Re: fuzzy patch application

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 10, 2017, 19:38 UTC
Message-ID
<xmqq37flltuc.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAKwvOdn9j=_Ob=xq4ucN6Ar1G537zNiU9ox4iF6o1qO7kPY41A@mail.gmail.com>
Nick Desaulniers <ndesaulniers@google.com> writes:
Show 6 quoted lines
> I frequently need to backport patches from the Linux kernel to older
> kernel versions (Android Security)....
> ...
> My question is, why does `patch` seem to do a better job at applying
> patches than `git am`?  It's almost like the `git` tools don't try to fuzz
> the offsets.

You diagnosed correctly. We do allow offsets but by default no fuzz and that is a deliberate design decision made in very early days. You can pass option to reduce context, but that is not the default.

Previous: Nick DesaulniersNext: Jeff King
Message 2 of 9 in “fuzzy patch application”
  1. Nick DesaulniersFeb 10, 2017
  2. Junio C HamanoFeb 10, 2017
  3. Jeff KingFeb 10, 2017
  4. Stefan BellerFeb 10, 2017
  5. Jeff KingFeb 10, 2017
  6. Junio C HamanoFeb 10, 2017
  7. Junio C HamanoFeb 10, 2017
  8. Nick DesaulniersFeb 10, 2017
  9. Junio C HamanoFeb 11, 2017

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.