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

Re: rename detection limit checking, cherry picking, and git am -3

From
Shawn O. Pearce <spearce@spearce.org>
Date
Sep 17, 2007, 03:47 UTC
Message-ID
<20070917034742.GG3099@spearce.org>
In-Reply-To
<46EDF54F.5030503@gmail.com>
Mark Levedahl <mlevedahl@gmail.com> wrote:
> The curious thing to me is the vast superiority of whatever 
> git-format-patch|git-am -3 does, and I wonder if that isn't a 
> fundementally better design for cherry picking than git-cherry-pick 
> implements (it obviously is for this case).

In this case `git am -3` creates a tree object containing only the files modified by the patch and then feeds that tree into git-merge-recursive. Now if you go study git-revert's code you'll see it actually just calls git-merge-recursive on three trees, but these are three complete trees.

So what's probably happening here is there's less candidates on one side in the `am -3` case, so we spend a lot less time generating the rename matrix, searching for a match, and we get better changes of finding a match.

I actually don't see why cherry-pick can't be defined in terms of `format-patch|am -3`. It probably would be faster in almost all cases.

-- 
Shawn.
Previous: Mark LevedahlNext: Junio C Hamano
Message 2 of 5 in “rename detection limit checking, cherry picking, and git am -3”
  1. Mark LevedahlSep 17, 2007
  2. Shawn O. PearceSep 17, 2007
  3. Junio C HamanoSep 17, 2007
  4. Karl HasselströmSep 17, 2007
  5. Mark LevedahlSep 18, 2007

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.