All of lore.kernel.org
 help / color / mirror / Atom feed
* git-rev-list: proper lazy reachability
@ 2005-05-31  1:58 Linus Torvalds
  2005-05-31  7:58 ` Jon Seymour
  2005-05-31 12:15 ` Paul Mackerras
  0 siblings, 2 replies; 18+ messages in thread
From: Linus Torvalds @ 2005-05-31  1:58 UTC (permalink / raw)
  To: Git Mailing List


Ok, I just made git-rev-list DTRT when you pass it a "beginning" and 
"end", ie it does proper reachability analysis _without_ parsing the whole 
set of commits. 

It's probably buggy, so don't get too excited, but it seems to give the 
right results for something like

	git-rev-list v2.6.12-rc5 v2.6.12-rc4

which is basically "give me a rev-list of everything that is in rc5 but is 
not in rc4".

So now "git-rev-list a b" should be equivalent to "git-rev-tree a ^b", 
except it's faster, and it doesn't print out anything else.

Because it doesn't need to go all the way back to the root (only far 
enough back to be able to determine that there can be no more unreachable 
entries), it should be constant-time in the total history size. Doesn't 
matter if you've got a million revisions, if you asked for the difference 
between two "close" ones, it will be fast.

Somebody should probably take a look at my simplistic algorithm, since it 
can probably be improved upon and/or fixed for corner-cases.

		Linus

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: git-rev-list: proper lazy reachability
@ 2005-06-01 18:44 Marco Costalba
  0 siblings, 0 replies; 18+ messages in thread
From: Marco Costalba @ 2005-06-01 18:44 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Git Mailing List

Linus Torvalds wrote:
> 
> On Tue, 31 May 2005, Linus Torvalds wrote:
> 
>>You should never see a parent before a child from git-rev-list.
> 
> 
> Actually, I take that back.
> 
...

> 
> The thing is, since B has such an "old" date, the traversal assumes that
> it is old and very low down in the tree, and that it's better off parsing
> other commits first, so it will never look more closely at B and notice
> that it has a parent that has already been parsed.
> 

If this is an exception, and I it is, peraphs can be treated in a special way.

As example, when adding a new parent to the pending list of parents to be processed in time-based
ordering, should be easy to inc a counter if  the last one is always the same, e.g. there is the
same very old node around, and check closer to it if the counter reach some allowed maximum.

I know it's a hack, and is not a solution in the general case, but also the last century developer
clock is very rare, more, it is a warning for a bad commit. 

Do not wait for the end of the toposort its a very big advantage for, e.g. GUI git viewers
launched on big trees with long histories.

Marco Costalba




	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: git-rev-list: proper lazy reachability
@ 2005-06-01 19:02 Marco Costalba
  0 siblings, 0 replies; 18+ messages in thread
From: Marco Costalba @ 2005-06-01 19:02 UTC (permalink / raw)
  To: git

Linus Torvalds wrote:
> 
> On Tue, 31 May 2005, Linus Torvalds wrote:
> 
>>You should never see a parent before a child from git-rev-list.
> 
> 
> Actually, I take that back.
> 
...

> 
> The thing is, since B has such an "old" date, the traversal assumes that
> it is old and very low down in the tree, and that it's better off parsing
> other commits first, so it will never look more closely at B and notice
> that it has a parent that has already been parsed.
> 

If this is an exception, and I it is, peraphs can be treated in a special way.

As example, when adding a new parent to the pending list of parents to be processed in time-based
ordering, should be easy to inc a counter if  the last one is always the same, e.g. there is the
same very old node around, and check closer to it if the counter reach some allowed maximum.

I know it's a hack, and is not a solution in the general case, but also the last century developer
clock is very rare, more, it is a warning for a bad commit. 

Do not wait for the end of the toposort its a very big advantage for, e.g. GUI git viewers
launched on big trees with long histories.

Marco Costalba







	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2005-06-04 19:43 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-31  1:58 git-rev-list: proper lazy reachability Linus Torvalds
2005-05-31  7:58 ` Jon Seymour
2005-05-31 14:35   ` Linus Torvalds
2005-05-31 15:13   ` Linus Torvalds
2005-06-01  0:14     ` Jon Seymour
2005-05-31 12:15 ` Paul Mackerras
2005-05-31 14:39   ` Linus Torvalds
2005-05-31 15:23     ` Linus Torvalds
2005-06-01 16:38       ` Matthias Urlichs
2005-06-04 15:01       ` Junio C Hamano
2005-06-04 15:09         ` Thomas Glanzmann
2005-06-04 15:42         ` Linus Torvalds
2005-06-04 15:51           ` Linus Torvalds
2005-06-04 19:30             ` Junio C Hamano
2005-06-04 19:46             ` Petr Baudis
2005-06-04 19:41           ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2005-06-01 18:44 Marco Costalba
2005-06-01 19:02 Marco Costalba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.