git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git log --merges doesn't show commits as expected
@ 2015-11-13 16:21 Dominik Rauch
  2015-11-13 22:35 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Rauch @ 2015-11-13 16:21 UTC (permalink / raw)
  To: git@vger.kernel.org

Hello!
 
(This is my first post to this mailing list and I couldn't find a FAQ section - please excuse me, if I haven't followed all the established posting guidelines yet.)

I have the following repository tree:

C
|\
| B
| /
A

Commit A: Parents=(). Initial commit. Contains file foo with content "ABC".
Commit B: Parents=(A). Represents a commit on some feature branch. Contains file foo with content "XYZ".
Commit C: Parents=(A, B). Represents a merge commit of a feature branch back to the main branch. Contains file foo with content "XYZ".

I expected "git log --merges foo" to show C, however, the log is empty! Specifying "--full-history" results in the correct history, therefore I assume, I misunderstand Git's default history simplification algorithm. Unfortunately, the example in the Git docs at [1] does not contain the very same situation (although it is probably one of the most common situations...).

Does anybody know why I don't see the log output I expect? I'm confused...even if the log output is correct, I don't think it follows the principle of least surprise...

Side note: specifying "--first-parent" also results in commit C being shown.

Best regards,
Dominik

PS: This is a cross post of [2], somebody noted it could be a bug, which is why I decided to post to this mailing list.

[1] https://git-scm.com/docs/git-log#_history_simplification 
[2] http://stackoverflow.com/q/33695763/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-13 22:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-13 16:21 git log --merges doesn't show commits as expected Dominik Rauch
2015-11-13 22:35 ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).