8

Is there a git command to check which developer pushed the most code for all history?

2

5 Answers 5

7

I found something ,

git ls-files | xargs -n1 -d'\n' -i git-blame {} | perl -n -e '/\s\((.*?)\s[0-9]{4}/ && print "$1\n"' | sort -f | uniq -c -w3 | sort -r
User: askedrelic
Functions: perl sort uniq xargs

Prints per-line contribution per author for a GIT repository

Figures out total line contribution per author for an entire GIT repo. Includes binary files, which kind of mess up the true count.

If crashes or takes too long, mess with the ls-file option at the start:

git ls-files -x "*pdf" -x "*psd" -x "*tif" to remove really random binary files

git ls-files "*.py" "*.html" "*.css" to only include specific file types

Based off my original SVN version: http://www.commandlinefu.com/commands/view/2787/prints-total-line-count-contribution-per-user-for-an-svn-repository

http://www.commandlinefu.com/commands/view/3889/prints-per-line-contribution-per-author-for-a-git-repository

1
  • It's deprecated, any update ? Commented Aug 4, 2022 at 7:32
3

LWN publish "Who wrote 2.6.x" reports for the Linux kernel using a tool called gitdm

I've had some success using it for other projects too, it's especially useful if you want to compare the contributions of different groups of developers based on employer.

2

Github provides impact graphs. For example, here's the graph for comex/frash.

1
  • 3
    This feature is gone. The above link throws a 410 Commented Apr 25, 2014 at 16:42
2

If you're on Windows and use TortoiseGit, you can select Show Log for a repo. In the dialog coming up, select Statistics: tortoisegit_screenshot

Now you can select either raw Statistics, Commits by author and Commits by date from the drop down box in the upper right corner:

enter image description here

5
  • 3
    Use alt+printscreen to copy a screenshot of just the current window to your clipboard. Commented Feb 22, 2011 at 14:17
  • @The Guy Of Doom: I know that. I actually used that to capture the windows. But that doesn't anonymize the images and highlights what I want to show. Therefore, I have to invest some little more work...
    – eckes
    Commented Feb 22, 2011 at 14:43
  • 1
    ah, ok. I thought you didn't, as I see some borders :D Commented Feb 22, 2011 at 14:45
  • @The Guy Of Doom: now that you're telling, I can see them too. This is odd: when I paste into paint, there are no borders but when pasting into Gimp using CTRL-SHIFT-V, the borders appear. Strange stuff. When I capture the screen directrly through Gimp, no borders again... Good to know.
    – eckes
    Commented Feb 22, 2011 at 14:50
  • Looks like the GIMP shifts the image to the right X number of pixels, wrapping them around and displaying the lost pixels on the left... Commented Sep 30, 2011 at 17:57
1

As I mentioned in Determine current code distribution by author, you can easily produce that statistics using gitdm.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.