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

squash gh-pages branch #1407

Closed
jyn514 opened this issue Jan 29, 2021 · 6 comments
Closed

squash gh-pages branch #1407

jyn514 opened this issue Jan 29, 2021 · 6 comments

Comments

@jyn514
Copy link
Member

jyn514 commented Jan 29, 2021

Currently, rust-by-example takes up over 146 MB just for the git history. It would be nice to reduce this so contributors to rust-lang/rust don't have to download as much data (rust-lang/rust#76653 (comment)).

You can squash the branch with (https://stackoverflow.com/questions/1657017/how-to-squash-all-git-commits-into-one/1661283#1661283)

git checkout gh-pages
git update-ref -d refs/heads/gh-pages
git commit -m "Redirect to doc.rust-lang.org"

then squash the history with git gc --aggressive. I verified locally that this reduces the size of .git to 84 MB. I'm not sure how to get github to run gc, I think you may have to wait for them to do it automatically (https://stackoverflow.com/a/9138899/7669110).

@jyn514
Copy link
Member Author

jyn514 commented Mar 1, 2021

@marioidival I saw you added a +1 - does that mean you squashed the branch? Can I make it easier somehow?

@jyn514
Copy link
Member Author

jyn514 commented Apr 17, 2021

bump - who should I talk to about this?

@jyn514
Copy link
Member Author

jyn514 commented Apr 17, 2021

Actually it looks like the gh-pages branch has been unused for a while, the last pages deploy was in 2018: https://github.com/rust-lang/rust-by-example/deployments/activity_log?environment=github-pages. I think just deleting the branch altogether should be fine.

@Mark-Simulacrum
Copy link
Member

Pushed, I believe, the squashed version of gh-pages. Seems to have cut the size down to ~4.7MB on a fresh clone.

@jyn514
Copy link
Member Author

jyn514 commented Apr 23, 2021

Thank you!

@jyn514
Copy link
Member Author

jyn514 commented Apr 23, 2021

That worked like a charm, thank you so much!

$ x check
Updating only changed submodules
Updating submodule src/doc/rust-by-example
Submodule 'src/doc/rust-by-example' (https://github.com/rust-lang/rust-by-example.git) registered for path 'src/doc/rust-by-example'
Cloning into '/home/joshua/src/rust/rustc2/src/doc/rust-by-example'...
remote: Enumerating objects: 12809, done.        
remote: Counting objects: 100% (119/119), done.        
remote: Compressing objects: 100% (110/110), done.        
remote: Total 12809 (delta 59), reused 13 (delta 8), pack-reused 12690        
Receiving objects: 100% (12809/12809), 3.06 MiB | 2.33 MiB/s, done.
Resolving deltas: 100% (6985/6985), done.
Submodule path 'src/doc/rust-by-example': checked out 'c80f0b09fc15b9251825343be910c08531938ab2'
Submodules updated in 1.98 seconds

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

No branches or pull requests

2 participants