mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
git-summary: fix incorrect active days when commits range is given
Previous when commits range is given, we count the active days of whole history because we didn't pass the argument.
This commit is contained in:
parent
ff991ac99e
commit
3e8c3ab0c4
|
|
@ -36,7 +36,7 @@ project=${PWD##*/}
|
|||
#
|
||||
|
||||
date() {
|
||||
git log --pretty='format: %ai' $1 | cut -d ' ' -f 2
|
||||
git log --pretty='format: %ai' "$1" | cut -d ' ' -f 2
|
||||
}
|
||||
|
||||
#
|
||||
|
|
@ -44,7 +44,7 @@ date() {
|
|||
#
|
||||
|
||||
active_days() {
|
||||
date $1 | sort -r | uniq | awk '
|
||||
date "$1" | sort -r | uniq | awk '
|
||||
{ sum += 1 }
|
||||
END { print sum }
|
||||
'
|
||||
|
|
@ -171,7 +171,8 @@ if [ -n "$SUMMARY_BY_LINE" ]; then
|
|||
else
|
||||
|
||||
echo " repo age :" $(repository_age)
|
||||
echo " active :" $(active_days) days
|
||||
# shellcheck disable=SC2086
|
||||
echo " active :" "$(active_days $commit)" days
|
||||
echo " commits :" $(commit_count)
|
||||
if test "$commit" = ""; then
|
||||
echo " files :" "$(file_count)"
|
||||
|
|
|
|||
Loading…
Reference in a new issue