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

Pointing dependency to specific commit with only numbers in it fails #2319

Closed
missingdays opened this issue Jul 1, 2016 · 4 comments
Closed

Comments

@missingdays
Copy link

missingdays commented Jul 1, 2016

Output of bower -v && npm -v && node -v:

1.7.9
2.14.7
v4.2.1

Steps to reproduce the issue:

  1. Have commit that has hash with the first several number-only characters, for example "70041869d.."
  2. Add dependency to bower json as "project-name": "repository-link.git#70041869"
  3. bower install

Describe the results you received:
I expected it to find commit with hash starting with 70041869 and download dependency from it

Describe the results you expected:
Bower told me

bower c3#70041869         ENORESTARGET No tag found that was able to satisfy 70041869

and stopped installing

Additional information:
I understand that this feature that is rarely used, and commit hashes almost always have some alphabetic charactes at the beggining, but still, this is a problem that might occur unexpectedly.

@benmann
Copy link
Member

benmann commented Jul 22, 2016

Is there a concrete example you are referring to and can share?

@missingdays
Copy link
Author

@benmann let's take d3 for example
Say, this is commit I want to install - d3/d3@8777757
I check it using git log --abbrev-commit or just copy hash tag from GitHub. I get "8777757".
So

bower install d3#8777757

results in error

bower d3#8777757            not-cached https://github.com/mbostock-bower/d3-bower.git#8777757
bower d3#8777757               resolve https://github.com/mbostock-bower/d3-bower.git#8777757
bower d3#8777757          ENORESTARGET No tag found that was able to satisfy 8777757

Additional error details:
Available versions in https://github.com/mbostock-bower/d3-bower.git: 4.1.1, 4.1.0, 4.0.0, 3.5.17, 3.5.16, 3.5.15, 3.5.14, 3.5.13, 3.5.12, 3.5.11, 3.5.10, 3.5.9, 3.5.8, 3.5.7, 3.5.6, 3.5.5, 3.5.4, 3.5.3, 3.5.2, 3.5.1, 3.5.0, 3.4.13, 3.4.12, 3.4.11, 3.4.10, 3.4.9, 3.4.8, 3.4.6, 3.4.5, 3.4.4, 3.4.3, 3.4.2, 3.4.1, 3.4.0, 3.3.13, 3.3.12, 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5.3, 1.5.2, 1.5.1, 1.5.0, 1.4.0, 1.3.0, 1.2.1, 1.2.0, 1.1.0, 1.0.3, 1.0.2, 1.0.1, 1.0.0

I understand that this is specific bug, and it can be fixed by copying more characters from commit hash that is provided. But it would be cool if bower could understand that probably there are no versions higher than, say, 1 million, and would treat it as a commit hash.

@sheerun
Copy link
Contributor

sheerun commented Jul 23, 2016

Until someone decides to make version by the timestamp, like 20160602 :(

@missingdays
Copy link
Author

@sheerun Yes, you are totally right. And you can't check if such version exists, and if it doesn't, check for such commit. In this case, if somebody makes mistake and writes 20160601 instead of 20160602, it wouldn't be reliable to check commit that starts with 20160601, as it could exists.
So, I guess, the only solution is to use extended commit hashes.

@sheerun sheerun closed this as completed Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants