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

Root package version generated from the branch name is not pretty #4

Closed
morozov opened this issue Nov 26, 2017 · 3 comments
Closed

Comments

@morozov
Copy link

morozov commented Nov 26, 2017

Consider the following example:

git init
cat > composer.json <<EOF
{
    "name": "test/test",
    "require": {
        "jean85/pretty-package-versions": "^1.0.2"
    }
}
EOF

cat > main.php  <<EOF
<?php

require __DIR__ . '/vendor/autoload.php';
echo \Jean85\PrettyVersions::getVersion('test/test')->getPrettyVersion(), PHP_EOL;
EOF

git checkout -b 3.0
git add .
git commit -mTest
composer install
php main.php

# 3.0.9999999.9999999-dev@412b22b

The issue is reproducible with the patch from Ocramius/PackageVersions/pull/51 applied. Similarly to #3, it's only reproducible for the root package. For dependencies, the version is displayed without the 9s (e.g. phpunit/phpunit 6.4.x-dev@a94c40a).

Sorry for making so much noise :-) I'm trying to start using pretty versions in a project.

@Jean85
Copy link
Owner

Jean85 commented Nov 27, 2017

That's really strange. The Composer interface used in Ocramius/PackageVersions#51 says that getPrettyVersion() Returns the pretty (i.e. non-normalized) version string of this package, which seems not true here...

I'll try to report this as a bug!

@Ocramius
Copy link

Handled in Composer 1.5.3 - composer/composer@5ba6d7d

@Jean85
Copy link
Owner

Jean85 commented Nov 30, 2017

Thanks! Closing as resolved, it's unfortunate that I cannot require a Composer version to completely fix this issue; I've added a "Known issue" entry in the changelog about this.

@Jean85 Jean85 closed this as completed Nov 30, 2017
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