- easier to read/analyze
- have better documentation (more isolated git metadata/history)
- are easier to debug (and possible to bisect; it's not possible to bisect a squashed commit).
The problem is that it requires a significant amount of discipline (of course, 100% rate of atomic commits is not possible, but high rate is).
> The squash branch on merge strategy is just lazy
"Lazy" is the negative way of saying "easy" or even "more efficient". "Lazy" implies that the other way is better. Is it? Maybe sometimes.
Am I "lazy" if I walk on my feet instead of my hands? It really is a lot easier.
Also is a lot faster to write and easier to communicate compared to messing around with moving code across commits, ensuring tests pass across them, etc.
Basically I think people care more about what was built and how it works rather than how to split it up step by step (although if the latter is important I can add a comment for that on the PR - although ideally it would have been separate PRs.)
That vanishes when you shift forges
In practice, if bisecting indicates a commit caused the problem you can narrow it down further by checking out that branch and investigating further within that branch (which ideally isn't too large). Also, if you have a highly structured PR then you may need to be careful to ensure that each individual commit passes CI.
At that point you might as well ship each commit via a separate PR. (While in development you can temporarily set the branch for Part 1 as the base for Part 2.)
A PR for each commit seems overkill. Usually a PR is for a feature, but code-wise, a feature might require several atomic changes. For example: prepare configuration, move files around, add tests, add new code, delete old code, refactor. Each of those could be a separate commit, bringing you to a polished feature with test coverage.
I think splitting PRs into multiple commits can make sense when there are only 2-3 commits but you're right that it doesn't when there are more than that.
Absolutely. Indeed, this (independent commit) is a very positive side effect (typical example: separating refactoring commits).