Skip to contentSkip to conversation

merges and git log --stat

DISCUSSION SZEDER Gábor 2 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

I've just noticed that 'git log --stat' does not print the diffstat for merge commits. Is this intentional?

Thanks,
Gábor

#1 lore raw
Quoted 2 lines · SZEDER Gábor

I've just noticed that 'git log --stat' does not print the diffstat for merge commits. Is this intentional?

It's very much designed so. You cannot clearly define "diff from which parent you would want to see".

#2 lore raw

That was fast, thank you.

Quoted 7 lines · Junio C Hamano
Quoted 2 lines · SZEDER Gábor

I've just noticed that 'git log --stat' does not print the diffstat for merge commits. Is this intentional?

It's very much designed so. You cannot clearly define "diff from which parent you would want to see".

I see. Perhaps it would make sense to show the diffstat from the point of view of the first parent, but maybe I'm biased by my current use case. Anyway, it seems that I can easily get what I need with a bit of scripting, so it's not a major issue.

Best,
Gábor

#3 lore raw
Quoted 2 lines · SZEDER Gábor

.. Anyway, it seems that I can easily get what I need with a bit of scripting, so it's not a major issue.

Yes, you would need to script it if you count adding "--first-parent -m" on the command line as "scripting" ;-)

	$ git log --stat --first-parent -m