Patch #27559

Default branch should be always first in the graph

Added by Maciek Dems about 5 years ago. Updated about 5 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


In the revisions view, the branches graph shows neat lines for every branch. The branches in this are sorted alphabetically. However, it is much more natural to keep the default branch leftmost all the time, so it is always a straight line. It is how e.g. the network graph in github works.

The attached patch changes the sorting of the branches to ensure, the default branch is always first.

master_branch_always_first_in_graph.patch Magnifier (514 Bytes) Maciek Dems, 2017-11-18 09:28


#1 Updated by Toshi MARUYAMA about 5 years ago

You also need to implement in Mercurial.

ActionView::Template::Error (undefined method `is_default' for "default":Redmine::Scm::Adapters::Branch):
    1: <div class="autoscroll">
    2: <% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %>
    3: <%= if show_revision_graph && revisions && revisions.any?
    4:     indexed_commits, graph_space = index_commits(revisions, @repository.branches) do |scmid|
    5:                              url_for(
    6:                                :controller => 'repositories',
    7:                                :action => 'revision',
  app/helpers/repositories_helper.rb:281:in `block in index_commits'
  app/helpers/repositories_helper.rb:281:in `each'
  app/helpers/repositories_helper.rb:281:in `sort_by'
  app/helpers/repositories_helper.rb:281:in `sort_by!'
  app/helpers/repositories_helper.rb:281:in `index_commits'
  app/views/repositories/_revisions.html.erb:4:in `_app_views_repositories__revisions_html_erb__4466816342598385941_70348597528700'
  app/views/repositories/show.html.erb:19:in `_app_views_repositories_show_html_erb___1486259103309881441_49894440'
  app/controllers/repositories_controller.rb:97:in `show'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Also available in: Atom PDF