{"thread":{"id":"1149","subject":"[PATCH] Ensure list insertion method does not depend on position of --merge-order argument","startedAt":"2005-07-07T00:59:13Z","lastAt":"2005-07-07T00:59:13Z","messageCount":1,"participants":["Jon Seymour"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"5742","messageId":"20050707005913.16295.qmail@blackcubes.dyndns.org","threadId":"1149","inReplyTo":null,"subject":"[PATCH] Ensure list insertion method does not depend on position of --merge-order argument","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2005-07-07T00:59:13Z","receivedAt":"2005-07-07T00:59:13Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"\nThis change ensures that git-rev-list --merge-order produces the same result\nirrespective of what position the --merge-order argument appears in the argument\nlist.\n\nSigned-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\nLinus: if you'd prefer to fix this a different way, that's fine by me!\n---\n\n rev-list.c |    6 ++----\n 1 files changed, 2 insertions(+), 4 deletions(-)\n\n8723420366d839123ca4186c60469fd38fd4b798\ndiff --git a/rev-list.c b/rev-list.c\n--- a/rev-list.c\n+++ b/rev-list.c\n@@ -411,10 +411,8 @@ static struct commit *get_commit_referen\n int main(int argc, char **argv)\n {\n \tstruct commit_list *list = NULL;\n-\tstruct commit_list *(*insert)(struct commit *, struct commit_list **);\n \tint i, limited = 0;\n \n-\tinsert = insert_by_date;\n \tfor (i = 1 ; i < argc; i++) {\n \t\tint flags;\n \t\tchar *arg = argv[i];\n@@ -464,7 +462,6 @@ int main(int argc, char **argv)\n \t\t}\n \t\tif (!strcmp(arg, \"--merge-order\")) {\n \t\t        merge_order = 1;\n-\t\t        insert = commit_list_insert;\n \t\t\tcontinue;\n \t\t}\n \t\tif (!strcmp(arg, \"--show-breaks\")) {\n@@ -491,10 +488,11 @@ int main(int argc, char **argv)\n \t\tif (commit->object.flags & DUPCHECK)\n \t\t\tcontinue;\n \t\tcommit->object.flags |= DUPCHECK;\n-\t\tinsert(commit, &list);\n+\t\tcommit_list_insert(commit, &list);\n \t}\n \n \tif (!merge_order) {\t\t\n+\t\tsort_by_date(&list);\n \t        if (limited)\n \t\t\tlist = limit_list(list);\n \t\tif (topo_order)\n------------\n"}]}