Show commit count for current branch/ref on project commits page
Previously the badge would show the number of commits for the primary branch in the project. Now it shows the commit count for the branch/tag/ref currently being viewed.
Previous behavior: (master branch had 594 commits)
New behavior:
Relevant issues: #2532 (closed) #2802 (closed)
Merge request reports
Activity
@stanhu I have pushed a rebased version
Reassigned to @dzaporozhets
152 152 gitlab_shell.rm_tag(path_with_namespace, tag_name) 153 153 end 154 154 155 def ref_commit_count(ref) 156 begin 157 raw_repository.commit_count(ref) 158 rescue 159 commit_count 160 end 161 end 162 @dzaporozhets Ah yeah, I didn't think of that. It doesn't look like it will be hard to modify it to cache more count values. I think it would be best to cache the values for branches and tags, as trying to cache values for each commit ref would bloat the cache, unless you think that would be fine. So for such refs what would make more sense, always showing the primary branch count or 0?
@Julusian 0 is not quite accurate as it gives wrong impression: empty repo? no commits but I see a lot, etc
Is it me or is the count of current branch still showing the default branch (mostly master)
If it's not me when will it be available as update (through apt-get)?
Edited by username-removed-433460@arjan.spieard This was not merged as it was pointed out to me that performance of my change was an issue, and I have not had time to rectify it