top | item 28109016

(no title)

jonjonsonjr | 4 years ago

Can you explain why? I've found that it is a lot simpler to use git bisect if every commit builds.

discuss

order

cortesoft|4 years ago

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.

IshKebab|4 years ago

I'm pretty sure they mean every commit on `master` or `develop`. Not every commit in your `add_new_feature` branch.

olejorgenb|4 years ago

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