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