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

count: remove usage of extra arguments for detailed display #578

Merged
merged 1 commit into from
Dec 5, 2016

Conversation

tardypad
Copy link
Contributor

When viewing detailed count information through the usage of the
--all argument, extra arguments would be also passed to the
git shortlog command (probably to be used as revisions list)
This behaviour was introduced in commit 7a60cd1.

Unfortunately the --all argument itself is passed along and results
in the counts of all refs to be displayed
This commit removed the usage of extra arguments and thus only
display the counts of the current branch

When viewing detailed count information through the usage of the
--all argument, extra arguments would be also passed to the
git shortlog command (probably to be used as revisions list)
This behaviour was introduced in commit 7a60cd1.

Unfortunately the --all argument itself is passed along and results
in the counts of all refs to be displayed
This commit removed the usage of extra arguments and thus only
display the counts of the current branch
@tardypad
Copy link
Contributor Author

Let me know if you think that it's worth keeping this behavior (being able to pass a revisions list as extra arguments after --all)
I will just make sure that "--all" is not passed as well
This behaviour was not documented so far, so we will need to update that too then.

@tardypad
Copy link
Contributor Author

I just saw that the initial commit was actually made with a shift before which then prevented this issue.
But this was surprisingly removed "on purpose" in aefe5c0 😕

@tardypad
Copy link
Contributor Author

tardypad commented Dec 4, 2016

Any thoughts on this?

If it was not clear, I'll put a more concrete example here
This shows the behavior issue of the current git count command

repo$ git init
repo (master) $ git commit --allow-empty --author "Foo <foo>" -m "commit 1"
repo (master) $ git commit --allow-empty --author "Foo <foo>" -m "commit 2"
repo (master) $ git count --all
Foo (2)
total 2
repo (master) $ git checkout -b new_branch
repo (new_branch) $ git commit --allow-empty --author "Foo <foo>" -m "commit 3"
repo (new_branch) $ git checkout master
repo (master) $ git count --all
Foo (3)
total 2

As you can see the result of the last command is problematic
The first part is the commits count calculated among all the branches,
whereas the total is only about the commits of the current branch

@spacewander spacewander merged commit 15ae263 into tj:master Dec 5, 2016
@spacewander
Copy link
Collaborator

Merged. Thanks!

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.

2 participants