Re:Fortunately, I don't squash my commits
by rutthenut on Monday October 05, 2020 @09:37AM
(#24687642)
I'm a bit confused on your comments here.
You state "I often do intermediary commits that don't compile ... to make sure that I don't lose the code"
And follow that with "I want every commit to compile and be testable individually."
Re:Fortunately, I don't squash my commits
by StanLindsey on Monday October 05, 2020 @10:54AM
(#24688281)
I'm the same as OP. I commit constantly when hitting a natural stop point or when taking a break and push up to my branch/pr. I hate having code locally that hasn't been pushed to the origin.
But doing this means I have many commits that don't mean anything or are unfinished and in an uncompilable state.
So I git rebase and massage the history to make more sense.
The alternative is making bisecting harder which is not something that I want. I want every commit to compile and be testable individually. That definitely doesn't mean that I think it's a good idea to have "gargantuan" commits.
An ideal commit should contain a single, atomic change to the codebase. Not more, but also not less.