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

"cargo clone" to check out a crate's repo #1545

Open
joshtriplett opened this issue Apr 25, 2015 · 13 comments
Open

"cargo clone" to check out a crate's repo #1545

joshtriplett opened this issue Apr 25, 2015 · 13 comments
Labels
A-new-subcommand Area: new subcommand S-needs-rfc Status: Needs an RFC to make progress.

Comments

@joshtriplett
Copy link
Member

I'd love to write something like "cargo clone byteorder" to clone a copy of the corresponding git repository.

@emberian
Copy link
Member

Cargo packages don't necessarily have a corresponding git (or any other) repository. The repository metadata doesn't even include the VCS right now.

@joshtriplett
Copy link
Member Author

They frequently do, though, and crates.io displays it.

@emberian
Copy link
Member

That's an arbitrary string, it doesn't even need to be a URL.

@alexcrichton alexcrichton added the A-new-subcommand Area: new subcommand label Apr 27, 2015
@alexcrichton
Copy link
Member

cc @larsbergstrom @SimonSapin

Sounds like you Servo guys would definitely like this for when you're doing a Rust upgrade and upgrading all of your crates. The workflow Lars and I just talked about in theory looks like:

  • cargo clone inside the Servo repo to check out a new crate outside the Servo repo, setup a path override, and get the dep ready for editing
  • Edit the cloned out dep, push upstream
  • Remove the clone, override, and update the dependency all in one go

This may be good to be an external subcommand to start out, but cargo clone may be nice to have as an official subcommand!

As a side note, cargo clone on a git repo can also leverage Cargo's own cache of the git repo for the initial clone to reduce a lot of network traffic.

@davidzchen
Copy link

davidzchen commented Jun 11, 2016

@JanLikar is working on this feature in #1861

@JanLikar
Copy link
Contributor

It's not yet feature complete, but you might find it useful. https://github.com/JanLikar/cargo-clone

@davidzchen
Copy link

Is the plan still to merge cargo-clone into cargo?

@alexcrichton
Copy link
Member

@davidzchen certainly yeah! We're always open to folding in new subcommands that have clearly proven themselves. For example that's sort of what we did with cargo check!

@fa7ca7
Copy link
Contributor

fa7ca7 commented May 2, 2018

Is this still relevant and nobody is going to tackle this?

@matklad
Copy link
Member

matklad commented May 2, 2018

@dethoter yep, this is still relevant!

@fa7ca7
Copy link
Contributor

fa7ca7 commented May 2, 2018

Thank you. I'm on it

@ehuss
Copy link
Contributor

ehuss commented Jul 9, 2018

@joshtriplett I made a little command to clone a package: https://github.com/ehuss/cargo-clone-crate

It does some heuristics to guess which VCS to use, but since most people use github or gitlab, it normally is correct. It even checks whether it is git or hg for bitbucket. 😄

@dwijnand
Copy link
Member

dwijnand commented Oct 2, 2018

Nowadays this probably requires an RFC to land in cargo proper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-new-subcommand Area: new subcommand S-needs-rfc Status: Needs an RFC to make progress.
Projects
None yet
Development

No branches or pull requests