Code changes in merge commits
- From
John Tapsell <johnflux@gmail.com>
- Date
- Sep 29, 2014, 09:32 UTC
- Message-ID
- <CAHQ6N+p1GqQfTs0H-4ij_QfkWQGfTUbWBzMC4E7LCEynPT78kA@mail.gmail.com>
Hi,
Our team just struggled with this problem, and I've created a simple, 3 commit large, example git repository to demonstrate the problem:
https://github.com/johnflux/ExampleEvilness2
The code: Adds a file, adds a security fix commit, then removes the fix during a merge.
This happened by accident in our code during a merge, but nobody noticed, and it was not easy to track down.
In this example, you can see that the security fix was removed by doing:
$ git log -m -p
However the following do NOT show that the security fix was removed:
$ git log -m -p . $ git log -m -p tmp.c $ git log -c -p tmp.c
And so on. In a large code base, this a problem.
John