I'm doing a diffstat on my merge to see how many inserts, deletes and modifications I made like so:
git show 526162eed6 --first-parent --unified=0 | diffstat -m
This lists all the files and gives a summary at the end:
a/b/c | 10 ++++++++++
a/b/d | 5 +++++
...
10 files changed, 50 insertions(+), 10 modification(!)
However, I'd like to see all values even if they were zero:
10 files changed, 50 insertions(+), 0 deletions(-), 10 modifications(!)
How can I do this? The current workaround I have is to output a CSV via ... | diffstat -mt and manually add up the columns via awk. Is there a simpler way?
I couldn't find an option to do what you want.
diffstatis a tool producing human readable output, not intended for machine consumption.If you absolutely must parse/massage its output, you could use a very dirty hack (not recommended, can break anytime). Define shell functions:
and then: