Defect #9128

Redmine sugestion of the git repository path is incorrect

Added by Tomas Pospisek over 6 years ago. Updated about 6 years ago.

Status:ClosedStart date:2011-08-25
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:SCM
Target version:-
Resolution:Invalid Affected version:

Description

See http://www.redmine.org/boards/2/topics/25889

Redmine suggests that the path to the git repository should look like this:

"Bare and local repository (e.g. /gitrepo, c:\gitrepo)"

however that will result in a weird error (see the Forum thread above), when in reality the path should look like this instead:

"Bare and local repository (e.g. /gitrepo/.git, c:\gitrepo\.git)"

I'd suggest to fix the code and automatically add the ".git" when it's missing, aka in lib/redmine/scm/adapters/git_adapter.rb in the function scm_cmd I suggest to do:

full_args = [GIT_BIN, '--git-dir', (repo_path =~ /\.git$/ ?  repo_path : File.join(repo_path, '.git') ) ]

instead.

I can't understand how Redmine users would succeed to access their git repos from Redmine in the past without loosing hald of their hair?


Related issues

Related to Redmine - Patch #9129: Improve wording of Git repository note at project setting Closed 2011-08-26

History

#1 Updated by Toshi MARUYAMA over 6 years ago

  • Status changed from New to Closed
  • Estimated time deleted (0.50)
  • Resolution set to Invalid

You need to use bare repository.
I confirmed to pass tests on Mingw Ruby and Windows JRuby.

#2 Updated by Tomas Pospisek over 6 years ago

You need to use bare repository.
I confirmed to pass tests on Mingw Ruby and Windows JRuby.

I do not understand.

If I do use the bare the repository it does not work on Windows. I have to use the */.git form.

Could you please explain how it is possible that I have to work the bare repository and then, if I really do use it, it doesn't work?

#3 Updated by Tomas Pospisek over 6 years ago

  • Status changed from Closed to Reopened
  • Assignee set to Toshi MARUYAMA

I'm not sure you got my reply, so I'm assigning to you and repeating what I've written:

You need to use bare repository. I confirmed to pass tests on Mingw Ruby and Windows JRuby.

I do not understand.

If I do use the bare the repository it does not work on Windows. I have to use the */.git form.

Could you please explain how it is possible that I have to work the bare repository and then, if I really do use it, it doesn't work?

#4 Updated by Toshi MARUYAMA over 6 years ago

  • Status changed from Reopened to Closed
$ git init not-bare
Initialized empty Git repository in /tmp/test00/not-bare/.git/
$ git init --bare bare
Initialized empty Git repository in /tmp/test00/bare/

#5 Updated by Toshi MARUYAMA over 6 years ago

  • Assignee deleted (Toshi MARUYAMA)

#6 Updated by Tomas Pospisek over 6 years ago

  • Status changed from Closed to Reopened

Sorry, I can't see how "git init --bare" is relevant to this discussion.

Redmine just doesn't work with a local git repository I'd initialized. Please see http://www.redmine.org/boards/2/topics/25889

The git repository I'm talking about does contain a .git directory with git's own data in it. So it's not bare by any means.

Redmine uses the follwing command to find out about branches inside the repository:

"C:\Programm Files\Git\bin\git.exe" "--git-dir" "c:/git_repository/cfm-cmm/" "-c" "core.quotepath=false" "-c" "log.decorate=no" "branch" "--no-color" 

However that doesn't work. This instead works:

"C:\Programm Files\Git\bin\git.exe" "--git-dir" "c:/git_repository/cfm-cmm/.git" "-c" "core.quotepath=false" "-c" "log.decorate=no" "branch" "--no-color" 

If you could explain me why Redmine + Git fails to work here when used as suggested by you then we could probably close this issue for good.

#7 Updated by Toshi MARUYAMA over 6 years ago

  • Status changed from Reopened to Closed

You need to learn what bare repository is.

This is Redmine issue tracker, not supporting.
You need to use Redmine forum, or other web site.

#8 Updated by Brendan Loya about 6 years ago

SPAM

Also available in: Atom PDF