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

Re: Seeing git history of file including merge changes

From
Dov Grobgeld <dov.grobgeld@gmail.com>
Date
Sep 9, 2015, 08:26 UTC
Message-ID
<CA++fsGHPEMhfENx-35=_9_k7mH98TU8NkHO0pYLC2aSxUKWvyg@mail.gmail.com>
In-Reply-To
<CA++fsGE-R1XpHxAVRZvOEAAwNr1XdTudGbwE4GYvg-E5L9kqEQ@mail.gmail.com>

I asked the following question on StackOverflow a while ago, but did not receive any answers so I'll try here.

We have git repository where a file was changed on a topic branch and this branch was then merged back into the main branch. Due to various reasons the merge was made wrongly and as a result the changes were not accepted during the merge. The following image shows what happened:

               -----
              (  H  )
               -----
                 ^
                 |
                 |
               -----
              (  M  )
               -----^
                 ^   \
                 |    \  -Delta
                 |     \
                 |     -----
                 |    (  B  )
                 |     -----
                 |    ^
                 |   /  +Delta
               -----/
              (  A  )
               -----
The file was changed in commit B and the changes were undone in commit M.

My problem is how to view the changes to the file between a specific commit, e.g. B and another commit in its "downstream", e.g. H.

If you do
    git log -u B..H

you won't see any changes, as the changes due to M are suppressed. You can see potential changes by doing:

    git log -u --full-history B..H

which will show you that there was a merge commit, but it still won't show you the diff between B and M.

So is there a way of seeing all changes made to a file including those made by a merge commit?

Thanks!
Dov
Next: Jeff King
Message 1 of 2 in “Re: Seeing git history of file including merge changes”
  1. Dov GrobgeldSep 9, 2015
  2. Jeff KingSep 9, 2015

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.