git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Next: John Tapsell
Message 1 of 5 in “Code changes in merge commits”
  1. John TapsellSep 29, 2014
  2. John TapsellSep 29, 2014
  3. Matthieu MoySep 29, 2014
  4. John TapsellSep 29, 2014
  5. Duy NguyenSep 29, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.