From c6f1a3eb3b91b4cbdc49b574126718a3765c023a Mon Sep 17 00:00:00 2001 From: Leila Muhtasib Date: Mon, 11 Jun 2012 13:23:57 -0400 Subject: [PATCH] Added repo age to git-summary. Shows intitial date of first commit and how long ago that was in parentheses. --- bin/git-summary | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/bin/git-summary b/bin/git-summary index a27a03d..cb5d116 100755 --- a/bin/git-summary +++ b/bin/git-summary @@ -54,15 +54,24 @@ authors() { ' } +# +# fetch repository age from oldest commit +# + +repository_age() { + git log --reverse --pretty=oneline --format="%cd (%cr)" | head -n 1 +} + # summary echo -echo " project: $project" -echo " commits:" $(commit_count) -echo " active :" $(active_days) days +echo " project : $project" +echo " repo age:" $(repository_age) +echo " commits :" $(commit_count) +echo " active :" $(active_days) days if test "$commit" = ""; then - echo " files :" $(file_count) + echo " files :" $(file_count) fi -echo " authors: " +echo " authors : " authors echo