Skip to content

Disable squash merging for pull requests #2086

@KJ7LNW

Description

@KJ7LNW

Problem

Our repository currently has squash merging enabled, which may cause several problems, especially with repositories that have large commit histories. See below for simple fix:

Potential Issues with Squash Merging

  1. Reduced Bisect Precision: Squashed commits combine multiple logical changes, significantly reducing git bisect's ability to precisely pinpoint when bugs were introduced.

  2. Revert Flexibility Loss: Individual commits allow selective reverting of specific changes. With squashed commits, only entire features can be reverted using git revert <squash-commit-hash>, forcing an all-or-nothing approach. (It's still possible to revert the entire merge without squashing using git revert -m 1 <merge-commit-hash> if necessary.)

  3. Increased Revert Conflicts: Large, monolithic squashed commits that touch many files have a higher likelihood of merge conflicts when reverted later.

  4. Potential Loss of Commit History: Squashing condenses multiple commits into one, losing the detailed history of incremental changes and their reasoning.

  5. Code Review Traceability: The connection between review comments and specific commits is lost, making it harder to track how feedback was addressed.

  6. Context Preservation: Valuable context in individual commit messages about why specific changes were made may be lost when squashed.

  7. Contributor Attribution Concerns: Individual contributions become obscured when multiple authors' work is combined into a single commit.

  8. Branch Synchronization Issues: If a feature branch isn't deleted and later updated (for example, to work on new changes or to rebase onto an updated main), Git sees its original commits as different from the squashed commit, even though they represent the same changes. This creates divergence between feature branches and main, leading to duplicate changes during rebases, commit identity mismatches, and messy history resolution requiring manual intervention.

Proposed Solution

Disable squash merging in repository settings to better preserve our commit history.

How to Change the Setting

  1. Go to https://github.com/RooVetGit/Roo-Code/settings
  2. Scroll down to the 'Pull Requests' section
  3. Under 'Allow merge commits', ensure this option is checked
  4. Under 'Allow squash merging', uncheck this option
  5. Under 'Allow rebase merging', uncheck this option, too, because it would prevent merge-reversion
  6. Click 'Save changes'

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions