8

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

kelloti
  • 8,705
  • 5
  • 46
  • 82
Stewie Griffin
  • 9,257
  • 22
  • 70
  • 97

5 Answers5

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

Tyler
  • 21,762
  • 11
  • 61
  • 90
looneydoodle
  • 369
  • 6
  • 26
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.

markmc
  • 3,692
  • 2
  • 16
  • 7
2

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

Philip Potter
  • 8,975
  • 2
  • 37
  • 47
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

eckes
  • 64,417
  • 29
  • 168
  • 201
  • 3
    Use alt+printscreen to copy a screenshot of just the current window to your clipboard. – Thom Wiggers Feb 22 '11 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 Feb 22 '11 at 14:43
  • 1
    ah, ok. I thought you didn't, as I see some borders :D – Thom Wiggers Feb 22 '11 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 Feb 22 '11 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... – Thomas Hunter II Sep 30 '11 at 17:57
1

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

Community
  • 1
  • 1
Ruslan Kabalin
  • 6,580
  • 2
  • 28
  • 20