Git development
 help / color / mirror / Atom feed
From: Jon Seymour <jon.seymour@gmail.com>
To: git@vger.kernel.org
Cc: torvalds@osdl.org, jon.seymour@gmail.com
Subject: [PATCH] Ensure list insertion method does not depend on position of --merge-order argument
Date: Thu, 07 Jul 2005 10:59:13 +1000	[thread overview]
Message-ID: <20050707005913.16295.qmail@blackcubes.dyndns.org> (raw)


This change ensures that git-rev-list --merge-order produces the same result
irrespective of what position the --merge-order argument appears in the argument
list.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
Linus: if you'd prefer to fix this a different way, that's fine by me!
---

 rev-list.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

8723420366d839123ca4186c60469fd38fd4b798
diff --git a/rev-list.c b/rev-list.c
--- a/rev-list.c
+++ b/rev-list.c
@@ -411,10 +411,8 @@ static struct commit *get_commit_referen
 int main(int argc, char **argv)
 {
 	struct commit_list *list = NULL;
-	struct commit_list *(*insert)(struct commit *, struct commit_list **);
 	int i, limited = 0;
 
-	insert = insert_by_date;
 	for (i = 1 ; i < argc; i++) {
 		int flags;
 		char *arg = argv[i];
@@ -464,7 +462,6 @@ int main(int argc, char **argv)
 		}
 		if (!strcmp(arg, "--merge-order")) {
 		        merge_order = 1;
-		        insert = commit_list_insert;
 			continue;
 		}
 		if (!strcmp(arg, "--show-breaks")) {
@@ -491,10 +488,11 @@ int main(int argc, char **argv)
 		if (commit->object.flags & DUPCHECK)
 			continue;
 		commit->object.flags |= DUPCHECK;
-		insert(commit, &list);
+		commit_list_insert(commit, &list);
 	}
 
 	if (!merge_order) {		
+		sort_by_date(&list);
 	        if (limited)
 			list = limit_list(list);
 		if (topo_order)
------------

                 reply	other threads:[~2005-07-07  1:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20050707005913.16295.qmail@blackcubes.dyndns.org \
    --to=jon.seymour@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.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