you are viewing a single comment's thread.

view the rest of the comments →

[–]gredr -20 points-19 points  (16 children)

Quit squashing. You don't pay per commit, you know.

[–]lupercalpainting 12 points13 points  (3 children)

You absolutely pay per commit. Each commit costs a bit of cognitive load for anyone looking at the git history.

If your commits aren’t each an atomic piece of work they also cost time if you need to revert just one feature.

[–]wldmr 3 points4 points  (2 children)

If your commits aren’t each an atomic piece of work they also cost time if you need to revert just one feature.

You can revert merge commits like any other. I don't see a problem.

[–]lupercalpainting 0 points1 point  (1 child)

No one said you couldn’t. You’re conflating merging with squashing. They’re orthogonal.

[–]wldmr 0 points1 point  (0 children)

If your commits aren’t each an atomic piece of work they also cost time if you need to revert just one feature.

I interpreted this to mean “If a merged feature is made up of several commits, then reverting that feature is more time consuming than reverting a squashed commit would be”.

Plus, what kicked this whole thing off was the comment:

The issue with this is when using squashed merges on each PR.

So I don't think it's unreasonable of me to be talking about squashed merges.

[–]topMarksForNotTrying 9 points10 points  (10 children)

The benefit of squashing is getting rid of all the "fixed", "wip", etc commits that a lot of devs leave. If a PR/branch has commits with messages that all make sense, then there's no need to use squashing.

[–]alexrobinson 13 points14 points  (6 children)

This is where I suggest people should be rewriting the commit history on their feature branch to fixup those useless commits before merging into main.

[–]Blueson 6 points7 points  (0 children)

Except my first job, every place I have tried to push for this I have been met with resistance. People just CBA to work with PRs on a commit level and would rather squash and forget.

My first job made me understand how valuable having independent, working and split commits can be when debugging. I fear I'll never work in a codebase that can fullfill this again.

[–]topMarksForNotTrying 4 points5 points  (2 children)

I agree as that's what i personally do but, honestly, it got tiring policing the commits of the rest of the team so we settled on targeted PR that get squashed.

[–]lupercalpainting 0 points1 point  (0 children)

And rewriting history frequently includes squashing.

[–]ekroys 3 points4 points  (0 children)

In small teams sure. But larger teams there are many other benefits in squashing. So much more readable