Patch #986

Clone remote git repository

Added by Michael Bumann over 11 years ago. Updated over 7 years ago.

Status:ClosedStart date:2008-04-03
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:SCM
Target version:-

Description

this patch clones the repository of a remote GIT repository.
enter the public clone URL (git://..../.git) it will clone it to RAILS_ROOT/repositories/git/<project identifier>/<repository name>
It also changes the URL to use the local clone.

clone_remote_git.diff Magnifier (1.68 KB) Michael Bumann, 2008-04-03 19:27


Related issues

Related to Redmine - Feature #2580: Remote git repositories Closed 2009-01-25
Related to Redmine - Feature #6515: Mercurial hgrc support with issues auto-syncronizaton New 2010-09-28
Related to Redmine - Patch #1783: automatic repository creation New 2008-08-13
Related to Redmine - Patch #7494: Patch for support http protocol wirh mercurial repository Closed 2011-01-30 2011-01-30

History

#1 Updated by Jean-Philippe Lang over 11 years ago

  • Target version deleted (0.7)

#2 Updated by Thomas Lecavelier about 11 years ago

Test cases are missing. I know it wouldn't be easy but you can try to accept "not so remote" repository in tmp dir.

Not tested, but the dir variable in the diff could break if white spaces appear: please protect this var expansion in the command line with simple quotes.

#3 Updated by Toshi MARUYAMA over 7 years ago

  • Status changed from New to Closed

As I described #7494 note 2,
I think Redmine core should not have this feature.
It is impossible to test.
Plugins should provide this feature.

#4 Updated by Gabriel Mazetto over 7 years ago

Toshi MARUYAMA wrote:

As I described #7494 note 2,
I think Redmine core should not have this feature.
It is impossible to test.
Plugins should provide this feature.

It is not impossible, it can be a little tricky, but still really possible. A easy test case could be: get a dummy git bare repository in the test folder, then run git-daemon configured to provide this dummy repository. The unit test will have to add a repository from git://localhost/1.git (for example) and then check to see if the folder was correctly created and if it's a git repository.

Also there is the "git" rubygem that can make it easy to clone and fetch revisions:

require 'git'
Git.clone('git://github.com/.../repo.git', '/destination/path.git', :bare => true)

and

git = Git.open('/destination/path.git', :log => Logger.new(STDOUT))
git.fetch('origin')

It can't be easier then that. Implementing this "feature" will make redmine usable with git.

Also available in: Atom PDF