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

Re: cvsps wierdness

From
Linus Torvalds <torvalds@osdl.org>
Date
Jun 12, 2006, 21:27 UTC
Message-ID
<Pine.LNX.4.64.0606121406200.5498@g5.osdl.org>
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;
Previous: Robin Rosenberg (list subscriber)Next: Linus Torvalds
Message 2 of 4 in “cvsps wierdness”
  1. Robin Rosenberg (list subscriber)Jun 12, 2006
  2. Linus TorvaldsJun 12, 2006
  3. Linus TorvaldsJun 12, 2006
  4. Robin Rosenberg (list subscriber)Jun 13, 2006

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.