Merge commits not shown in file history
Summary
Commits created as a result of a merge are not shown in the file History commit list under certain conditions.
I just encountered this at work - when two branches are merged with conflicts, and as a part of the conflict resolution one makes changes to a file, this commit will not show in the history of commits of that file.
Steps to reproduce
Look at the example project linked below. The steps to reproduce are basically to create a git flow like the following:
A
/ \
B C
\ /
D (<- merge conflict, + make additions to the file)
|
E
Example Project
See the two following commit lists:
- https://gitlab.com/melkamar/merge-commit-not-shown/commits/master
- https://gitlab.com/melkamar/merge-commit-not-shown/commits/master/README.md
What is the current bug behavior?
There is only a single file in the whole repository and all the commits touch that file in some way. Yet, in the second link, the commit D
is missing.
What is the expected correct behavior?
I would expect the commit D
to be shown in the history of commits. With the current behavior some changes to the file cannot be found by navigating the history of the file.
Output of checks
This happens both on gitlab.com and on our private instance.