From 65347030590bcc251a9ff2ed96487a0f1b9e9fa8 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 3 Aug 2008 17:47:16 -0700 Subject: 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 --- revision.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'revision.c') 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) -- cgit v1.2.3