If I do git log <commit-id> --stat
or git diff
with --stat
, I get something like:
myproj/src/__main__.py | 1 +
myproj/{ => src}/utils.py | 0
myproj/{ => src}/web.py | 31 ++++-
3 files changed, 29 insertions(+), 3 deletions(-)
The number next to each file is: number_of_inserts + number_of_deletes
. This is not what I want. I want to know the number of lines added and deleted for each file (e.g. +28 -3
instead of 31
).
- I know I could use
--numstat
instead of--stat
, but--numstat
will not produce the histogram. I also know that I can use
diffstat
. For example,git diff <commit-id> | diffstat -f4 -C
:myproj/src/__main__.py | 1 1 0 + myproj/src/web.py | 31 28 3 ++++- 2 files changed, 29 insertions(+), 3 deletions(-)
But here I lose information about file moves/renames (e.g.
myproj/{ => src}/web.py
).
So how can I get output similar to --stat
, but with information about the number of lines added and the number of lines deleted for each file?