From: Junio C Hamano Date: Fri, 08 Jun 2012 22:53:29 GMT Subject: [PATCH 3/3] revision: cull side parents before running simplify-merges Message-ID: <1339196009-14555-4-git-send-email-gitster@pobox.com> In-Reply-To: <1339196009-14555-1-git-send-email-gitster@pobox.com> The simplify_merges() function needs to look at all history chain to find the closest ancestor that is relevant after the simplification, but after --first-parent traversal, side parents haven't been marked for relevance (they are irrelevant by definition due to the nature of first-parent-only traversal) nor culled from the parents list of resulting commits. Remove these side parents from parents list before starting to further simplifying the result. Signed-off-by: Junio C Hamano --- revision.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/revision.c b/revision.c index 814b96f..d93eb7c 100644 --- a/revision.c +++ b/revision.c @@ -2031,6 +2031,9 @@ static void simplify_merges(struct rev_info *revs) * Do not free(list) here yet; the original list * is used later in this function. */ + if (revs->first_parent_only && + commit->parents && commit->parents->next) + commit->parents->next = NULL; commit_list_insert(commit, &yet_to_do); } while (yet_to_do) { -- 1.7.11.rc2.29.g85b30f3