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

Possible to reference branch#tag in github? #6206

Closed
archon810 opened this issue Feb 25, 2017 · 5 comments
Closed

Possible to reference branch#tag in github? #6206

archon810 opened this issue Feb 25, 2017 · 5 comments

Comments

@archon810
Copy link

Hi,

Is it possible to refer to a tag using composer? Specifically, a tag that looks like a version but doesn't adhere to semver? This guy: https://github.com/szepeviktor/w3-total-cache-fixed/releases/tag/0.9.5.2.3.

My composer.json:

    { 
      "type": "vcs",
      "url": "git@github.com:szepeviktor/w3-total-cache-fixed.git"
    },
...
    "szepeviktor/w3-total-cache": "v0.9.5.x-dev#0.9.5.2.3",

The above ends up checking out HEAD of that branch, not the tag. I wasn't able to figure out a way to check out just tag "0.9.5.2.3".

The only way I got it to work is by using a hash v0.9.5.x-dev#878fe362069cc0d0215bf2760bcb195575012a90, but it's not as readable, especially since Composer refuses to support comments in composer.json.

So, my question is, is it possible to refer to https://github.com/szepeviktor/w3-total-cache-fixed/releases/tag/0.9.5.2.3 by tag name?

Thank you.

@alcohol
Copy link
Member

alcohol commented Feb 27, 2017

This is the best I could come up with it. This installs a development version though, not a stable version. But with so many people thinking they can come up with a better version scheme than semver, it is impossible for us to support all formats. We simply cannot/will not. Reach out to the author, see if you can talk some sense into him :-)

rob@localhost /tmp/test > composer show --all szepeviktor/w3-total-cache
name     : szepeviktor/w3-total-cache                                 
descrip. : W3 Total Cache (Fixed)
keywords : 
versions : v0.9.5.x-dev
type     : wordpress-plugin
source   : [git] https://github.com/szepeviktor/w3-total-cache-fixed.git 8fd5901740fa445ea0e67f1109fd2ba389578307
dist     : [zip] https://api.github.com/repos/szepeviktor/w3-total-cache-fixed/zipball/8fd5901740fa445ea0e67f1109fd2ba389578307 8fd5901740fa445ea0e67f1109fd2ba389578307
names    : szepeviktor/w3-total-cache

support
source : https://github.com/szepeviktor/w3-total-cache-fixed/tree/v0.9.5.x
issues : https://github.com/szepeviktor/w3-total-cache-fixed/issues

rob@localhost /tmp/test > composer require szepeviktor/w3-total-cache:^0.9@dev
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)                         
Package operations: 1 install, 0 updates, 0 removals
  - Installing szepeviktor/w3-total-cache (v0.9.5.x-dev 8fd5901) Cloning 8fd5901740 from cache
Writing lock file
Generating autoload files

@alcohol alcohol closed this as completed Feb 27, 2017
@archon810
Copy link
Author

Given how W3 Total Cache is a colossal project used by thousands of websites, and its versioning is already in place, I doubt they'll listen to us.

So v0.9.5.x-dev#878fe362069cc0d0215bf2760bcb195575012a90 seems to be the only way to refer to the tag, by its hash then. Cool, thanks.

@alcohol
Copy link
Member

alcohol commented Feb 28, 2017

@archon810
Copy link
Author

Should I remove the branch name and just leave the commit hash in? Will that even work?

@alcohol
Copy link
Member

alcohol commented Mar 1, 2017

That will not work. As stated in that link, the downside cannot be avoided. Using a commit hash is a hack that has been around for legacy reasons, but we strongly discourage using it.

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

2 participants