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

Re: [PATCH] patch-ids.c: cache patch IDs in a notes tree

From
John Keeping <john@keeping.me.uk>
Date
May 13, 2013, 15:52 UTC
Message-ID
<20130513155241.GS2299@serenity.lan>
In-Reply-To
<7vd2suopda.fsf@alter.siamese.dyndns.org>
On Mon, May 13, 2013 at 08:45:21AM -0700, Junio C Hamano wrote:
Show 10 quoted lines
> John Keeping <john@keeping.me.uk> writes:
> 
> > This has the advantage that you get the benefit of the cache if you run
> > "git log --cherry-mark" with the same paths more than once.  In my
> > testing the cache is beneficial as soon as you examine more than one
> > similar range (e.g. master...feature-A and then master...feature-B).
> 
> OK, so perhaps the notes that are keyed with commit ID will record
> multiple entries, one for each invocation pattern (i.e. all pathspec
> given, possibly with nonstandard options)?

That would be possible, but I didn't do it in the current version of the patch.

> "git diff -- t Documentation" and "git diff -- Docu\* t", even
> though they use different pathspec, would produce the same diff;
> instead of pathspec you may need to key with the actual list of
> paths in the patch, though.
Maybe, but I think that would be overkill.

I'm interested to see how much of a benefit we could get by not calculating the patch ID of any commits on the larger side of a symmetric range that touch paths outside the set touched by the smaller side. (revision.c::cherry_pick_list() remembers patch IDs for the smaller side of a symmetric range and then checks if anything on the larger side matches so this fits in naturally.)

In my usage I generally compare a relatively small topic branch against whatever has happened in some upstream branch so I think this could give a big improvement but I haven't had time to try it yet.

Previous: Junio C Hamano
Message 18 of 18 in “patch-ids.c: cache patch IDs in a notes tree”
  1. patch-ids.c: cache patch IDs in a notes treeJohn Keeping, May 11, 2013
  2. Linus TorvaldsMay 11, 2013
  3. John KeepingMay 11, 2013
  4. Linus TorvaldsMay 11, 2013
  5. Johannes SchindelinMay 11, 2013
  6. John KeepingMay 12, 2013
  7. patch-ids: cache patch IDs in a notes treeJohn Keeping, May 12, 2013
  8. John KeepingMay 12, 2013
  9. Junio C HamanoMay 12, 2013
  10. John KeepingMay 12, 2013
  11. Junio C HamanoMay 12, 2013
  12. John KeepingMay 13, 2013
  13. Junio C HamanoMay 13, 2013
  14. John KeepingMay 13, 2013
  15. Junio C HamanoMay 13, 2013
  16. John KeepingMay 13, 2013
  17. Junio C HamanoMay 13, 2013
  18. John KeepingMay 13, 2013

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.