I think this is "can't fix" but wanted to log it as yet another one of those things I'm hitting on Every. Single. Make file.

Everyone is either doing this:

projects[ajax_load][download][type] = "git"
projects[ajax_load][download][url] = "http://git.drupal.org/project/ajax_load.git"
projects[ajax_load][download][revision] = "8b0921252fcf599e7b15276bd815bcf81521eb27"
projects[ajax_load][subdir] = "contrib"

Or this:

projects[context_field][download][type] = git
projects[context_field][download][branch] = 7.x-1.x

Nowhere, ever, is there a 'version' string specified.

Is it possible to make drupalorg_drush oldened and wizened and avoid Every. Single. Distro. Author. having to update their make files?

Comments

webchick’s picture

tagging

webchick’s picture

Category: feature » task

Moving to a task from a feature request. This is a major DX headache because drush generate-makefile files will fail every time.

langworthy’s picture

If a revision, tag, or branch is specified in the make file the module version information is redundant.

This is how I've been structuring make files for some time now:

projects[module_name][type] = module
projects[module_name][download][type] = git
projects[module_name][download][url] = http://git.drupal.org/project/module_name.git
projects[module_name][download][revision] = hash
langworthy’s picture

Title: Intuit the 'version' string for a git branch/revision » Make 'version' optional

See the drush_make Git test.

webchick’s picture

Title: Make 'version' optional » Make 'version' optional for git clones

Small tweak. Thanks for making this title make more sense. :D

langworthy’s picture

I kept the title generic as make files can make use of drush_make's support of cvs, svn, git, and bzr.

Also, I just noticed #1371306: Add validation to ensure that if a .make file includes a git hash, it also defines a branch which complicates things.

dww’s picture

Yes, you absolutely must specify a version if you only specify a revision. But yes, we could figure out the version if you define 'branch' or 'tag'.

dww’s picture

Title: Make 'version' optional for git clones » Set project-level 'version' attribute automatically if a Git 'branch' or 'tag' attribute is defined.

Better title again. ;)

langworthy’s picture

#7. Why must you specify a version if you only specify a revision?

dww’s picture

@langworthy: please read the other issue.

jhedstrom’s picture

We need version set so that the .info file can be modified automatically? If that's the case, then this issue belongs here. Otherwise, I think it is a drupalorg_drush issue, since as that code currently works, it requires a version if a git hash is specified in order to pass validation.

dww’s picture

I believe we need version set so that we can find the right release in the release history XML so we can find the right release node ID. If we have a valid branch or tag, we get the .info file rewriting correct already.

dww’s picture

Assigned: Unassigned » dww
Status: Active » Needs review
StatusFileSize
new1.63 KB

Yeah, upon further testing, what I said in #12 is true. We need the project-level version to find the right release history, which we use for the release node id stuff.

dww’s picture

Status: Needs review » Fixed

Committed and pushed.

Automatically closed -- issue fixed for 2 weeks with no activity.