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

Use git CLI to fetch a repo. #130

Merged
merged 2 commits into from
Oct 5, 2021
Merged

Conversation

ehuss
Copy link
Collaborator

@ehuss ehuss commented May 19, 2021

This changes the git fetch of the rust-lang/rust repo to use the git CLI command instead of libgit2. This is because libgit2 has some performance issues with large repos. On my system, a fetch that is not particularly old takes about 4 minutes with libgit2, whereas with the git CLI it takes about 2 seconds.

eprintln!("refreshing repository at {:?}", repo);
// This uses the CLI because libgit2 is quite slow to fetch a large repository.
let status = std::process::Command::new("git")
.arg("fetch")
Copy link
Member

Choose a reason for hiding this comment

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

I think this needs to use something like the old repo.remote_anonymous(RUST_SRC_URL). E.g., if I run git fetch in my rust-lang/rust clone, it only fetches my fork, which doesn't have the latest changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point! I normally point it at a repo where origin is rust-lang/rust, but it makes sense to use the correct remote. I don't think it can use an anonymous remote (since that is in memory only), but I added the URL to the fetch line which should do the right thing.

@spastorino spastorino merged commit 63a18d8 into rust-lang:master Oct 5, 2021
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.

3 participants