Skip to content
Snippets Groups Projects

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)

Original

New behavior:

New Version

Relevant issues: #2532 (closed) #2802 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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
  • @stanhu @Julusian wait. commit_count is cached value that can be calculated in background job. Because for Linux repo it can easily take 20-30 seconds. With this change people will get 502 timeout on commits page constantly for huge repositories like Linux

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

  • Assignee removed

  • username-removed-200776 Status changed to closed

    Status changed to closed

  • 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

  • Please register or sign in to reply
    Loading