You can see part of the answer: When the foo branch was merged into master , it created a new commit (7e8d68) with two parents.
But when bar was merged into master , it was a quick switch. That is, all the commits on bar were newer than the newest work on master , so they could simply be attached to the end.
This simplifies the layout, and therefore this is the default behavior. But he does not leave a record of the merge - as far as your story is concerned, it will look as if these commits were made to master in the first place.
To get around this, you can explicitly specify git to avoid smoothing fast forward, i.e. each single merger should result in a merger with two parents, even if an accelerated merger were possible. To do this, simply use the --no-ff flag in the git merge command.
Unfortunately, due to the fact that changing the merge, rather than logging the behavior, you will not be able to do this retroactively - the information from your previous smoothing fast forward does not exist, therefore there is no way to get git log to display it.
Etaoin
source share