Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added --full flag to "git-count" #1105

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
7 changes: 4 additions & 3 deletions bin/git-count
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

if test "$1" = "--all"; then
git shortlog -n -s | awk '{print substr($0,index($0,$2)) " (" $1 ")"}'
echo
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also output total for --all.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change, the output will be different.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@havocesp
This comment is not resolved yet.

elif test "$1" = "--full";then
git rev-list --all --no-max-parents --no-min-parents --count
else
echo total "$(git rev-list --count HEAD)"
fi

echo total "$(git rev-list --count HEAD)"
2 changes: 1 addition & 1 deletion etc/bash_completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ _git_contrib(){
}

_git_count(){
__gitcomp "--all"
__gitcomp "--all --full"
havocesp marked this conversation as resolved.
Show resolved Hide resolved
}

__git_cp(){
Expand Down
Loading