Subject: Re: Bizarre git merge behaviour

From: Johannes Sixt <[email-masked]>
Date: Wed, 20 Nov 2013 08:20:30 +0100

Am 11/20/2013 4:49, schrieb Matthew Cengia:
> The other day I was merging a feature branch (shown below as
> origin/22869-new-kernel) into my staging release (shown below as 'wtf'),
> and it *reverted* a bucket-load of changes I'd made on other branches
> which had been merged into staging before. I can't for the life of me
> work out why this happened, and would appreciate any ideas. Output below
> shows symptoms:

Not really. It's impossible to tell what's wrong if you

- show only ..topic
- but not topic..
- and you keep secret which of the changes is unexpected.

Perhaps you did the following:

- On one branch, you made a change A and then another change B that reverts A.
- On the other branch, you also made the same changes as A, but there is
no equivalent of B.

In this case, it is expected that the changes made by B (i.e. the reversal
of change A) are *NOT* in the merge, i.e., the changes of A survive. It
looks as if the merge reverted change B.

If that is not the case, it could be helpful that you pick one of the
files that contains an unexpected change and post the output of

git log --left-right --oneline wtf...origin/22869-new-kernel \
    file/with/changes | cut -c1-70

-- Hannes