Skip to content

Instantly share code, notes, and snippets.

@vindia
Last active October 20, 2017 13:34
Show Gist options
  • Save vindia/4560140 to your computer and use it in GitHub Desktop.
Save vindia/4560140 to your computer and use it in GitHub Desktop.
Simple Ruby + Git script to get a commit leaderboard for your repository.
def leaderboard(project)
leaderboard = []
committers = `cd ~/#{project}; git checkout master; git shortlog -nse --no-merges --since={last.month}`
committers.split("\n").each do |committer|
c = committer.split("\t")
leaderboard.push name: c.last.split('<').first.strip, values: [c.first.to_i]
end
leaderboard
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment