-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support providing a git link when publishing a crate #2640
Comments
Is this different than the |
@steveklabnik We need the hash in order to make a useful clone. As-is, the repository link isn't terribly useful unless it happens to point to a repository that has some kind of tagging that matches semver and the crate has decided to use it every time they |
To me this is closely related to #841. We won't actually ever have a method of 100% attributing a publish to a git hash (because we can't be sure you pushed it up), but we can at least do things like:
Once we have all that then we could record the SHA the commit happened at. Sounds like something plausible Cargo should do! |
I'd like to have this data so that we could figure out a way to persist it into crash reports, to link to the source repo at the right revision. This is not as important for Gecko, where everything will be vendored, but will be useful if we wire up crash reporting in Servo or some other project that pulls in deps from crates.io. |
I need a similar thing - I'd like to check whether source code of a published create matches its git repository, but there's no explicit connection between crate on crates.io and git repository revision. I think making a note of the current git hash at time of publishing will be good enough (in the Cargo.toml copy unloaded to crates.io) In the worst case if the code isn't published or is rebased it won't match anything. |
In order to support
cargo clone
(#1545) or anycargo vendor
solution where the project has a crates.io reference, we will need to discover the git link in order to make a local clone of the repository.It would be great if we could either put these in Cargo.toml and have them available in the published crate or (even better!) push the metadata up automagically during
cargo publish
, since there's a bit of a chicken-and-egg problem of needing to have the hash but not having the hash until the change is committed :-) Also open to other solutions, since we've discussed this need in the past and one of you might already have thought about something even smoother.cc @alexcrichton @wycats
The text was updated successfully, but these errors were encountered: