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

Improve git clone command in manual #184

Closed
wants to merge 1 commit into from
Closed

Improve git clone command in manual #184

wants to merge 1 commit into from

Conversation

createyourpersonalaccount

By adding --depth 1, the command only downloads the latest commit
snapshot, thereby saving bandwidth and completing faster.

Since the repository is cloned for the purpose of building and
installing, it is not important to have the commit history.

By adding `--depth 1`, the command only downloads the latest commit
snapshot, thereby saving bandwidth and completing faster.

Since the repository is cloned for the purpose of building and
installing, it is not important to have the commit history.
@lnicola
Copy link
Member

lnicola commented Apr 8, 2022

I'm not sure this is worth it. Our repository should be pretty small (5-10 MB or so?), and I think shallow clones can be problematic in some cases like doing git pull on one of them (at some point you will want to update, right?).

Finally, this is the wrong repository, the manual is kept next to the source code.

@createyourpersonalaccount
Copy link
Author

@lnicola

I think pulling works...

Is this the wrong repository for https://rust-analyzer.github.io/manual.html ?

@createyourpersonalaccount
Copy link
Author

Hmm, the other open PR, #168 is mentioning https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/manual.adoc as the correct repository. it's not the link in the website at the bottom though, so that was a bit confusing. Separate question: do you think the bottom link in https://rust-analyzer.github.io/manual.html should link to https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/manual.adoc ?

@lnicola
Copy link
Member

lnicola commented Apr 8, 2022

See https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/:

These clones truncate the commit history to reduce the clone size. This creates some unexpected behavior issues, limiting which Git commands are possible. These clones also put undue stress on later fetches, so they are strongly discouraged for developer use. They are helpful for some build environments where the repository will be deleted after a single build.

Is this the wrong repository

Yes, there's a comment on that theme at the top, any idea on how to make it more visible?

@lnicola
Copy link
Member

lnicola commented Apr 8, 2022

Maybe it should, but not on the blog and changelog posts. I think it's the same footer on every page.

@createyourpersonalaccount
Copy link
Author

@lnicola

Okay, you are right. Actually pulling into a shallow copy seems to not work; you need to complete the history first or re-clone.

The stress is put server-side and probably github can deal with it.

But also there are no instructions to pull or update the rust-analyzer on the manual page. But I concede, it is not a good idea, anyone who cares for --depth 1 can probably put the command themselves.

@createyourpersonalaccount
Copy link
Author

Maybe it should, but not on the blog and changelog posts. I think it's the same footer on every page.

Yes I agree. It can maybe be overridden for single pages, but not sure.

@lnicola
Copy link
Member

lnicola commented Apr 9, 2022

I think pull actually works for me (it appears to do nothing when there are no new commits).

The stress is put server-side and probably github can deal with it.

No, we should play nicely. If everyone said "GitHub can deal with my shallow clone", that would be pretty awful.

But It seems we've grown to 64 MB, I wonder if there's anything we could get rid of in there.

@lnicola
Copy link
Member

lnicola commented Apr 9, 2022

Yeah, it seems our largest objects are an unsquashed GraphQL schema and a lot of package-lock.json copies. I'd expect git clone --single-branch to make a difference here (the docs are larger than the source code), but it doesn't appear to.

lnicola added a commit that referenced this pull request Jun 5, 2023
lnicola added a commit that referenced this pull request Jun 5, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants