Hacker News new | ask | show | jobs
by maushu 2619 days ago
Someone forgot about continuously merging master to feature branch to keep the merge simple.
2 comments

Please don't merge continuously, rebase instead. You have to handle the conflict one way or the other. But at least rebasing doesn't give you an incomprehensible git history filled with spaghetti and extraneous merge commits.
You can always squash the branch before merging back to master.
If everyone is working in a feature branch and only bug fixes are done in master, then most of the merges will be simple. However, when a feature is done and merged to master, all the feature branches need to merge the work and that merge will be disproportionately difficult.

kennethh posted a link that explains this well: https://martinfowler.com/bliki/FeatureBranch.html

Only if you don't know rerere, and don't use it immediately after updating master. I carry tons of feature branches with me, which are automatically rebased. Only once or twice a year I need to fixup things a bit, and those things are the things I immediately worked on, so I know for sure how to merge it. Everything is scripted.

If you let them stall it becomes a mess, sure. If do it properly it's trivial.

You cannot avoid this, only can parcel the cost and accept more breakage on the way.

With a big merge, others have time to inspect and know of breaking changes. with million tiny merges (or working on trunk, same) you either freeze change due to risk of breakage or end up with broken master regularly.