Write broken commits for better review
huonw.github.io> The common thread through these is that we’re building a PR that involves some mechanical changes and some ‘real’ ones. Separating them at the commit level, even if invalid, makes both types of changes easier to understand
My recommendation is to keep the commit separated, but go and rewrite the history of the branch to get all intermediate commits compiling. It's painful, but it help the reviewer checking what happened.
Broken commits are useful as proof you already tried something that didn't work.