4 ms·
> I really want to put the 'enough is enough' point before worrying about a good looking commit history. I see where you're coming from, but I'd like to add a
by Shacklz 5y ago
> I really want to put the 'enough is enough' point before worrying about a good looking commit history.
I see where you're coming from, but I'd like to add a counter-argument to that. I'm currently working on a (mono-) repository with 40-something devs working on it, and we've recently switched from a "everything goes"-commit-history-approach to enforced linear history (while only a handful of people are allowed to directly commit on main-lines without a pull request).
The main reasoning was this: It became almost impossible to understand why a build broke on the mainline by just looking at the commit-history itself. It was always needed to go through build-logs and such to get the picture of the how and why, and often even to get to the 'who', because the commit-history itself was just riddled with merge-commits. For the few devs who took care of that, this was a huge issue, while everyone else was just happily committing away.
So going to the linear-history-approach made "analyze, understand" a breeze, but made "insertion" harder. We had to put in quite a bit of effort to get everyone up to speed (rebase, squash, reset, cherry-pick etc.) and set up some tooling for basic sanity-checks (pre-push-hooks etc.), but it was well-worth it, and a lot of devs were actually happy to be guided through this because for them it's clear that this will also be useful further down the road (in other jobs), not just for the current task at hand.
And at last: It's really not that big of a deal. Just before opening a pull-request (or whatever your equivalent is), have a look through your change-set, run a bunch of commands if necessary, and done. Once you get the hang of it, it's pretty straight forward. It might not be worth it for you personally, but if you work on a repository with many other devs, there might be others who are grateful for that.
- deleted 5y ago[deleted]
- tharkun__ 5y agoThis, so much this. Same boat here (for long-ish values of "recent"). I can only second all of what you've said. Rebasing and squashing really aren't that hard. If you ask me, selecting who you want to work with simply based on whether they can be taught to rebase and squash is a really good filter. If someone can't manage that, it is very very likely that you won't be happy to talk to them about small commits (easy to PR), good code hygiene and maintainable code, continuous deployments throughout the day (yes, OMG, you have to keep master green at all time, you have to follow up etc.) and a bunch of other things. That's fine by me, but I'd prefer not to work for the same small company as them or at least a few departments away in a larger one. All of these practices have so many advantages but many people don't or don't want to understand. You can generally teach this to people but it does need everyone to understand and pull on the same string. You can't have a bunch of people in a such a system that just never check the master build after merging.
- jheriko 5y agothis is the opposite of my experience at any large workplace. you can look at merge commits on the history to achieve the same without losing power or data.
- Nullabillity 5y agoAnd how does avoiding merge commits help you here? All you've done is throw away useful context. If you want the squashed history, just do a --left-only traversal.