The article is suggesting that while you are working you can commit as you go, quick and dirty, irrelevant of the changes. Once you get something working and it's ready to be merged, then you can go back rewrite the branch, removing back and forth changes and writing a good commit message with the reason for it for every one change.
This way, the history would be meaningful instead of it be littered by fix up commits and it makes reverts easy.
> The article is suggesting that while you are working you can commit as you go, quick and dirty
Why would someone do that?
Iād argue that if there is cleaning to be done, it should be done way before something is ready to be merged, while context is fresh in your head.
Also, cleaning before something is ready to be merged will lead to sloppy history removal as, often, people are eager to merge for a variety of reasons, and rewriting history may not be seen as a priority.
I personally commit and push to a branch when I think there's enough changes for someone else to review my work (of course with WIP flag), in case if someone is curious and once any of the changes are ready to be merged (this can be before the review changes), I'll clean up and write nice commits.
I guess it's personal preference, I don't recall losing context, as I don't let too much of time passed. And I actually ensure nice commits are written before code review otherwise it might be harder for the reviewer to get the context of the changes.
This way, the history would be meaningful instead of it be littered by fix up commits and it makes reverts easy.