3 ms·
It really depends on where you work and how your company's repo is organized. For instance, where I work 20 squash commits would represent, at most, 10 minutes
by vonmoltke 6y ago
It really depends on where you work and how your company's repo is organized. For instance, where I work 20 squash commits would represent, at most, 10 minutes worth of commits to the monorepo. Not squashing on merge would quickly turn thousands of daily commits into tens of thousands. It's already impractical to find suspect commits via git, and we typically use our code review tool to find the change that broke something (and that change includes the developer's full branch history). Adding more commits would needlessly slow down the tooling that displays 'git blame' results (and likely other commands).
I suspect there is a pattern in the comments here. People who work on small teams with granular repos that, individually, don't see a lot of daily activity think squashing is bad and erases valuable history. People who work with large repos that see high commit velocity (like a monorepo) think squashing (at least merge squashing) is beneficial and don't see the loss of information as problematic because it's hard to access it in the first place. Maybe I'm just projecting my own opinions on this; I'd like to hear perspectives that conflict with my assumptions.
- spdionis 6y agoYou are definitely correct. People who argue against squashing have not worked on 10+ years old actively developed repositories, or in big enough teams. A commit is a change. A change has a ticket. A ticket is a small piece of work that does not result in 3k changed lines. This ensures that the change rationale is fully documented and easily identifiable. Nobody needs those "fixed typo" commits. Nor the "implemented function A" commits. What IS the change that you're doing? What functionality? That's the most comfortable commit granularity to debug imho.
- mixmastamyk 6y agoAgreed, I regularly add comments later as well. Understanding often comes after the code works. I could obsessively fiddle with every commit like an artesenal snowflake, or I could click the squash checkbox on the request.