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

Re: Git commit generation numbers

From
Long, Martin <martin@longhome.co.uk>
Date
Jul 15, 2011, 09:17 UTC
Message-ID
<CANfMb_-ZxGGzpKDnhG46HK+DZ1UN+_kxccKuSrZtO41N0EFy6Q@mail.gmail.com>
In-Reply-To
<m3fwm7aox1.fsf@localhost.localdomain>

I strongly agree with Linus that the cache should not form part of the solution to this problem, but could maybe be a later add-on, which improved performance.

There is a possible improvement, which may remove the need for the cache. It doesn't solve the issue of broken numbers, but I think the key to that is just to ensure the traversal algorithm is deterministic, stable, and immutable.

Firstly, I presume the generation number would not form part of the SHA1 calculation? No? Cool.

When calculating a generation number by doing a traversal, would it not be possible to update some, or all, commit objects touched, with their generation numbers. Again, this would be expensive, but there would possibly be even quicker gains than Linus's original proposal to just add numbers to the new commit.

A compromise might be to only update some commits - notably those with 2 or more parents, so that both parents don't need to be traversed, and possibly every nth commit (to give regular checkpoints that can be utilised when traversing a branch). I would suggest commits with 2 children for the latter, but with my limited knowledge of the implementation, I understand that Is more difficult to find. Obviously, these numbers would only be pegged locally, and wouldn't by synced on push, as they already exist on the far end. However, it could be possible to run a process on a bare repo to shoot through and peg commits, then at least new clones will be "well pegged"

Martin Long UK

Previous: Jakub NarebskiNext: Long, Martin
Message 40 of 47 in “Git commit generation numbers”
  1. Linus TorvaldsJul 14, 2011
  2. Jeff KingJul 14, 2011
  3. Linus TorvaldsJul 14, 2011
  4. Linus TorvaldsJul 14, 2011
  5. Jeff KingJul 14, 2011
  6. Ted Ts'oJul 14, 2011
  7. Linus TorvaldsJul 14, 2011
  8. Jeff KingJul 14, 2011
  9. Ted Ts'oJul 14, 2011
  10. Jeff KingJul 14, 2011
  11. Linus TorvaldsJul 14, 2011
  12. Jeff KingJul 14, 2011
  13. Linus TorvaldsJul 14, 2011
  14. Jeff KingJul 14, 2011
  15. Linus TorvaldsJul 15, 2011
  16. Geert BoschJul 15, 2011
  17. Jeff KingJul 15, 2011
  18. Linus TorvaldsJul 15, 2011
  19. Shawn PearceJul 15, 2011
  20. Linus TorvaldsJul 15, 2011
  21. Ted Ts'oJul 15, 2011
  22. Linus TorvaldsJul 15, 2011
  23. Christian CouderJul 16, 2011
  24. Jeff KingJul 18, 2011
  25. Christian CouderJul 19, 2011
  26. Jeff KingJul 19, 2011
  27. Christian CouderJul 21, 2011
  28. Tony LuckJul 15, 2011
  29. Linus TorvaldsJul 15, 2011
  30. Jeff KingJul 15, 2011
  31. Jeff KingJul 15, 2011
  32. Linus TorvaldsJul 15, 2011
  33. Jeff KingJul 15, 2011
  34. Linus TorvaldsJul 15, 2011
  35. Linus TorvaldsJul 15, 2011
  36. Linus TorvaldsJul 15, 2011
  37. Jeff KingJul 16, 2011
  38. Jeff KingJul 16, 2011
  39. Jakub NarebskiJul 15, 2011
  40. Long, MartinJul 15, 2011
  41. Long, MartinJul 15, 2011
  42. Drew NorthupJul 15, 2011
  43. Linus TorvaldsJul 14, 2011
  44. Jakub NarebskiJul 14, 2011
  45. Junio C HamanoJul 14, 2011
  46. Jeff KingJul 14, 2011
  47. Junio C HamanoJul 14, 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.