Also, squashing is a pretty bad practice as it is. I can understand that it may make sense sometimes, but most of the time if you don’t commit every other character you input, you’re better off leaving some history of how your code evolved and what changes were coming together
I think squashing is great and I would never want to go back. It helps ensuring:
All commits in main have useful messages. No more “fix pipeline errors”, “fix MR comments”, etc.
Ensures pipeline has been successful with all commits in main. No need to guess which commits will build and won’t build.
Easy to revert commits.
Eliminates incompressible history because someone had a bad day with git.
Encourages frequent commits. No need to ensure all commits are perfect and good in their own right. Commit when you want to commit even if it’s incomplete work.
And IMO, if your work warrants multiple commits, then it probably also warrants multiple merge requests. Merge requests should be rather small to make it easier to review.
Edit: another good thing is that when we decide to release, we can easily look through the commit history for a change log. No more sifting through minor fixes commits.
I agree with most of these but there’s another missing benefit. A lot of the time my colleagues will be iterating on a PR so commits of “fuck, that didn’t work, maybe this” are common.
I like meaningful commit messages. IMO “fixed the thing” is never good enough. I want to know your intent when I’m doing a blame in 18 months time. However, I don’t expect anyone’s in progress work to be good before it hits main. You don’t want those comments in the final merge, but a squash or rebase is an easy way to rectify that.
Merge requests should be rather small to make it easier to review.
With this I wholeheartedly agree
if your work warrants multiple commits, then it probably also warrants multiple merge requests.
With this not so much, but if you keep your merge requests so small, squashing them is no big deal, that’s a good counterexample for my previous point.
another good thing is that when we decide to release, we can easily look through the commit history for a change log. No more sifting through minor fixes commits.
That still requires you to write meaningful messages, just a bit rarer. We do have trouble with change logs, but we had exact same problems when people squashed left and right. Maybe squashing helps self-discipline, though, I haven’t thought about it that way
Also, squashing is a pretty bad practice as it is. I can understand that it may make sense sometimes, but most of the time if you don’t commit every other character you input, you’re better off leaving some history of how your code evolved and what changes were coming together
I think squashing is great and I would never want to go back. It helps ensuring:
And IMO, if your work warrants multiple commits, then it probably also warrants multiple merge requests. Merge requests should be rather small to make it easier to review.
Edit: another good thing is that when we decide to release, we can easily look through the commit history for a change log. No more sifting through minor fixes commits.
I agree with most of these but there’s another missing benefit. A lot of the time my colleagues will be iterating on a PR so commits of “fuck, that didn’t work, maybe this” are common.
I like meaningful commit messages. IMO “fixed the thing” is never good enough. I want to know your intent when I’m doing a blame in 18 months time. However, I don’t expect anyone’s in progress work to be good before it hits main. You don’t want those comments in the final merge, but a squash or rebase is an easy way to rectify that.
With this I wholeheartedly agree
With this not so much, but if you keep your merge requests so small, squashing them is no big deal, that’s a good counterexample for my previous point.
That still requires you to write meaningful messages, just a bit rarer. We do have trouble with change logs, but we had exact same problems when people squashed left and right. Maybe squashing helps self-discipline, though, I haven’t thought about it that way