2

I have to analyze a git repository. Thus I want to ask that is there any command in git that can do following things:

  1. Calculate number of commit times of each author/committer in a specific directory
  2. From past to present, average number of files and type of file that developers have in a specific directory?
Sergey K.
25.5k14 gold badges111 silver badges176 bronze badges
asked Oct 5, 2012 at 9:29

1 Answer 1

3
  1. git shortlog -sn -- FolderName
  2. Not sure what you mean here - 'Average number of files'? On a per commit basis - git log --stat can 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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.