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

Re: Generation numbers and replacement objects

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 16, 2011, 21:10 UTC
Message-ID
<201107162310.26808.jnareb@gmail.com>
In-Reply-To
<20110715211033.GA1943@sigill.intra.peff.net>
On Fri, Jul 15, 2011, Jeff King wrote:
Show 14 quoted lines
> On Fri, Jul 15, 2011 at 02:01:36PM -0700, Jakub Narebski wrote:
> 
> > Peff, as Junio said somewhere else either in this thread, or the one
> > started by Linus, we would want generation numbers both without taking
> > into account replacement objects (e.g. for object traversal during
> > push / fetch), and with taking it into account (e.g. when showing log
> > or blame for end user).
> > 
> > So we would need two generation number caches: one with and one
> > without replaces.
> 
> Right. And I already outlined a solution for that by indexing the caches
> by the validity token (I haven't written the patches yet, but it's a
> pretty trivial change).
Actually we wouldn't probably want a separate cache for each validity
token, but two caches: one with and one without... well, perhaps one per
namespace.  But certainly not one per replacement.
 
Show 7 quoted lines
> > Nb. generation header stored in commit object can give only the one
> > without replaces, i.e. speed up object enumeration (what happened to
> > caching GSoC project code?) but not git-log.
> 
> Yes. It is a weakness of putting the generation number in the header. I
> think Linus has already said he doesn't care about grafting. You are
> welcome to argue with him about that.
I tried, but he isn't responding to questions about replacement objects.

I can agree that grafts are terrible hack, and for me turning off using generation numbers if there are grafts is reasonable solution. Not so with replace objects.

Show 9 quoted lines
> > Also if replacement object has the same generation as the commit it
> > replaces, and I think also if it has lower generation number, current
> > generation numbers would still work (ne need to invalidate cache).
> 
> Yes, that is why I said elsewhere "you could be more clever about seeing
> how the cache's validity constraints changed". But ultimately, it is not
> that expensive to regenerate the cache under the new conditions, grafts
> don't change very often, and the code to figure out exactly which parts
> of the cache could be saved would be complex.

True. Well, at least taking hash of only replacements of commit objects that change generation number could be a reasonable thing... but probably too complicated anyway.

-- 
Jakub Narebski
Poland
Previous: Jeff King
Message 57 of 57 in “[RFC/PATCHv2 0/6] generation numbers for faster traversals”
  1. Jeff KingJul 13, 2011
  2. 1/6 decorate: allow storing values instead of pointersJeff King, Jul 13, 2011
  3. Jonathan NiederJul 13, 2011
  4. Jeff KingJul 13, 2011
  5. Jeff KingJul 14, 2011
  6. 1/3 implement generic key/value mapJeff King, Jul 14, 2011
  7. Bert WesargJul 14, 2011
  8. Bert WesargJul 14, 2011
  9. Jeff KingJul 14, 2011
  10. Bert WesargJul 14, 2011
  11. Jeff KingJul 14, 2011
  12. Bert WesargJul 14, 2011
  13. 2/3 fast-export: use object to uint32 map instead of "decorate"Jeff King, Jul 14, 2011
  14. Sverre RabbelierJul 15, 2011
  15. Jeff KingJul 15, 2011
  16. 3/3 decorate: use "map" for the underlying implementationJeff King, Jul 14, 2011
  17. Junio C HamanoJul 14, 2011
  18. 0/5 macro-based key/value mapsJeff King, Aug 4, 2011
  19. 1/5 implement generic key/value mapJeff King, Aug 4, 2011
  20. 2/5 fast-export: use object to uint32 map instead of "decorate"Jeff King, Aug 4, 2011
  21. 3/5 decorate: use "map" for the underlying implementationJeff King, Aug 4, 2011
  22. 4/5 map: implement persistent mapsJeff King, Aug 4, 2011
  23. 5/5 implement metadata cache subsystemJeff King, Aug 4, 2011
  24. 0/2 patch-id cachingJeff King, Aug 4, 2011
  25. 1/2 cherry: read default configJeff King, Aug 4, 2011
  26. 2/2 cache patch ids on diskJeff King, Aug 4, 2011
  27. Jeff KingAug 4, 2011
  28. Jeff KingAug 5, 2011
  29. René ScharfeAug 5, 2011
  30. Jeff KingAug 6, 2011
  31. 2/6 add metadata-cache infrastructureJeff King, Jul 13, 2011
  32. Bert WesargJul 13, 2011
  33. Jeff KingJul 13, 2011
  34. Bert WesargJul 13, 2011
  35. Jeff KingJul 13, 2011
  36. Junio C HamanoJul 13, 2011
  37. Junio C HamanoJul 13, 2011
  38. Jeff KingJul 13, 2011
  39. 3/6 commit: add commit_generation functionJeff King, Jul 13, 2011
  40. Eric SunshineJul 13, 2011
  41. 4/6 pretty: support %G to show the generation number of a commitJeff King, Jul 13, 2011
  42. 5/6 check commit generation cache validity against graftsJeff King, Jul 13, 2011
  43. Eric SunshineJul 13, 2011
  44. Jeff KingJul 13, 2011
  45. 6/6 limit "contains" traversals based on commit generationJeff King, Jul 13, 2011
  46. Jeff KingJul 13, 2011
  47. Junio C HamanoJul 13, 2011
  48. Jeff KingJul 13, 2011
  49. Junio C HamanoJul 13, 2011
  50. Jeff KingJul 13, 2011
  51. Junio C HamanoJul 15, 2011
  52. Jeff KingJul 15, 2011
  53. Junio C HamanoJul 15, 2011
  54. Jeff KingJul 15, 2011
  55. Generation numbers and replacement objectsJakub Narebski, Jul 15, 2011
  56. Jeff KingJul 15, 2011
  57. Jakub NarebskiJul 16, 2011

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.