-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
base: main
Are you sure you want to change the base?
Changes from all commits
a2cab56
0c20c40
1acf8d9
a3c3d1b
54150fb
4752c50
9e68dd9
6f5356b
12ae847
53ed453
bc384be
c52e709
b99d826
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
if test "$1" = "--all"; then | ||
if test "$1" = "--all" || test "$1" = "-a"; then | ||
git shortlog -n -s | awk '{print substr($0,index($0,$2)) " (" $1 ")"}' | ||
echo | ||
elif test "$1" = "--full" || test "$1" = "-f"; then | ||
git rev-list --all --tags --branches --full-history --no-max-parents --no-min-parents --count | ||
else | ||
echo total "$(git rev-list --count HEAD)" | ||
fi | ||
|
||
echo total "$(git rev-list --count HEAD)" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ _git_contrib(){ | |
} | ||
|
||
_git_count(){ | ||
__gitcomp "--all" | ||
__gitcomp "--all --full -a -f" | ||
} | ||
|
||
__git_cp(){ | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ git-count(1) -- Show commit count | |
|
||
## SYNOPSIS | ||
|
||
`git-count` [--all] | ||
`git-count` [-a|--all] [-f|--full] | ||
|
||
## DESCRIPTION | ||
|
||
|
@@ -12,6 +12,7 @@ git-count(1) -- Show commit count | |
## OPTIONS | ||
|
||
--all | ||
--full | ||
|
||
Show commit count details. | ||
|
||
|
@@ -23,6 +24,12 @@ git-count(1) -- Show commit count | |
$ git count | ||
|
||
total 1844 | ||
|
||
Output full commits total: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add more words to explain the difference between the regular total and the full total. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The regular total count from current commit to the first one and the full total count all commits available at repository. |
||
|
||
$ git count --full | ||
|
||
1904 | ||
|
||
Output verbose commit count details: | ||
|
||
|
There was a problem hiding this comment.
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
.There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.