Skip to content

Add @triagebot squash command #821

Open
@jyn514

Description

@jyn514

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions