Skip to content

Prevent (discourage) merge methods by title ("NOSQUASH: ") #8982

@GideonBear

Description

@GideonBear

Description

Ref #8655, #7204

Motivation

I use a squash and merge workflow. Often I make a single commit with a proper commit message, which is used in the PR title, then later commits are fixes which are squashed.

Some people however, put a lot of effort into correct commits, and make a PR containing multiple commits that should (ideally) not be squashed (force pushing for fixes instead). I would like to instead rebase and merge those PRs. To make it clear that a PR should not be accidentally merged, I might change the PR title to contain "NOSQUASH" (or they will, if I put that in CONTRIBUTING.md).

Furthermore, I currently lint the PR title to conform to the conventional commit standard, which I want to change to linting the commits themselves instead if it's a "NOSQUASH" PR. However right now, the failing title lint is the warning. If I change that (which is obviously better, I don't want to need admin permissions to merge the PR) I lose that warning.

Proposal

Refined GitHub should add a warning (noticable red box) when squashing a PR whose title starts with "nosquash" in any capitalization, in the confirm dialog (see below)

Image

I think it follows the guidelines. Yes, this is mostly useful for this specific workflow. But I do think it's sensible to have enabled for everyone. If squashing a "NOSQUASH" PR is intended, maybe they should change the PR title first; and then again, it's just a warning that can easily be ignored.

The PR title (and thus commit message) containing "NOSQUASH" is already a warning of course, but you can easily

  1. Want to click rebase but misclick squash without noticing
  2. Merge the PR quickly and not look at the commit message

I think there's value in adding a clearer warning.

Example URLs

GideonBear/example#1
topgrade-rs/topgrade#1511

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