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

Re: fuzzy patch application

From
Stefan Beller <sbeller@google.com>
Date
Feb 10, 2017, 21:37 UTC
Message-ID
<CAGZ79kaG=oqDM=1+rz_zk6Qn-7wAszxPnBtqrkAJS29_qT7SoA@mail.gmail.com>
In-Reply-To
<20170210205749.c72ajnld7zjfjkwj@sigill.intra.peff.net>
On Fri, Feb 10, 2017 at 12:57 PM, Jeff King <peff@peff.net> wrote:
Show 19 quoted lines
> On Fri, Feb 10, 2017 at 11:20:59AM -0800, Nick Desaulniers wrote:
>
>> 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

I have been told this a couple of times before; do we want to make -3 the default (in 2.13 then) ?

Previous: Jeff KingNext: Jeff King
Message 4 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.