← Back to context

Comment by keybored

2 years ago

> As a reviewer, —amend means I need to reread the whole commit to see what changed. A tiny commit means it takes me seconds.

A `git commit --fixup` commit can be made which does that. Then when the review is done `git rebase -i --autosquash`. Like squashing but with fine-grained control.

Yeah, fixup commits are the answer when it comes to responses to reviewers, who can easily see just what changed since the last time.

It's even better if there's some system that ensures authors remember to do the squashing, such as by prohibiting actions that would bring fixup commits into the main development branch.

Personally, I use `--fixup` even before making a PR, particularly if there's some work that I want to split into "refactoring prep" versus "the new feature."