diff --git a/bin/git-summary b/bin/git-summary index d8e568ef3..718fb20ef 100755 --- a/bin/git-summary +++ b/bin/git-summary @@ -13,6 +13,7 @@ SUMMARY_BY_LINE= DEDUP_BY_EMAIL= MERGES_ARG= OUTPUT_STYLE= +AUTHOR_COMMIT_LIMIT=0 for arg in "$@"; do case "$arg" in --line) @@ -28,6 +29,10 @@ for arg in "$@"; do OUTPUT_STYLE="$2" shift ;; + --author-commit-limit) + AUTHOR_COMMIT_LIMIT="$2" + shift + ;; -*) >&2 echo "unknown argument $arg found" exit 1 @@ -143,9 +148,14 @@ format_authors() { # author name. However, Linux column utility will escape tab if separator # specified, so we do unesaping after it. LC_ALL=C awk ' + BEGIN { + commitLimit = strtonum('"${AUTHOR_COMMIT_LIMIT}"'); + } { args[NR] = $0; sum += $0 } END { for (i = 1; i <= NR; ++i) { + if (strtonum(args[i]) < commitLimit) + break; printf "%s♪%2.1f%%\n", args[i], 100 * args[i] / sum } } diff --git a/man/git-summary.1 b/man/git-summary.1 index c5a42c748..e0293c37b 100644 --- a/man/git-summary.1 +++ b/man/git-summary.1 @@ -4,7 +4,7 @@ .SH "NAME" \fBgit\-summary\fR \- Show repository summary .SH "SYNOPSIS" -\fBgit\-summary\fR [\-\-dedup\-by\-email] [\-\-no\-merges] [] +\fBgit\-summary\fR [\-\-dedup\-by\-email] [\-\-no\-merges] [\-\-author\-commit\-limit ] [] .P \fBgit\-summary\fR \-\-line [] .SH "DESCRIPTION" @@ -38,6 +38,10 @@ $ git summary \-\-dedup\-by\-email .P Exclude merge commits\. .P +\-\-author\-commit\-limit +.P +Omit authors with less than authored commits from author listing\. Defaults to zero\. +.P \-\-line .P Summarize with lines other than commits\. When \fB\-\-line\fR is specified, the last argument is treated as \. diff --git a/man/git-summary.html b/man/git-summary.html index 11d10bc0b..67dcdc78f 100644 --- a/man/git-summary.html +++ b/man/git-summary.html @@ -77,7 +77,7 @@

NAME

SYNOPSIS

-

git-summary [--dedup-by-email] [--no-merges] [<committish>]

+

git-summary [--dedup-by-email] [--no-merges] [--author-commit-limit <count>] [<committish>]

git-summary --line [<path>]

@@ -114,6 +114,10 @@

OPTIONS

Exclude merge commits.

+

--author-commit-limit <count>

+ +

Omit authors with less than <count> authored commits from author listing. Defaults to zero.

+

--line

Summarize with lines other than commits. diff --git a/man/git-summary.md b/man/git-summary.md index 9b277b907..5f69bb9f7 100644 --- a/man/git-summary.md +++ b/man/git-summary.md @@ -3,7 +3,7 @@ git-summary(1) -- Show repository summary ## SYNOPSIS -`git-summary` [--dedup-by-email] [--no-merges] [<committish>] +`git-summary` [--dedup-by-email] [--no-merges] [--author-commit-limit <count>] [<committish>] `git-summary` --line [<path>] @@ -39,6 +39,10 @@ Shows a summary of the repository or a path within it. Exclude merge commits. + --author-commit-limit <count> + + Omit authors with less than <count> authored commits from author listing. Defaults to zero. + --line Summarize with lines other than commits.