4

I see that github records the commit, add, and delete history for each contributor. You can check it on the graph tab.

However, it's not as granular as I would like.
Is it possible to get this information on the command line?
I'd like to save a more granular dataset in the form of a table.

What I'm thinking of is four arrays: Day/Date, Commits, Additions, Deletions

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
toshiomagic
  • 1,335
  • 1
  • 12
  • 39

1 Answers1

2

You can start with using the GitHub Statistics API like:

Get contributors list with additions, deletions, and commit counts

It does return:

total 

The Total number of commits authored by the contributor.

And: Weekly Hash (weeks array):

w - Start of the week, given as a Unix timestamp.
a - Number of additions
d - Number of deletions
c - Number of commits

For the command-line aspect, use curl.
See "A curl tutorial using GitHub's API "


The above was based on the tag "github", but yes, git itself can generate stats (even fancy ones like the git-stats project)

See this gist for instance, or use git log --stat, git diff --stat.
As seen here, some form of processing is needed, to use the result of a

git log --author=$USER --shortstat $BRANCH
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I would think git itself would have a way to do this independent of github. No? – toshiomagic Mar 30 '17 at 21:02
  • @toshiomagic Yes sorry, I saw the github tag and answered based on that. I have edited the answer to address the native git aspect. – VonC Mar 30 '17 at 21:08