TT Lab
Blog

한국어 English 日本語 中文

Get started
Blog

Blog

Could you squash your commits?: Responding to a request to combine commits

Today's English Expression 21/30 - Step: Receiving and responding to reviews. All example sentences were created for this post. They are not taken from actual repository comments, and the commit messages are examples.

Table of Contents

At a Glance

Expression Could you squash your commits? / Squashed into one commit.
Meaning Could you combine your commits? / Squashed into a single commit.
Usage Context Requests and responses in the final stages of a review
Politeness Neutral. It is a procedural request.

1. Meaning and Nuance

"Squash" means to press or crush something flat, and in Git, it refers to combining multiple commits into one. You do this by selecting squash or fixup in git rebase -i , or by using git commit --fixup and git rebase --autosquash together.

Why ask to combine them? Going through reviews accumulates commits like "fix typo", "address review comments", and "wip". While these are useful during the review, they make the history hard to read after being merged. The KubeVirt reviewer guide states that every commit should be meaningful and instructs reviewers to ask for commits like "Fix reviewer comments", "wip", and "addition" to be squashed.

When to squashis also important. The Kubernetes contribution guide advises uploading fixes as new commits during the review and not squashing them yet. This is because reviewers need to be able to see the modifications separately. Squashing is done when requested, usually around the time you receive LGTM. The guide also sets criteria: combine fix-up commits, but do not combine independent changes that share a single goal. Additionally, in repositories using Prow, you can use the tide/merge-method-squash label to let the bot combine commits upon merging, which explains that unlike manual squashing, this prevents the lgtm label from disappearing or requiring CI to be rerun.

Squashing changes commit hashes, so a force push is required. We use git push --force-with-lease seen in Episode 12.

2. Example Sentences

Scenario 1: Maintainer's Request

This looks good to merge. Could you squash the fixup commits into the main one before we merge?

Scenario 2: Author's Response

Done. Squashed into two commits: one for the API change and one for the generated files.

Keeping generated files in a separate commit is a common convention to make it easier for reviewers to focus on human-written changes. Follow repository rules.

Scenario 3: When the Author Asks First

Should I squash the commits now, or would you prefer to keep them separate until the review is done?

Preferences vary by reviewer, so asking is the safest route.

3. Similar Expressions and Differences

4. Common Mistakes by Korean Speakers

5. One-Line Practice

As the author, write the following as a comment.

I combined the review modification commits into a single commit and force-pushed.

Model Answer

I've squashed the review fixes into a single commit and force-pushed.

Even when used as a verb, "force-push" often includes a hyphen. Letting the reviewer know you force-pushed helps them immediately understand why the screen changed.

Titi's Tip. Accumulate commits during the review and combine them at the end. Following this order is easier for both reviewers and the history.

References

Sign in to like

Comments

No comments yet.

Sign in to leave a comment