Hacker News new | ask | show | jobs
by jonjonsonjr 1772 days ago
Can you explain why? I've found that it is a lot simpler to use git bisect if every commit builds.
2 comments

There are two competing interests, and the author suggests cleaning up after so that you can satisfy both.

The first interest is what you said, for every commit to build.

The second interest is to help prevent loss during development. If I am working on something and need to finish for the day, but haven't yet got the code to a working state, I want to be able to commit and push my code in case something happens to my laptop.

Also, sometimes I am making a series of big changes, but I need to make them all for the code to work. I want to have checkpoint along the way, in case I need to undo something (or even just see what I have changed since the checkpoint!) committing WIP code that doesn't build lets you do that.

We usually solve this problem with squash merges, so every commit on the main branch is the full working feature, but there are downsides to that technique.

I'm pretty sure they mean every commit on `master` or `develop`. Not every commit in your `add_new_feature` branch.
It's in the ambiguity we can discuss where the rules make sense :)

    git bisect --first-parent
Every merge commit should build is a more reasonable policy