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

Allow a commit hash instead of a semver version (#275) #441

Merged
merged 3 commits into from
May 29, 2013

Conversation

wibblymat
Copy link
Member

This PR gets us most of the way to #275, with a caveat.

The resolve step will fail if a valid version cannot be found. If the repo has tags then it will get a version like v0.6.8-284-g1031af3 from git describe - i.e. the commit is tag v0.6.8 plus 284 other commits.

If there are no tags in the repo, bower looks for bower.json to read a version from there.

A repo with no tags and no bower.json cannot be installed.

With the rewrite on the horizon it doesn't seem worth the effort to make this perfect. Its up to you guys whether or not you want it before then!

@wibblymat
Copy link
Member Author

The ENOENT errors in the tests are driving me nuts. Async is hard 😖

@addyosmani
Copy link
Member

Good luck resolving those ENOENTS! This looks good otherwise.

@wibblymat
Copy link
Member Author

All of the individual test suites pass (e.g. ./node_modules/.bin/mocha -R spec -t 60000 test/package.js) but running them all (e.g. ./node_modules/.bin/mocha -R spec -t 60000) fails with ENOENT. Which is pretty annoying!

Its something to do with the cleanup for one test happening after the set up for another so that some folder (probably the cache) is getting deleted while it is in use.

@wibblymat
Copy link
Member Author

Hooray! I worked it out. By hanging the test off the 'checkout' event and calling next() when that happened, the clean up was happening before the package finished installing. Using the 'install' event instead fixes it.

@wibblymat
Copy link
Member Author

@satazor Do we want to land this for 0.9.3?

@satazor
Copy link
Member

satazor commented May 22, 2013

@wibblymat yes! ship it

@satazor
Copy link
Member

satazor commented May 29, 2013

As soon as this gets merged, #275 can be closed.

We still need some other member to review this.
//cc @sindresorhus @danheberden @necolas @desandro

@necolas
Copy link
Contributor

necolas commented May 29, 2013

ship it!

@satazor Is this already in the rewrite too?

necolas added a commit that referenced this pull request May 29, 2013
Allow a commit hash instead of a semver version (#275)
@necolas necolas merged commit 90afa5b into bower:master May 29, 2013
@wibblymat wibblymat deleted the issue-275 branch May 29, 2013 14:35
@satazor
Copy link
Member

satazor commented May 29, 2013

@necolas yes! :D Everything tagged with fixed-rewrite is also implemented in the rewrite.

@sindresorhus
Copy link
Contributor

yay, nice work :)

@zakdances
Copy link

My attempt at

bower install sass-bootstrap#698691c450a52a3562d8605496112a64f90057cc

still produces

bower error Tag 698691c450a52a3562d8605496112a64f90057cc is not a valid semver range/version

I'm using Bower 0.9.2

@sindresorhus
Copy link
Contributor

@zakdances it hasn't been released yet.

@tiger-seo
Copy link

when it will be released?

@OliverJAsh
Copy link

@mente
Copy link
Contributor

mente commented Jul 10, 2013

Please note that git branch -q is a modern adoption. On OSX default git version 1.7.10.2 will always result in error and misleading message saying that tag/commit is not found. Had to install git via brew to make this feature working.
How about removing -q option? man says it's useful only for creating/deleting branches:

$ git help branch
...
-q, --quiet
       Be more quiet when creating or deleting a branch, suppressing non-error messages.

@satazor
Copy link
Member

satazor commented Jul 10, 2013

Worth mentioning that the rewrite/canary does not use git branch.

@mente
Copy link
Contributor

mente commented Jul 10, 2013

Sorry, I'm new totally to bower. Is rewrite/canary a new version of bower?

@satazor
Copy link
Member

satazor commented Jul 10, 2013

bower-canary is the rewrite of bower, with a new architecture. It will eventually replace the current stable architecture.

See:
https://github.com/bower/bower/wiki/Rewrite-architecture
https://github.com/bower/bower/wiki/Rewrite-state

@mente
Copy link
Contributor

mente commented Jul 10, 2013

Thanks for info. Will drop PR with fix for current architecture

@idalv
Copy link

idalv commented May 27, 2014

Please note that when targeting a commit the full hash has to be given. Otherwise it will still say that no branch/tag is found for the given version.

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

Successfully merging this pull request may close these issues.

10 participants