From: Junio C Hamano Date: Thu, 28 Mar 2013 21:37:53 +0000 (-0700) Subject: Merge branch 'jc/remove-treesame-parent-in-simplify-merges' X-Git-Tag: v1.8.3-rc0~158 X-Git-Url: https://repo.or.cz/w/git.git/commitdiff_plain/436b60ce7aac4cf8e496c57c9baae46094571b22 Merge branch 'jc/remove-treesame-parent-in-simplify-merges' The --simplify-merges logic did not cull irrelevant parents from a merge that is otherwise not interesting with respect to the paths we are following. This touches a fairly core part of the revision traversal infrastructure; even though I think this change is correct, please report immediately if you find any unintended side effect. * jc/remove-treesame-parent-in-simplify-merges: simplify-merges: drop merge from irrelevant side branch --- 436b60ce7aac4cf8e496c57c9baae46094571b22 diff --cc revision.c index ef60205412,3536635a88..78397d6486 --- a/revision.c +++ b/revision.c @@@ -2019,13 -1484,15 +2035,21 @@@ static struct commit_list **simplify_on for (p = commit->parents; p; p = p->next) { pst = locate_simplify_state(revs, p->item); p->item = pst->simplified; + if (revs->first_parent_only) + break; } - if (!revs->first_parent_only) - cnt = remove_duplicate_parents(commit); - else + - /* - * A merge with a tree-same parent is useless - */ - if (commit->parents && commit->parents->next) - remove_treesame_parents(commit); ++ if (revs->first_parent_only) { + cnt = 1; ++ } else { ++ /* ++ * A merge with a tree-same parent is useless ++ */ ++ if (commit->parents && commit->parents->next) ++ remove_treesame_parents(commit); + - cnt = remove_duplicate_parents(commit); ++ cnt = remove_duplicate_parents(commit); ++ } /* * It is possible that we are a merge and one side branch