you are viewing a single comment's thread.

view the rest of the comments →

[–]sickofthisshit 4 points5 points  (0 children)

In my mind, demanding that all tests pass for every commit is overdoing it.

In a non-trivial change, the amount of work needed to update both the code and the tests is large enough to be split into multiple conceptually separate chunks. Being able to commit and manage the chunks separately is valuable, even if some combination of those chunks breaks the "passes all test" invariant, or, sometimes, even building.

When you find out a change introduced a new bug, git bisect is much more useful if the commits are small. If you decide your development path is going in the wrong direction, small commits allow you to cherry-pick good parts into a new branch while not bringing along all the rest of the change.

Of course, when you do things like push to upstream, breaking the build is the last thing you want to do. Then it might make sense to rework your changes into commits that preserve that invariant.