[Discussion] cherry-picking a merge

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

 



Earlier "git cherry-pick" learned the "-m <parent-number>"
option to allow cherry-picking a merge commit.

When you have this history:

  ---o---o---C---A---M
      \             /
       o---o-------B

You can replay the change between A and M (in other words, the
effect of merging B into A) on top of C to create a new commit,
with:

        $ git cherry-pick -m 1 M

In the current implementation, the resulting commit has a single
parent C.  This is quite similar to a squash merge of B into C.

When you think about it, as long as the topological relationship
between A and B is very similar to that of C and B (iow,
"merge-base A B" and "merge-base C B" are the same), the effect
should be the same as a real merge between B and C, shouldn't it?

  ---o---o---C---A---M
      \       \     /
       o---o---\---B
                \   \
                 `---X

I am wondering if it makes sense to record the result of
"cherry-pick -m" as a real merge between the current HEAD and
all the other parents of the cherry-picked merge except the one
that is named with the <parent-number>.
-
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]

  Powered by Linux