{"thread":{"id":"1001","subject":"[PATCH 1/1] Fix --merge-order unit test breaks introduced by 6c88be169881c9223532796bd225e79afaa115e1","startedAt":"2005-06-21T15:58:46Z","lastAt":"2005-06-21T15:58:46Z","messageCount":1,"participants":["Jon Seymour"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"5103","messageId":"20050621155846.5380.qmail@blackcubes.dyndns.org","threadId":"1001","inReplyTo":null,"subject":"[PATCH 1/1] Fix --merge-order unit test breaks introduced by 6c88be169881c9223532796bd225e79afaa115e1","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2005-06-21T15:58:46Z","receivedAt":"2005-06-21T15:58:46Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"\nThe sensible cleanup of the in-memory storage order of commit parents broke the --merge-order\ncode which was dependent on the previous behaviour of parse_commit().\n\nThis patch restores the correctness --merge-order behaviour by taking account of the\nnew behaviour of parse_commit.\n\nSigned-off-by: Jon Seymour <jon.seymour@gmail.com>\n---\nTested on Linus HEAD: 0795495388d703dc84110a9a7917dd6ec9516bb4.\n---\n\n epoch.c |   15 +++------------\n 1 files changed, 3 insertions(+), 12 deletions(-)\n\ndiff --git a/epoch.c b/epoch.c\n--- a/epoch.c\n+++ b/epoch.c\n@@ -424,19 +424,10 @@ static void mark_ancestors_uninteresting\n static void sort_first_epoch(struct commit *head, struct commit_list **stack)\n {\n \tstruct commit_list *parents;\n-\tstruct commit_list *reversed_parents = NULL;\n \n \thead->object.flags |= VISITED;\n \n \t/*\n-\t * parse_commit() builds the parent list in reverse order with respect\n-\t * to the order of the git-commit-tree arguments. So we need to reverse\n-\t * this list to output the oldest (or most \"local\") commits last.\n-\t */\n-\tfor (parents = head->parents; parents; parents = parents->next)\n-\t\tcommit_list_insert(parents->item, &reversed_parents);\n-\n-\t/*\n \t * TODO: By sorting the parents in a different order, we can alter the\n \t * merge order to show contemporaneous changes in parallel branches\n \t * occurring after \"local\" changes. This is useful for a developer\n@@ -445,8 +436,8 @@ static void sort_first_epoch(struct comm\n \t * changes.\n \t */\n \n-\twhile (reversed_parents) {\n-\t\tstruct commit *parent = pop_commit(&reversed_parents);\n+\tfor (parents = head->parents; parents; parents = parents->next) {\n+\t\tstruct commit *parent = parents->item;\n \n \t\tif (head->object.flags & UNINTERESTING) {\n \t\t\t/*\n@@ -470,7 +461,7 @@ static void sort_first_epoch(struct comm\n \n \t\t\t} else {\n \t\t\t\tsort_first_epoch(parent, stack);\n-\t\t\t\tif (reversed_parents) {\n+\t\t\t\tif (parents) {\n \t\t\t\t\t/*\n \t\t\t\t\t * This indicates a possible\n \t\t\t\t\t * discontinuity it may not be be\n------------\n"}]}