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

Re: Add "--show-all" revision walker flag for debugging

From
Nicolas Pitre <nico@cam.org>
Date
Feb 11, 2008, 16:39 UTC
Message-ID
<alpine.LFD.1.00.0802111112420.2732@xanadu.home>
In-Reply-To
<alpine.LFD.1.00.0802110748370.2920@woody.linux-foundation.org>
On Mon, 11 Feb 2008, Linus Torvalds wrote:
Show 7 quoted lines
> On Mon, 11 Feb 2008, Jakub Narebski wrote:
> > 
> > Errr... index is per workarea (per checkout), and this information
> > is per repository, so IMHO storing this info in an index (dircache)
> > is a layering violation. Unless you were talking about pack-file-index.
> 
> I did mean the pack-file index, not the "cache" index.

I think this has nothing to do with pack index either. Your repo may have one pack, or multiple packs, or even no pack at all. They may or may not contain commit objects, etc.

The generation indexing is OTOH a repo wide issue, completely orthogonal to object packing. It has to be centralized in a single global file, or possibly one file per branch, and updated whenever new commits are added to the repository. I think the best format is to have a list of (generation_nr, commit_sha1) tuples in assending order, so whenever a fetch or a commit is performed then updating this file is only a matter of appending to it.

And optimizing it even further, only merge commits (or rather merge direct parents as well as branch heads) should have their generation number cached in a file since the linear commits are trivially deduced from there.

And regenerating this generation cache should not take longer than a full history walk.

Nicolas
Previous: Jakub Narebski
Message 20 of 20 in “Add "--show-all" revision walker flag for debugging”
  1. Linus TorvaldsFeb 9, 2008
  2. Linus TorvaldsFeb 9, 2008
  3. Junio C HamanoFeb 10, 2008
  4. Johannes SchindelinFeb 10, 2008
  5. Linus TorvaldsFeb 10, 2008
  6. Johannes SchindelinFeb 10, 2008
  7. Junio C HamanoFeb 10, 2008
  8. Junio C HamanoFeb 10, 2008
  9. Nicolas PitreFeb 10, 2008
  10. Johannes SchindelinFeb 10, 2008
  11. Jakub NarebskiFeb 10, 2008
  12. Linus TorvaldsFeb 10, 2008
  13. Nicolas PitreFeb 10, 2008
  14. Jakub NarebskiFeb 10, 2008
  15. Linus TorvaldsFeb 10, 2008
  16. Jakub NarebskiFeb 11, 2008
  17. Nicolas PitreFeb 11, 2008
  18. Linus TorvaldsFeb 11, 2008
  19. Jakub NarebskiFeb 11, 2008
  20. Nicolas PitreFeb 11, 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.