There's different "mistakes" that can be made. Unnecessarily squashing (what you described, in git terms) is a mistake, but not really of the kind Linus is talking about. He's talking about things like "I committed a couple of commits, then took a different approach with a couple of more commits, then realized that didn't work and went for a different answer, then took a couple of commits to clean up the resulting debug code". There's no reason to leave all the temporary debug code (as opposed to permanent logging code) in there, or to leave the abortive approach in the history for others. Extra stuff like that just imposes cognitive gain for no value, in general. (If you have a specific case where that's not true, go for it, but you're probably still better off just dropping some comments into the final code.)