I saw a lot of people merging branches a single commit "to keep the history clean" while in fact it just made the history less legible and less reversible.
I saw a lot of people merging branches a single commit "to keep the history clean" while in fact it just made the history less legible and less reversible.
This way, the history would be meaningful instead of it be littered by fix up commits and it makes reverts easy.
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 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.
Of course you have to consider what history is relevant and create relevant commits for those. But a WIP commit at the end of the day is rarely more relevant when split up from the finishing up of that work the next morning.