From eb5c0df0016d4ae341aff462efc2377137f55d05 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Mon, 23 Aug 2010 10:11:06 -0700 Subject: [PATCH] Added git-contrib --- Makefile | 1 + Readme.md | 60 +++++++++++++++++++++++++++++++------------------ bin/git-contrib | 10 +++++++++ 3 files changed, 49 insertions(+), 22 deletions(-) create mode 100755 bin/git-contrib diff --git a/Makefile b/Makefile index 421f1d2..e923e6f 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ BINS = \ git-repl \ git-commits-since \ git-summary \ + git-contrib \ git-release install: diff --git a/Readme.md b/Readme.md index 5f168ac..d4cb87c 100644 --- a/Readme.md +++ b/Readme.md @@ -17,34 +17,50 @@ - git delete-tag - git ignore - git release + - git contrib - git repl +## git-contrib + +Output a user's contributions to a project, based on the author name: + + $ git contrib visionmedia + visionmedia (18): + Export STATUS_CODES + Replaced several Array.prototype.slice.call() calls with Array.prototype.unshift.call() + Moved help msg to node-repl + Added multiple arg support for sys.puts(), print(), etc. + Fix stack output on socket error + ... + ## git-summary Outputs a repo summary: - project: express - commits: 1893 - files : 111 - authors: - 1285 visionmedia - 478 Tj Holowaychuk - 48 Aaron Heckmann - 34 csausdev - 26 ciaranj - 6 Guillermo Rauch - 3 Nick Poulden - 2 Brian McKinney - 2 Benny Wong - 1 Justin Lilly - 1 James Herdman - 1 Adam Sanderson - 1 Viktor Kelemen - 1 Gregory Ritter - 1 Greg Ritter - 1 ewoudj - 1 isaacs - 1 Matt Colyer + $ git summary + + project: express + commits: 1893 + files : 111 + authors: + 1285 visionmedia + 478 Tj Holowaychuk + 48 Aaron Heckmann + 34 csausdev + 26 ciaranj + 6 Guillermo Rauch + 3 Nick Poulden + 2 Brian McKinney + 2 Benny Wong + 1 Justin Lilly + 1 James Herdman + 1 Adam Sanderson + 1 Viktor Kelemen + 1 Gregory Ritter + 1 Greg Ritter + 1 ewoudj + 1 isaacs + 1 Matt Colyer ## git-repl diff --git a/bin/git-contrib b/bin/git-contrib new file mode 100755 index 0000000..15b7500 --- /dev/null +++ b/bin/git-contrib @@ -0,0 +1,10 @@ +#!/bin/sh + +user=$1 +if test -z "$user"; then + echo "user name required." && exit 1 +else + count=`git log --oneline --pretty="format: %an" | grep "$user" | wc -l` + test $count -eq 0 && echo "$user did not contribute." && exit 1 + git shortlog | grep $user -A $count +fi \ No newline at end of file