mirror of
https://github.com/tj/git-extras.git
synced 2026-09-13 00:46:26 -04:00
Added option --no-merges to git summary
This commit is contained in:
parent
3821b2c537
commit
3c632d9e32
|
|
@ -5,6 +5,7 @@ cd "$(git root)" || { echo "Can't cd to top level directory";exit 1; }
|
|||
|
||||
SUMMARY_BY_LINE=
|
||||
DEDUP_BY_EMAIL=
|
||||
MERGES_ARG=
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--line)
|
||||
|
|
@ -13,6 +14,9 @@ for arg in "$@"; do
|
|||
--dedup-by-email)
|
||||
DEDUP_BY_EMAIL=1
|
||||
;;
|
||||
--no-merges)
|
||||
MERGES_ARG="--no-merges"
|
||||
;;
|
||||
-*)
|
||||
>&2 echo "unknown argument $arg found"
|
||||
exit 1
|
||||
|
|
@ -42,7 +46,7 @@ project=${PWD##*/}
|
|||
date() {
|
||||
# the $1 can be empty
|
||||
# shellcheck disable=SC2086
|
||||
git log --pretty='format: %ai' $1 | cut -d ' ' -f 2
|
||||
git log $MERGES_ARG --pretty='format: %ai' $1 | cut -d ' ' -f 2
|
||||
}
|
||||
|
||||
#
|
||||
|
|
@ -63,7 +67,7 @@ active_days() {
|
|||
|
||||
commit_count() {
|
||||
# shellcheck disable=SC2086
|
||||
git log --oneline $commit | wc -l | tr -d ' '
|
||||
git log $MERGES_ARG --oneline $commit | wc -l | tr -d ' '
|
||||
}
|
||||
|
||||
#
|
||||
|
|
@ -193,9 +197,9 @@ else
|
|||
if [ -n "$DEDUP_BY_EMAIL" ]; then
|
||||
# the $commit can be empty
|
||||
# shellcheck disable=SC2086
|
||||
git shortlog -n -s -e $commit | dedup_by_email | format_authors
|
||||
git shortlog $MERGES_ARG -n -s -e $commit | dedup_by_email | format_authors
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
git shortlog -n -s $commit | format_authors
|
||||
git shortlog $MERGES_ARG -n -s $commit | format_authors
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue