Skip to content

merge: reduce set of parents consistently

Junio C Hamano git 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4git-merge: test octopus with redundant parentst/t6028-merge-up-to-date.sh+16 -10 replies
2/4builtin/merge.c: remove "remoteheads" global variablebuiltin/merge.c+28 -230 replies
3/4builtin/merge.c: collect other parents earlybuiltin/merge.c+27 -130 replies
4/4builtin/merge.c: reduce parents earlybuiltin/merge.c t/t6028-merge-up-to-date.sh t/t7602-merge-octopus-many.sh+45 -320 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] merge: reduce set of parents consistently

So this is my attempt to address "Eek, why does your Octopus record many irrelevant parents?!?!?!" issue from Linus and Michał (but without reusing any code from them, except for the initial test).

In the original code, the variable remoteheads held the list of parents read from the command line, and it was used throughout the code to see how many parents the resulting merge will have (used to see if we use twohead or octopus strategy), except that right before we come up with the set of parents to record in the resulting merge commit, we discarded redundant ones.

The updated code instead reduces the parents right after we read them. This even detects the case where our HEAD is an ancestor of one of the commits being merged, in which case HEAD will not be recorded unless we are deliberately recording a fast-forward case as a real merge.

Junio C Hamano (3):
builtin/merge.c: remove "remoteheads" global variable builtin/merge.c: collect other parents early builtin/merge.c: reduce parents early

Michał Kiedrowicz (1):
git-merge: test octopus with redundant parents

 builtin/merge.c               |  142 +++++++++++++++++++++++++----------------
 t/t6028-merge-up-to-date.sh   |   17 ++++-
 t/t7602-merge-octopus-many.sh |   10 ++-
 3 files changed, 108 insertions(+), 61 deletions(-)
Signature · 1 line
1.7.10.332.g1863c