1

I have a develop and a release branch.

I created a patch branch from develop with 6 commits A, B, C, D, E, F (with A being the oldest). It was reviewed and then three-way merged back into develop.

I then created a similar fix branch from release (for review) and cherry picked commits from my develop-based fix branch onto my release-based fix branch like so:

git checkout release/patch/ticket1

git cherry-pick A^..F

This resulted in an unexpected merge conflict while applying patches.

I git cherry-pick --aborted and instead tried

git cherry-pick A
git cherry-pick B
git cherry-pick C
git cherry-pick D
git cherry-pick E
git cherry-pick F

And this worked without conflict.

I thought cherry-pick created a patch from each commit and applied them in sequence to the target branch?

So how is it possible that I have encountered a merge conflict when specifying a range but not when applying individual commits?

Related

EDIT

I attempted tests suggested from the comments and could not reproduce my problem. As my understanding of the cherry-pick sequencer is correct, I'll have to assume the intervention of some other actor (IDE, locking watcher process?).

msanford
  • 10,127
  • 8
  • 56
  • 83
  • I cannot reproduce this. Is it possible for you to create a minimal example? – jsageryd Apr 13 '18 at 18:14
  • At which commit the conflict happens? What happens you you apply first only `A`, then `B^..F`, and other combinations like this? If first commits in series applied succesfully, are the results same? – max630 Apr 13 '18 at 18:28
  • 3
    Your description matches how the cherry-pick sequencer works, so as long as `A^..F` selects those six commits in that order, this should work. Try `git rev-list --reverse --topo-order A^..F` to see if you get those six commits in that order (we need the `--reverse --topo-order` here since the default order is commit date based). – torek Apr 13 '18 at 18:28
  • @jsageryd I'm loathe to post any question without a [mcve] but sadly my code is closed-source (or I would have just linked the repo). Thank you max360 and torek, I'll take a look shortly and update the question. – msanford Apr 13 '18 at 18:49
  • torek, max360: I attempted both, and tried selecting smaller ranges, and could not reproduce my problem. As my understanding of the cherry-pick sequencer was correct, I'll have to assume the intervention of some other actor (IDE, some watcher process?) mucking about. *Please join me in closing this question.* Thank you all for your input. – msanford Apr 13 '18 at 18:56

0 Answers0