I was already thinking about opening this issue as a feature request to help out with #1371306: Add validation to ensure that if a .make file includes a git hash, it also defines a branch. However, I just ran generate-makefile (while working on other bugs) and discovered that it's generating output like this:
projects[devel][type] = "module"
projects[devel][download][type] = "git"
projects[devel][download][url] = "git://git.drupal.org/project/devel.git"
projects[devel][download][branch] = "6.x-1.x"
projects[devel][download][revision] = "c2048dfe1d8caf9aa2608641f4f4fec413e4c46b"
If you turn around and run drush make on the resulting .make file, you currently get this:
% drush make --no-core devel.make devel
devel cloned from git://git.drupal.org/project/devel.git. [ok]
You can only specific branch or tag or revision but not combined in [error]
make file.
So many problems here. ;)
A) It's a good thing if they specify both a branch and a revision, so we can do more sane things with the version strings when rewriting .info files.
B) It'd be nice if .make files generated by generate-makefile actually worked.
C) If we were going to print an error message here, it should at least be grammatically sane. ;)
D) If this is invalid input, we should catch that *before* we try to clone the whole Git repo.
I'm going to work on a patch for this.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1435156-1.fix-make-download-git.patch | 11.56 KB | dww |
Comments
Comment #1
dwwGot sidetracked into other issues, but I finally had a chance to come back to this. Sorry for the huge patch, but once I started trying to fix make_download_git(), it ended up turning into a lot of changes. ;) But, the attached patch fixes A-D from the original post, the sample .make input from the OP now builds as expected, and makeTest.php is passing all tests. Probably easier to review this by just git am'ing it and reading through make_download_git() directly instead of trying to grok the diff.
And yeah, maybe I should have just put that effort into #1375270: Drush Make should use Drush core's native download abilities for git clones instead, but that seemed like a much bigger and more risky approach.
Comment #2
jhedstromLooks good and all tests are passing. I added a few code comments to clarify the order of precedence of tag, revision and branch and committed. Thanks!
Comment #3
dwwExcellent, thanks!
Comment #5
theohawse commentedThis would be super handy to have in the All-versions-4.x-dev branch since Hostmaster 2 is still in alpha1.
Drush 5 is still incompatable with Hostmaster 1.9
Comment #6
moshe weitzman commentedMake is not part of drush4. It is its own project, and it has been abandoned. Reset status.
Comment #7
dwwdrush make wasn't part of drush core V4. If you want this, you'd need to open a new issue in the (basically abandoned and unmaintained) drush make issue queue, and perhaps apply to take over maintaining that branch of drush make. :/ Sorry.
Comment #8
dww(ha, cross-post, but we basically did the same thing) ;)