Project

General

Profile

Actions

Patch #9498

closed

[git adapter] git doesn't show all the branches

Added by Alexander Jipa over 13 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
2011-10-31
Due date:
% Done:

0%

Estimated time:
0.25 h

Description

Git is not showing all the branches for the repo.
For example it won't show the remote branches at all.

The workaround is to patch git_adapter.rb file like so:

def branches
          return @branches if @branches
          @branches = []
-         cmd_args = %w|branch --no-color|
+         cmd_args = %w|branch -a --no-color|
          scm_cmd(*cmd_args) do |io|
            io.each_line do |line|
              @branches << line.match('\s*\*?\s*(.*)$')[1]
            end
          end
          @branches.sort!
        rescue ScmCommandAborted
          nil
        end

That way after next changesets fetch all the branches with their revisions will be available in the Repository tab.

Affected versions:
Redmine 1.2.1.stable.7547 (MySQL)

Actions #1

Updated by Toshi MARUYAMA over 13 years ago

  • Status changed from New to Closed

I can not accept this patch.
Redmine requires bare repository.
And Redmine must treat only normal branches.

ChiliProject (Redmine 1.1) repository browser is very dirty.
https://www.chiliproject.org/issues/527

Actions #2

Updated by Alexander Jipa over 13 years ago

  • Assignee set to Toshi MARUYAMA

Still it works perfectly for bare repository with that change.
BTW what do you mean by the normal branches? They are ALL normal because the branch is just a reference to the latest commit hence they are still there.
There could have been at least an option for turning this functionality on in the repository settings.

Actions #3

Updated by Toshi MARUYAMA over 13 years ago

  • Assignee deleted (Toshi MARUYAMA)
Actions #4

Updated by Toshi MARUYAMA over 13 years ago

Alexander Jipa wrote:

BTW what do you mean by the normal branches?

refs/heads/*

Actions #5

Updated by Toshi MARUYAMA over 13 years ago

As I described at https://www.chiliproject.org/issues/527 ,
Chili repository browser has many garbage revisions.

https://www.chiliproject.org/projects/chiliproject/repository/revisions/f0ee771f7e2c109071de473618edbf47f35727da

Not bare repository (with working tree) has many garbage revisions.
So, git users need to run "git gc".

Redmine is project management software.
It should use shared repository.
Git shared repository is bare repository.

Actions

Also available in: Atom PDF