How to repeat:
1) On a D6 site that is already setup with git_deploy, download Webform module (currently 6.11) using Drush:
drush dl webform --package-handler=git_drupalorg
2) visit the modules page, or the update status page. There is no version of Webform module reported.
3) cd sites/all/modules/contrib/webform
4) gitk .
5) Observe the correct version 6.x-3.11
I did some debugging, and
$head_contents = file_get_contents($git_dir . DIRECTORY_SEPARATOR . 'HEAD');
is
c14e45e9b0248de1b95571efcd6fc79a727a9c68
I see two problems:
1) glip reports sha IDs in bin not hex so
if ($githash === $ref) {
should probably be
if ($githash === sha1_hex($ref)) {
2) The above shaID is nowhere to be found in $git_refs. No idea why.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1181258_git_deploy_no_version.diff | 1.04 KB | dalin |
Comments
Comment #1
dalinFurther investigation shows that there is _not_ a problem with the way that Drush does checkouts. To show this I did a manual checkout of webform:
Comment #2
dalinI'm still a Git newb, but it appears that there are two sha1 in question. There's the last commit before the tag, and there's the tag.
So that it appears when I do
git checkout 6.x-3.11I actually get the commit right before the tag. Hence the SHA1 doesn't match what glip is reporting for this tag.Comment #3
dalinA bit more work with glip and I managed to pull out the correct SHA1.
Comment #4
fenstratThe patch in #3 works a treat. It correctly reports version number with git clone or with drush dl.
I've been scratching my head for some time over why git_deploy fails to pick up so many module versions. This appears to fix this.
Comment #5
fenstratThis also applies cleanly to 7.x
Comment #6
pfrenssenDoesn't this address the same problem as #1007890: Add support for annotated tags?
Comment #7
fenstratIndeed, this is a duplicate of #1007890: Add support for annotated tags
Comment #8
darren oh