[PATCH 3/3] revision: cull side parents before running simplify-merges

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <gitster@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]