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

Re: Code changes in merge commits

From
John Tapsell <johnflux@gmail.com>
Date
Sep 29, 2014, 10:01 UTC
Message-ID
<CAHQ6N+rJDtq_vtfotM+GXLdN_P==oTqGbFZ97ZQea9+mcoRBog@mail.gmail.com>
In-Reply-To
<CAHQ6N+p1GqQfTs0H-4ij_QfkWQGfTUbWBzMC4E7LCEynPT78kA@mail.gmail.com>

Rereading what I wrote, I came across as unintentionally harsh and rude. Sorry about that - I was trying to be concise and terse, and it went a bit wrong :)

What I was thinking to improve this is two short-term fixes:
1. Can we get   git log -m -p .     in the top level directory to show
the same commits as just git log -m -p ?
2. Can we get   git log -m -p somefile           to show all the
changes to that file?  Including when lines are added and then removed
by the merge somehow?
But in the longer term, I was thinking about how this could be improved...

What if merge commits were forced into being always trivial? i.e. prevent merges with conflicts or code changes? Then conflict resolution and code changes are pushed into a second "ordinary" commit. That way you can always see what changes have been made to the code.

E.g. If you have branch "master" and branch "A", and there are conflicts when you merge, you could end up with:

merge commit
   |                  \
   |                  preparation changes to fix conflicts with oldmaster
oldmaster           |
                          A

I know this isn't great, but maybe something along these lines? Ideally I'd like to see all the code changes to a code base just with "git log -p".

Any thoughts?
Thanks,
John Tapsell
Previous: John TapsellNext: Matthieu Moy
Message 2 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.