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, 21:48 UTC
Message-ID
<20170210214850.2ok62xdmemgotwnt@sigill.intra.peff.net>
In-Reply-To
<CAGZ79kaG=oqDM=1+rz_zk6Qn-7wAszxPnBtqrkAJS29_qT7SoA@mail.gmail.com>
On Fri, Feb 10, 2017 at 01:37:12PM -0800, Stefan Beller wrote:
Show 12 quoted lines
> > 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.
> 
> I have been told this a couple of times before; do we want to make -3
> the default (in 2.13 then) ?

I dunno. I always use it, but I'm not sure if there are any downsides, aside from a little extra processing time. It does have some incompatibilities with other options. And I think it kicks in rename detection (but I might be mis-remembering another feature). That could be surprising, I guess.

The original dates all the way back to 47f0b6d5d (Fall back to three-way merge when applying a patch., 2005-10-06), but I don't see any rationale for not making it the default. Junio probably could give a better answer.

-Peff
Previous: Stefan BellerNext: Junio C Hamano
Message 5 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.