4 ms·
A lot of people seems to suggest that squashing PR's branches is better because you don't get commits that are broken and it doesn't work good with "git bisect"
by mpawelski 6y ago
A lot of people seems to suggest that squashing PR's branches is better because you don't get commits that are broken and it doesn't work good with "git bisect".
But IMO it's not a big deal, you just do "git bisect skip" for these comments and at the end of bisecting session instead of one wrong commit you'll get couple of, for example one commits that builds and two that you skipped and doesn't build. It's very likely that looking only at this 3 commits will help you find the issue because they might be part of much bigger branch which would otherwise be squashed to one huge commit with enormous diff.
I much more prefer to require that PR's branches are always merged without fast forwarding. So there is always merge commit for PR. Then you can actually display list of this commit with "git log --first-parent" and they should always build because build server verifies it.
Unfortunately "--first-parent" doesn't work for "git bisect" now, but it finally will in the next git release! [1]
[1]https://github.com/git/git/blob/ab4691b67bc1a2cd8d9068fb03e3fbd6979247d6/Documentation/RelNotes/2.29.0.txt#L28 https://github.com/git/git/blob/ab4691b67bc1a2cd8d9068fb03e3...