summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-08-03 17:47:16 -0700
committerJunio C Hamano <gitster@pobox.com>2008-08-03 17:47:16 -0700
commit65347030590bcc251a9ff2ed96487a0f1b9e9fa8 (patch)
treec602ca33b3e0c53470bf0b0ffff41d9dab96b3bf /revision.c
parent6546b5931e5608dfdcd3e4fbf9ebc90ee0982b56 (diff)
downloadgit-65347030590bcc251a9ff2ed96487a0f1b9e9fa8.tar.gz
Topo-sort before --simplify-merges
This makes the algorithm more honest about what it is doing. We start from an already limited, topo-sorted list, and postprocess it by simplifying the irrelevant merges away. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/revision.c b/revision.c
index 662d66be7e..0aaa4c10b9 100644
--- a/revision.c
+++ b/revision.c
@@ -1493,6 +1493,8 @@ static void simplify_merges(struct rev_info *revs)
struct commit_list *list;
struct commit_list *yet_to_do, **tail;
+ sort_in_topological_order(&revs->commits, revs->lifo);
+
/* feed the list reversed */
yet_to_do = NULL;
for (list = revs->commits; list; list = list->next)
@@ -1522,9 +1524,6 @@ static void simplify_merges(struct rev_info *revs)
if (commit->util == commit)
tail = &commit_list_insert(commit, tail)->next;
}
-
- /* sort topologically at the end */
- sort_in_topological_order(&revs->commits, revs->lifo);
}
static void set_children(struct rev_info *revs)