Principle:Apache Kafka Squash Merge
| Knowledge Sources | |
|---|---|
| Domains | Development_Workflow, Version_Control |
| Last Updated | 2026-02-09 12:00 GMT |
Overview
A version control merge strategy that combines all PR commits into a single squash commit with proper attribution on the target branch.
Description
Squash Merge takes all commits from a pull request and combines them into a single commit on the target branch. The resulting commit message includes the standardized JIRA reference, PR description, author attribution (including co-authors), reviewer credits, and a Closes #N trailer. This produces a clean, linear history on the main branch while preserving full attribution.
Usage
Use this principle when merging PRs to the main development branch. Squash merge is the standard merge strategy for the Apache Kafka project, ensuring a clean commit history.
Theoretical Basis
- Branch Fetch: Fetch the PR branch from the contributor's remote.
- Squash Merge: Use git merge --squash to combine all PR commits into a single staged change.
- Commit Construction: Create the merge commit with formatted message including author, reviewers, and Closes #N.
- Attribution: Preserve authorship by setting the commit author to the PR author and including co-authored-by trailers.