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

Re: caching commit patch-ids for fast git-cherry

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 29, 2008, 17:13 UTC
Message-ID
<alpine.DEB.1.00.0805291809340.13507@racer.site.net>
In-Reply-To
<7f9d599f0805291001mdbb4b42q6f3a1b79bc9bc4e9@mail.gmail.com>
Hi,
On Thu, 29 May 2008, Geoffrey Irving wrote:
Show 12 quoted lines
> I'm planning to use cherry picking to manage long term syncing between 
> cvs/perforce and git repositories.  This means I'll have scripts running 
> git-cherry between branches with hundreds of uncommon commits, and I 
> want git-cherry to be much, much, faster.
> 
> It looks like I can do this by caching commit->patch-id pairs from
> commit_patch_id() in patch-ids.c to a file, say
> $GIT_DIR/commit-patch-id-cache.  The file would be binary and append
> only, and could be blown away if .  Any suggestions / concerns before
> I write this?  Is there any reusable efficient map code for storing
> the commit->patch-id map, or should I just mirror the blocked storage
> + binary search used for struct patch_ids?

I would store the stuff sorted, so that the lookup is fast, generation less so.

For inspiration, you might want to look at the "notes" branch in my personal fork:

http://repo.or.cz/w/git/dscho.git?a=shortlog;h=refs/heads/notes

Hth, Dscho

Previous: Geoffrey IrvingNext: Geoffrey Irving
Message 2 of 4 in “caching commit patch-ids for fast git-cherry”
  1. Geoffrey IrvingMay 29, 2008
  2. Johannes SchindelinMay 29, 2008
  3. Geoffrey IrvingMay 29, 2008
  4. Johannes SchindelinMay 29, 2008

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.