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

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

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 10, 2008, 20:17 UTC
Message-ID
<m3myq8fwdx.fsf@localhost.localdomain>
In-Reply-To
<alpine.LSU.1.00.0802100130090.11591@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 11 quoted lines
> On Sat, 9 Feb 2008, Nicolas Pitre wrote:
> 
> > I, too, have some reservations about adding any kind of generation 
> > header to commit objects.  First because it can be generated and 
> > maintained locally, just like the pack index.  But also because its 
> > usefulness has not been proven in all possible graph topologies, and 
> > adding it to the commit header pretty much deny any further 
> > modifications/improvements on it, if for example some other kind of 
> > generation notation becomes advantageous to use.
> 
> I fully agree.

I think I'd agree, also because without 'generation' (and 'roots') commit object header being there from beginning it is not clear when to calculate it: the first few commits with it would be costly. Besides graft and shallow information is local, and it affect commit traversal.

I was thinking about pack-index like file, either directly mapping "sha1 -> generation + roots", or indirectly "sha1 -> offset", "offset -> generation + roots".

P.S. Would having generation + roots be enough?
  gen(rev) = max_i { gen(i) + 1 : i in parents(rev) } || 1
  roots(rev) = { rev  if rev is a root (parentless) commit 
               { union of roots of parents of a commit otherwise
Union in the sense of set sum.

Note that if roots was to be saved in commit header, then it couldn't be as simple as commit-id for root commits: no self links. It would have to be empty for root commits, and the "union of roots" would have to be modified to "union of roots or commit ids for root commits, of each of parents of a commit".

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Johannes SchindelinNext: Linus Torvalds
Message 11 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.