Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize on squash and merge #207

Closed
dbeatty10 opened this issue Nov 21, 2024 · 2 comments
Closed

Standardize on squash and merge #207

dbeatty10 opened this issue Nov 21, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@dbeatty10
Copy link
Contributor

dbeatty10 commented Nov 21, 2024

Describe the feature

Only allow squash and merge. Don't allow merge commits or rebase merging.

Additional context

To improve our repository’s workflow and maintain a clean, consistent history on the main branch, we’ve decided to standardize on squash and merge as the only merge method for pull requests.

Here are the key reasons:

  1. Clean Commit History: Each pull request will be represented by a single, meaningful commit, making the main branch easier to navigate and understand.
  2. Reduced Noise: Intermediate commits like "fix typo" or "address PR comments" won’t clutter the history.
  3. Simplified Debugging: Using tools like git blame becomes easier, as changes are tied to a single commit instead of scattered across multiple.
  4. Consistency: A standardized merge strategy ensures that our repository’s history and development process are predictable and easy to follow.

We’ve chosen not to use merge commits or rebase merging because they can complicate the history, introduce merge conflicts in certain scenarios, and require additional attention to detail during the merge process. Squash and merge strikes the right balance between flexibility during development and simplicity in the repository.

Who will this benefit?

  • Contributors: Can focus on making incremental commits while working without worrying about polishing every commit message. Squash and merge ensures final work is cleanly presented.
  • Reviewers: It’s easier to review pull requests when the final commit reflects the meaningful changes without being distracted by intermediate or experimental commits.
  • Maintainers: A clean, linear history simplifies repository maintenance, debugging, and tracking changes over time.
  • Future Collaborators: A tidy main branch improves onboarding for new contributors by making it easier to follow the history of changes and decisions.
@dbeatty10 dbeatty10 added enhancement New feature or request triage and removed triage labels Nov 21, 2024
@dbeatty10
Copy link
Contributor Author

Implementation

This setting can be managed here:
https://github.com/dbt-labs/dbt-codegen/settings#merge-button-settings

There is no "save" button: ticking or unticking checkboxes will make the change immediately.

Before

image

After

image

@dbeatty10
Copy link
Contributor Author

Here's what the button for pull requests looks like after these settings are updated:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant