Open kornelski opened 3 months ago
This sounds like a great idea, and for long term storage of repos would also help us known when it's time to pull again.
Seems git fetch --depth=1 <repo> <commit>
into an empty repo works.
I also suggest that we clone from scratch for each crate version: #14
When you have a sha1
We already have sha1 from the downloaded crate
I've meant searching tags for crates that lack sha1 from cargo, usually due to having a "dirty" directory when publishing.
Instead of cloning the repo and then looking for a tag, you can use
git ls-remote
(Remote::create_detached
&connect_auth
&list
in git2) to find a tag and its sha1.When you have a sha1, you can init an empty repo, and do
git fetch +3db7c05aa35749cc4e0f0f892bc5831219901f98:refs/heads/whateverbranch --depth=1
to get just that one commit.