git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: "Robin Rosenberg (list subscriber)"  <robin.rosenberg.lists@dewire.com>
Cc: git@vger.kernel.org
Subject: Re: cvsps wierdness
Date: Mon, 12 Jun 2006 14:27:15 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0606121406200.5498@g5.osdl.org> (raw)
In-Reply-To: <200606122247.02727.robin.rosenberg.lists@dewire.com>



On Mon, 12 Jun 2006, Robin Rosenberg (list subscriber) wrote:
> 
> The script creates a small CVS repo with three commits on two files. What's 
> odd is that cvsps lists revision 1.2 of the file v.txt *before* version 1.1, 
> like this:

What seems to happen is that the two changes to v.txt are broken up into 
separate changesets (because they touch the same file), but then the 
_first_ one is merged with the changeset that contains the k.txt change 
(because they have the same log message, and roughly the same date).

Then, because it has the earlier date, that combined changeset ends up 
being considered to be "before" the later one, even though it contains a 
version of v.txt that is newer.

Does this patch fix it for you (untested - it could result in tons of 
other trouble, but it basically just says that time ordering is less 
important than member revision ordering).

I don't think this is strictly correct, btw. I suspect you can still get 
into strange situations where the changeset merging has resulted in one 
file ordering one way, and another file ordering the other way. 

I really don't think cvsps is really very good about this.

		Linus

---
diff --git a/cvsps.c b/cvsps.c
index 2695a0f..daa93a3 100644
--- a/cvsps.c
+++ b/cvsps.c
@@ -1662,14 +1662,14 @@ static int compare_patch_sets_bytime(con
      * know that insertions are unique at this point.
      */
 
-    diff = ps1->date - ps2->date;
-    if (diff)
-	return (diff < 0) ? -1 : 1;
-
     ret = compare_patch_sets_by_members(ps1, ps2);
     if (ret)
 	return ret;
 
+    diff = ps1->date - ps2->date;
+    if (diff)
+	return (diff < 0) ? -1 : 1;
+
     ret = strcmp(ps1->author, ps2->author);
     if (ret)
 	return ret;

  reply	other threads:[~2006-06-12 21:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-12 20:47 cvsps wierdness Robin Rosenberg (list subscriber)
2006-06-12 21:27 ` Linus Torvalds [this message]
2006-06-12 21:30   ` Linus Torvalds
2006-06-13  6:06   ` Robin Rosenberg (list subscriber)

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.0606121406200.5498@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=robin.rosenberg.lists@dewire.com \
    /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).