From: Linus Torvalds <torvalds@osdl.org>
To: David Mansfield <cvsps@dm.cobite.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Fix branch ancestry calculation
Date: Wed, 22 Mar 2006 17:29:20 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.64.0603221723230.9196@g5.osdl.org> (raw)
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)
next reply other threads:[~2006-03-23 1:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-23 1:29 Linus Torvalds [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0603221723230.9196@g5.osdl.org \
--to=torvalds@osdl.org \
--cc=cvsps@dm.cobite.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).