When it comes to private repositories, there are a couple of problems with the current implementation in DrushMakeDownload_Git.
A. When using a private repository, the SSH URL needs to be used no matter whether requesting a working copy or exporting a repository. Nevertheless DMD_Git assumes that the SSH URL only needs to be used when a working copy is requested.
B. To remedy B. one could theoretically use an ssh URL for private repositories, unfortunately they are not supported at the moment - DMD_Git does not consider them valid.
C. DMD_Git assumes all SSH URLs all use the user "git" (they start with git@...) which doesn't need to be the case. This is not strictly a private repository related issue, but it plays into the solution we are going for here.
What's the envisioned solution for this problem?
Should we allow SSH URLs as download URLs? While this would not solve C, it would not perpetuate it.
For a more comprehensive solution: Should there be a separate 'export' and 'working copy' URL? Or a flag that allows for specifying the git user?
For testing, create a make file pointing to a private repository you have access to and execute it with and without --working-copy:
projects[my_private_project][type] = module
projects[my_private_project][download][type] = git
projects[my_private_project][download][url] = git://github.com/example/my_private_project.git
projects[my_private_project][download][branch] = master
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 864230-1_private_git.patch | 2.98 KB | alex_b |
Comments
Comment #1
alex_b commentedThis patch adds support for SSH URLs.
The diff is long, but all it adds is an if/else statement that wraps the switch() statement in DMD_Git::download() into its second branch:
The modus operandi of this approach is that whenever a private repository is to be referenced, it needs to be done so by using an SSH URL:
Comment #2
langworthy commentedUsing the latest version of drush and drush make some of our make files which use SSH URL's (and previously worked) stopped working. The error was
"unknown protocol in ". Using the--verboseflag revealed further information includingUndefined variable: name drush_make.download.inc:355This patch works great.
Comment #3
jrbeemanPatch worked great for me too!
Comment #4
dmitrig01 commentedputting on my "tomorrow morning" list
Comment #5
psynaptic commentedWorks for me :)
Comment #6
dmitrig01 commentedComment #7
dmitrig01 commentedbtw sorry for the wait :/