Skip to content

Basic URL canonicalization. Fixes #84 #88

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

Merged
merged 4 commits into from
Jun 29, 2014
Merged

Basic URL canonicalization. Fixes #84 #88

merged 4 commits into from
Jun 29, 2014

Conversation

brson
Copy link
Contributor

@brson brson commented Jun 28, 2014

...#84.

No tests because there's no preexisting network tests.

rust-lang#84.

No tests because there's no preexisting network tests.
@brson
Copy link
Contributor Author

brson commented Jun 28, 2014

This may not actually fix #84. There is another rev-parse error that occurs when packages don't agree on the capitalization of source URLs, so e.g. when some people use PistonDevelopers and others use `pistondevelopers'.

@brson
Copy link
Contributor Author

brson commented Jun 28, 2014

Think I'll throw in a few unit tests at least.

@brson
Copy link
Contributor Author

brson commented Jun 28, 2014

I've also stripped trailing .git extensions. This is ready.

@brson brson changed the title Account for trailing / in URLs when determining on-disk location. Fixes ... Basic URL canonicalization. Fixes #84 Jun 28, 2014
fn test_canonicalize_idents_by_stripping_dot_git() {
let ident = ident(&Remote(url("https://github.com/PistonDevelopers/piston.git")));
assert_eq!(ident.as_slice(), "piston-1ad60373965e5b42");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case we change the hashing algorithm in the future, could this test just test equality of all the urls when hashed? (don't actually look at the specific hash).

Could you also add a test for case insensitivity? The one above just calculates one hash but it's not clear from the test that the hash was generated from a lowercase url.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will, but this is following the existing pattern.

@alexcrichton
Copy link
Member

r=me with a minor comment

brson added a commit that referenced this pull request Jun 29, 2014
Basic URL canonicalization. Fixes #84
@brson brson merged commit bc31d2a into rust-lang:master Jun 29, 2014
alexcrichton pushed a commit to alexcrichton/cargo that referenced this pull request Sep 2, 2014
Basic URL canonicalization. Fixes rust-lang#84
ehuss pushed a commit to ehuss/cargo that referenced this pull request Nov 19, 2023
The rustfix tool detects it, so let's inform the user what just happened!

Closes rust-lang#88
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

Successfully merging this pull request may close these issues.

2 participants