Incorrect commit count on Repository > Details
Summary
A customer noticed that the Repo's commit count in the overview differed from the commit count for the contributor mini graphs.
- The Repository > Details > Commit Count is using the saved Project Statistics
- The Repository > Contributors graphs are built by querying the repository directly for commits and counting those
Detail
It appears that the project stats will also use the cached values of the repository when it is refreshed (there is a lot of caching at the repository level). This could also potentially lead to some stale info in the updated stats if the cached value is already old when the stats are updated. The discrepancy here is a combination of the project's associated stats being out of sync and caching in the repository, as well as the fact that the graphs bypass the cache completely and have the most up-to-date information about the repository.
The issue is that the further commit data is needed to populate the graphs (author name, email and date) and this cannot currently be pulled from the stats object so as to remain in sync.
Therefore the commit count in the graph is actually the most accurate, as the customer already noticed, and with the current implementation it will often by out of sync whilst the stats are refreshed.
cc// @markglenfletcher