From 3662dd95bf98eb2ccbb4ed8e37c337aa6e677a0d Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 8 Sep 2010 14:24:03 -0700 Subject: [PATCH 1/4] Make git-summary take an optional commitish This allows you to ask for a git summary based on a commitish, which is very useful if you have a lot of project history. For example, if you want a summary since the tag v42 $ git summary v42.. --- bin/git-summary | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/git-summary b/bin/git-summary index 9996b26..7014f09 100755 --- a/bin/git-summary +++ b/bin/git-summary @@ -1,9 +1,11 @@ #!/bin/sh +COMMITISH="" +test $# -ne 0 && COMMITISH=$@ project=${PWD##*/} commit_count=`git log --oneline | wc -l | tr -d ' '` file_count=`git ls-files | wc -l | tr -d ' '` -authors=`git shortlog -n -s` +authors=`git shortlog -n -s $COMMITISH` echo echo " project: $project" @@ -11,4 +13,4 @@ echo " commits: $commit_count" echo " files : $file_count" echo " authors: " echo "$authors" -echo \ No newline at end of file +echo From 0bc7afe27e51b1274dcf5bdd197cdf37e8de6886 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 8 Sep 2010 14:26:57 -0700 Subject: [PATCH 2/4] Add docs about git summary to Readme.mkd --- Readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Readme.md b/Readme.md index 448eb15..07b1cbf 100644 --- a/Readme.md +++ b/Readme.md @@ -67,6 +67,10 @@ Outputs a repo summary: 1 isaacs 1 Matt Colyer +This command can also take a commitish, and will print a summary for the range +of commits included in the commitish: + + $ git summary v42.. ## git-repl From 843fc7ad11bbacd226e9cd14978fb3935a0e554e Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 8 Sep 2010 14:33:48 -0700 Subject: [PATCH 3/4] Fix commit and file count in git-summary with a commitish --- bin/git-summary | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/git-summary b/bin/git-summary index 7014f09..d1333c2 100755 --- a/bin/git-summary +++ b/bin/git-summary @@ -3,14 +3,16 @@ COMMITISH="" test $# -ne 0 && COMMITISH=$@ project=${PWD##*/} -commit_count=`git log --oneline | wc -l | tr -d ' '` +commit_count=`git log --oneline $COMMITISH | wc -l | tr -d ' '` file_count=`git ls-files | wc -l | tr -d ' '` authors=`git shortlog -n -s $COMMITISH` echo echo " project: $project" echo " commits: $commit_count" -echo " files : $file_count" +if test "$COMMITISH" = ""; then + echo " files : $file_count" +fi echo " authors: " echo "$authors" echo From 7927ce0544497f76cefbf22993d8edd866ee4cef Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Wed, 8 Sep 2010 15:20:50 -0700 Subject: [PATCH 4/4] Updated AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 6e760ad..d1ac7f3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,6 +11,7 @@ Patches and Suggestions - Kenneth Reitz - Aggelos Orfanakos +- Jonathan "Duke" Leto - Domenico Rotiroti - Jason Young - Nick Campbell