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

[PATCH] Restore expected list order for --merge-order switch

From
Jon Seymour <jon.seymour@gmail.com>
Date
Jul 5, 2005, 01:06 UTC
Message-ID
<20050705010619.13581.qmail@blackcubes.dyndns.org>

A recent change to rev-list altered the order in which start points are presented to the merge-order sort algorithm. This caused breaks in the t/t6001 unit tests.

This change restores the order in which start points are presented to the the merge-order sort algorithm (but leaves the order unchanged from the immediately preceding behaviour for non --merge-order sorts).

The order in which arguments are presented to the merge-order sort algorithm is significant, since left-most arguments are expected to sort last so as to be consistent with how left-most parents sort.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
 rev-list.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
ed4451af196ea31ec0c6c7f663290a9b325482cd
diff --git a/rev-list.c b/rev-list.c
--- a/rev-list.c
+++ b/rev-list.c
@@ -482,7 +482,10 @@ int main(int argc, char **argv)
 		commit = get_commit_reference(arg, flags);
 		if (!commit)
 			continue;
-		insert_by_date(&list, commit);
+		if (!merge_order) 
+			insert_by_date(&list, commit);
+		else
+			commit_list_insert(commit, &list);
 	}
 
 	if (!merge_order) {		
------------
Next: Jon Seymour
Message 1 of 3 in “Restore expected list order for --merge-order switch”
  1. Restore expected list order for --merge-order switchJon Seymour, Jul 5, 2005
  2. Jon SeymourJul 5, 2005
  3. Linus TorvaldsJul 5, 2005

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.