Skip to content

Warn before merging a PR if it contains fixup or squash commits #2385

Closed

Description

@dorian-marchal

Our team uses fixup! and squash! commits to add changes to pull requests that have already been reviewed.

This is helpful for the reviewers because they can quickly identify the changes since their last review.

The commit history can look like this:

Commit A
Commit B
Commit C
fixup! Commit B
squash! Commit A

Note: Fixup and squash commits can be created with git commit (--fixup|--squash) <ref>, as shown in this crappy GIF.

When the pull request is ready to be merged, these commits are squashed/fixed up with git rebase -i --autosquash.

These commits are temporary and shouldn't be merged. I think it would be helpful to show a warning next to (and maybe disable) the "Merge" button when the current pull request contains at least one fixup/squash commit.

Activity

  1. dorian-marchal commented on Aug 27, 2019

    @dorian-marchal
    Author

    Here is a pull request with fixup commits: dorian-marchal#1

    Here is one with squash commits: dorian-marchal#2

    And here is one with both a squash and a fixup commit: dorian-marchal#3

  2. fregante commented on Sep 17, 2021

    @fregante
    Member

    Tracked in #2579

  3. locked and limited conversation to collaborators on Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions