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

Re: git-rev-list: proper lazy reachability

From
Linus Torvalds <torvalds@osdl.org>
Date
May 31, 2005, 14:35 UTC
Message-ID
<Pine.LNX.4.58.0505310730010.1876@ppc970.osdl.org>
In-Reply-To
<2cfc4032050531005820979ca7@mail.gmail.com>
On Tue, 31 May 2005, Jon Seymour wrote:
Show 20 quoted lines
>
> On 5/31/05, Linus Torvalds <torvalds@osdl.org> wrote:
> > 
> > Somebody should probably take a look at my simplistic algorithm, since it
> > can probably be improved upon and/or fixed for corner-cases.
> 
> Seems reasonable, though I think that in a graph like this:
> 
>      A 
>   /  |  \ 
> B    C   D
> |  /   /
> E
> | \ 
> F G
> 
> and searching for git-rev-list A ^B it would actually be better to stop
> at E (printing A,B,C,D,E), rather than B because the contemporaneously
> parallel edits C and D and the common base E are relevant to evaluating
> B since they got merged with B into A from the common starting point E.

You're talking about something else - you worry about showing a graph, for example.

What git-rev-list A B does is literally for something like a "changelog" - what commits were added in A that weren't in B, and the list is A, C and D. Or, more commonly, used for something like

	git-rev-list HEAD v2.6.12-rc5 | git-diff-tree --stdin -v -p drivers/usb

which basically says "what changed since 2.6.12-rc5 in the drivers/usb tree"?

So in that situation, you really do _not_ want to see B and E, even if you'd need those two to make all the connections. Because you've seen B and E already (they were in v2.6.12-rc5), and if you're looking for a bug that didn't happen in that release, you really only want to see the new stuff.

		Linus
Previous: Jon SeymourNext: Linus Torvalds
Message 3 of 16 in “git-rev-list: proper lazy reachability”
  1. Linus TorvaldsMay 31, 2005
  2. Jon SeymourMay 31, 2005
  3. Linus TorvaldsMay 31, 2005
  4. Linus TorvaldsMay 31, 2005
  5. Jon SeymourJun 1, 2005
  6. Paul MackerrasMay 31, 2005
  7. Linus TorvaldsMay 31, 2005
  8. Linus TorvaldsMay 31, 2005
  9. Matthias UrlichsJun 1, 2005
  10. Junio C HamanoJun 4, 2005
  11. Thomas GlanzmannJun 4, 2005
  12. Linus TorvaldsJun 4, 2005
  13. Linus TorvaldsJun 4, 2005
  14. Junio C HamanoJun 4, 2005
  15. Petr BaudisJun 4, 2005
  16. Junio C HamanoJun 4, 2005

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.