Hi all
Currently, Git Deploy guesses the project name by fetching its repository URL and slicing the .git extension off the repository name.
This might work, yet there is no guarantee that the repository name is completely identical to the actual Drupal upstream repository and thus to the machine readable project name.
In my case, I run several fully fledged Drupal repositories. To distinguish between the different projects (which I have as Git submodules) I prefix them with, for example, drupal7_. I host an in-between version of all of the Drupal projects which I use and have the original Drupal Git repository as an upstream path.
This prefixing messes up the project name and breaks things across the site. For example, the l10n update module uses these machine names to try and find the location of the *.po files on the translation servers. In my case, the Views project (for example) was searched like so:
http://ftp.drupal.org/files/translations/7.x/drupal7_views/drupal7_views...
While it should be:
http://ftp.drupal.org/files/translations/7.x/views/views-7.x-3.10.nl.po
I have provided a small patch which removes the current project name lookup via the Git URL and provides a small helper function which searches the top level module file system for its *.info file and uses that basename as the correct project name.
This patch seems to do the job well and fixes the above mentioned issues.
Any thoughts welcome!
Cheers,
Tim
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | git_deploy-do_not_guess_project_name_based_on_git_repository_name-2450783-2.patch | 1.95 KB | Timusan |
Comments
Comment #1
Timusan commentedComment #2
Timusan commentedComment #3
Timusan commentedOk, I apparently uploaded the project's README file at first ... ah well, point-and-click UI's are not my thing I guess ;)
Comment #4
Anonymous (not verified) commentedThere are cases when this will not work either, not all module names are identical to the project name. See for example the Front Page module (https://www.drupal.org/project/front). The module machine name is "front_page", but the project name on Drupal.org is just "front".
Comment #5
donquixote commentedI wonder why we even need the project name.
For me the only reason to use git_deploy is to satisfy version requirements. So all I really need is the version.
Comment #6
nwom commentedSetting to Needs Work based on #4 and #5.
Comment #7
nwom commentedIs potentially #2575249: Fail to parse repository URL a better way to fix this, since it doesn't use the project name?
Edit: Nevermind, this patch fixed my issue with sandbox modules not being found (File System Rules), whereas the other issue did not fix this.
Comment #8
darren ohProjects will not appear without a project name. The patch assumes that a project is named for one of its modules or themes. This is not a requirement. I would suggest using branches rather than multiple repositories for your project copies.