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
Open

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

wants to merge 13 commits into from

Conversation

havocesp
Copy link

@havocesp havocesp commented Nov 7, 2023

  • Added --full flag to count all existing commits from a local repo.

Example:

# git count without flags (count from current commit to last one)
$ git count
total 244

# git count with `--all` flag (same behaviour that previous but show a list of contributors)
$ git count --all
- James
- Foo
- Bar
243

# git count with `--full` flag (count all existing commits)
$ git count --full
277

havocesp and others added 4 commits November 7, 2023 17:46
Add --full flag to return all possible local repo commits count.
Removed echo after git command execution.
Added --full flag to "git count"
Copy link
Collaborator

@spacewander spacewander left a comment

Choose a reason for hiding this comment

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

@@ -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.

etc/bash_completion.sh Outdated Show resolved Hide resolved
Added short flags "-a" for "--all" and "-f" for "--full" to git-count.

Updated zsh and fish completion files with new flags added.
Added --full flag as possible argument and a short  example.
Added --full flag and a short example at git-count.html file.
Added --full flag and a short example at git-count.1 man page file.
@hyperupcall hyperupcall mentioned this pull request Nov 9, 2023
bin/git-count Outdated Show resolved Hide resolved
@@ -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.

Without this change, the output will be different.

havocesp and others added 3 commits December 10, 2023 05:00
@@ -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.

@havocesp
This comment is not resolved yet.

@@ -23,6 +24,12 @@ git-count(1) -- Show commit count
$ git count

total 1844

Output full commits total:
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Author

Choose a reason for hiding this comment

The 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants