git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fix branch ancestry calculation
@ 2006-03-23  1:29 Linus Torvalds
  2006-03-23  1:50 ` [RFC] Make dot-counting ignore ".1" at the end Linus Torvalds
  2006-03-24 14:45 ` Fix branch ancestry calculation David Mansfield
  0 siblings, 2 replies; 11+ messages in thread
From: Linus Torvalds @ 2006-03-23  1:29 UTC (permalink / raw)
  To: David Mansfield; +Cc: Git Mailing List


Some branches don't get any ancestors at all, because their ancestor gets 
a "dotcount" value of 0, and are thus not considered any better than not 
having any ancestor. That's obviously wrong. Even a zero-dot-count 
ancestor is better than having none at all.

This fixes the issue by making not having an ancestor branch have a 
goodness value of -1, avoiding the problem (because even a zero dot-count 
will be considered better).

Alternatively, the special-case for the "1.1.1.1" revision should be 
removed (or made to imply a dot-count of 1).

Finally, I suspect that dot-counting in general should ignore any final 
".1" counts, ie "1.2.1.1" should count the same as "1.2.1", which should 
count the same as "1.2", which has a dot-count of 1.

That would automatically make any "1.1.1.1.1...." sequence always count as 
having a dot-count of 0.

I'll send suggestion that as a separate patch, but in the meantime, this 
is a separate issue, and obviously a bug-fix.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
----

diff --git a/cvsps.c b/cvsps.c
--- a/cvsps.c
+++ b/cvsps.c
@@ -2599,7 +2599,7 @@ static void determine_branch_ancestor(Pa
 	 * note: rev is the pre-commit revision, not the post-commit
 	 */
 	if (!head_ps->ancestor_branch)
-	    d1 = 0;
+	    d1 = -1;
 	else if (strcmp(ps->branch, rev->branch) == 0)
 	    continue;
 	else if (strcmp(head_ps->ancestor_branch, "HEAD") == 0)

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

end of thread, other threads:[~2006-03-25  7:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-23  1:29 Fix branch ancestry calculation Linus Torvalds
2006-03-23  1:50 ` [RFC] Make dot-counting ignore ".1" at the end Linus Torvalds
2006-03-23  6:26   ` Keith Packard
2006-03-23  6:34     ` Linus Torvalds
2006-03-23  7:17       ` Keith Packard
2006-03-24 14:40   ` David Mansfield
2006-03-24 14:45 ` Fix branch ancestry calculation David Mansfield
2006-03-24 15:46   ` Linus Torvalds
2006-03-24 16:38     ` Keith Packard
2006-03-25  1:45       ` Chris Shoemaker
2006-03-25  7:54         ` Keith Packard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).