Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When checking out specific commit from a repository, requirements are erroneously resolved from composer.json in the topmost commit of the branch #3705

Closed
finwe opened this issue Feb 4, 2015 · 3 comments

Comments

@finwe
Copy link

finwe commented Feb 4, 2015

I am trying to require older version of library, which has no tag. Repositories are defined as follows:

    "repositories": [
        { "type": "vcs", "url": "https://github.com/nette/nette.git" }
    ],
    "require": {
        "nette/nette": "dev-master#b8ca5b82d407453b8cf26ce08a36ee698452d000"
    },

The commit is present in the branch dev-master, composer.json is present with no requirements, however on composer install an error is issued suggesting that the package resolves requirements from topmost commit of dev-master branch:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - nette/nette dev-master requires nette/application >=2.3.0 -> no matching package found.
    - nette/nette dev-master requires nette/application >=2.3.0 -> no matching package found.
    - Installation request for nette/nette dev-master#b8ca5b82d407453b8cf26ce08a36ee698452d000 -> satisfiable by nette/nette[dev-master].

Composer version is 07c644ac229a21df80180598d8bb9aaba232eecb

@alcohol
Copy link
Member

alcohol commented Feb 5, 2015

That's because composer does not know about the composer.json file in that specific hash. Packagist only stores the latest composer.json for dev-master. Composer cannot determine what is in the composer.json of that specific commit. It would require a git clone to be able to determine that. For sane reasons this is not supported, see #599. Your only option is creating a lock file with this commit .

@Seldaek
Copy link
Member

Seldaek commented Feb 5, 2015

Yup, see the blue note at https://getcomposer.org/doc/04-schema.md#package-links (gotta scroll a bit) for more details.

@Seldaek Seldaek closed this as completed Feb 5, 2015
@finwe
Copy link
Author

finwe commented Feb 5, 2015

OK, sure, thanks for explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants