Open
Description
A common challenge new contributors have is squashing commits into one:
- This requires having a local clone of the repo (especially for doc PRs, most people just use the web interface)
- Knowing how to use
git rebase
, including that you should use-i
to edit individual commits - Knowing that
git push -f
is ok (this last step trips a lot of people up - they'll rebase and then 'merge branch into master' which defeats the whole point)
Even for existing contributors squashing is annoying because it messes up your build cache, since cargo
works on mtimes and not hashes.
It would be great to have a squash
command that automatically squashes all commits in the current PR into one. The way to do this locally is
git checkout https://github.com/rust-lang/rust/pull/NNNNN && git rebase -i origin/master && git push -f git@github.com:CONTRIBUTOR/rust.git HEAD:BRANCH
NNNNN is the pr number, CONTRIBUTOR is the author, BRANCH is the branch name; all of these are easily available from the PR itself.