From fe2df31c360c8893263bc3e59c9dcd1ec124b79e Mon Sep 17 00:00:00 2001 From: Ben Cotton Date: Thu, 19 Sep 2024 11:57:38 -0400 Subject: [PATCH] Address review feedback * Indicate how we're sorting new contributors * Don't fork for `date` checks * Include reference in the manpage Signed-off-by: Ben Cotton --- git-quick-stats | 6 +++--- git-quick-stats.1 | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/git-quick-stats b/git-quick-stats index 5ced56a..9244623 100755 --- a/git-quick-stats +++ b/git-quick-stats @@ -276,7 +276,7 @@ function showMenu() { printf %b "${NUMS} 8)${TEXT} Branch tree view (last $_limit)\\n" printf %b "${NUMS} 9)${TEXT} All branches (sorted by most recent commit)\\n" printf %b "${NUMS} 10)${TEXT} All contributors (sorted by name)\\n" - printf %b "${NUMS} 11)${TEXT} New contributors\\n" + printf %b "${NUMS} 11)${TEXT} New contributors (sorted by email)\\n" printf %b "${NUMS} 12)${TEXT} Git commits per author\\n" printf %b "${NUMS} 13)${TEXT} Git commits per date\\n" printf %b "${NUMS} 14)${TEXT} Git commits per month\\n" @@ -1036,7 +1036,7 @@ if [[ "$#" -eq 1 ]]; then # what people may try. This script doesn't provide any additional # output for a bad date since `date`'s STDERR already contains # useful information. - if [ ! $(date -d "${newDate}" +%s) ]; then + if ! date -d "${newDate}" +%s > /dev/null 2>&1; then newDate="" fi done @@ -1124,7 +1124,7 @@ while [[ "${opt}" != "" ]]; do while [[ -z "${newDate}" ]]; do read -r -p "Since what date? " newDate # Test if the date provide is valid and try again if it isn't. - if [ ! $(date -d "${newDate}" +%s) ]; then + if ! date -d "${newDate}" +%s > /dev/null 2>&1; then newDate="" fi done diff --git a/git-quick-stats.1 b/git-quick-stats.1 index 55a05f6..f9ea257 100644 --- a/git-quick-stats.1 +++ b/git-quick-stats.1 @@ -70,6 +70,11 @@ show branches by date see a list of everyone who contributed to the repo .HP .PP +\fB\-n\fR, \fB\-\-new\-contributors\fR +.IP +list everyone who made their first contribution since a specified date +.HP +.PP \fB\-a\fR, \fB\-\-commits\-per\-author\fR .IP displays a list of commits per author