For certain statistical purpuses I need to precisely count the amount of characters contributed by a developer to the current state of a git repo (HEAD).
The closest I could get was this command:
wc -m `git log --no-merges --author="SomeDev" --name-only --pretty=format:"" | sort -u`
There are some problems with this approach:
- even if several people contributed to a file - all the characters will be attributed to the initial author,
- it fails in cases when a file authored by
SomeDev
was renamed at some stage.
Can git blame
be used somehow for this purpose? I see that it can track file renames on one hand, but it seems to attribute the whole line to the last committer even though he might have changed only a few characters in it, while the rest were contributed by previous committer to that line.