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

Re: fuzzy patch application

From
Jeff King <peff@peff.net>
Date
Feb 10, 2017, 20:57 UTC
Message-ID
<20170210205749.c72ajnld7zjfjkwj@sigill.intra.peff.net>
In-Reply-To
<CAKwvOdn9j=_Ob=xq4ucN6Ar1G537zNiU9ox4iF6o1qO7kPY41A@mail.gmail.com>
On Fri, Feb 10, 2017 at 11:20:59AM -0800, Nick Desaulniers wrote:
Show 5 quoted lines
> I frequently need to backport patches from the Linux kernel to older
> kernel versions (Android Security).  My usual workflow for simple
> patches is:
> 
> 1. try `git am patch.txt`.

This is not exactly an answer to your question, but "git am -3" is often a better solution than trying to fuzz patches. It assumes the patches are Git patches (and record their origin blobs), and that you have that blob (which should be true if the patches are based on the normal kernel history, and you just fetch that history into your repository).

I've found that this often manages to apply patches that "git apply" will not by itself. And I also find the resulting conflicts to be much easier to deal with than patch's ".rej" files.

-Peff
Previous: Junio C HamanoNext: Stefan Beller
Message 3 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.