I have to analyze a git repository. Thus I want to ask that is there any command in git that can do following things:
- Calculate number of commit times of each author/committer in a specific directory
- From past to present, average number of files and type of file that developers have in a specific directory?
1 Answer 1
git shortlog -sn -- FolderName- Not sure what you mean here - 'Average number of files'? On a per commit basis -
git log --statcan show that files were touched in each commit. Maybe some parsed version of that is what you mean. If you are after examining code churn by user this is the way to go. For instance, the following will create a file that has one line per commit with who did it and how many lines and files were changed. You can then process this to produce graphs.
#!/bin/bash
for id in $(git rev-list HEAD)
do
git log -n 1 --shortstat --format='%h %at %ae' $id | paste - - - -
done
answered Oct 5, 2012 at 10:11
patthoyts
33.4k3 gold badges66 silver badges101 bronze badges
Sign up to request clarification or add additional context in comments.