-
-
Notifications
You must be signed in to change notification settings - Fork 23.9k
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
fix: wip fix total commit counts #211
Conversation
Codecov Report
@@ Coverage Diff @@
## master #211 +/- ##
==========================================
- Coverage 94.86% 94.28% -0.58%
==========================================
Files 16 16
Lines 467 490 +23
Branches 123 130 +7
==========================================
+ Hits 443 462 +19
- Misses 20 24 +4
Partials 4 4
Continue to review full report at Codecov.
|
I think when |
Doesn't show up in mine for some reason |
Oh weird, maybe i uploaded the wrong screenshot. my bad |
Hey @anuraghazra , thanks, Can we have both of them? like this |
Good idea, but i'm not sure i would do that, it seems kinda redundant. |
Just to be sure about this code: github-readme-stats/src/fetchStats.js Lines 121 to 126 in ff292f2
I though Aren't you counting the same commits 2 times ? |
#298 feel free to send a PR |
Sure! I will try to send a PR this weekend if I find some time Edit: see #391 |
total commits current has a bug where it's not properly counting commits, but it gives me a better rating lmao. Hoping for fix soon: anuraghazra/github-readme-stats#211 anuraghazra/github-readme-stats#298
fixes #14
fixes #92
closes #15
Currently github readme stats can only fetch total commits of 1year max, because of limitations of Github API mentioned in here #14 (comment) but we can fix it by brute forcing and looping over all the years to accumulate total commits of a user as we did in #15
But there are downsides of this approach in terms on performance because we are looping over all the years and calling the GraphQL Api each time
The fix
So as mentioned by @kingthorin in this comment #15 (comment) instead of showing "Total commits" we would show "Total Commits (2020)" in order to eliminate any confusion.
And as mentioned in this #92 (comment) by @adamyi Github has a experimental REST endpoint to fetch all the commits which we can utilize nicely.
We've added a new flag "include_all_commits" which would fetch the total commits of a user if enabled otherwise we will show only the last year commits (which is current behaviour)
Screenshots
@rampatra issue #92
&include_all_commits=true
&include_all_commits=false
@anshumanv issue #14
&include_all_commits=true
&include_all_commits=false
NOTE: As mentioned in github's documentation https://developer.github.com/v3/search/#search-commits this API is experimental and the API may change without advance notice during the preview period.
TODO: