logoalt Hacker News

wasmpersontoday at 3:37 PM2 repliesview on HN

Alternatively: don't worry about keeping trunk "green" at all. Have a second branch called "stable" or something that auto-fast-forwards to latest trunk whenever trunk is green. Checkout stable, push new changes to trunk, avoid breaking CI, but if you break CI then don't worry about it, just push up a fix.

If you act like trunk is this "sacred" thing that must always be ready to deploy then what you end up with is a bunch of long-lived branches and PRs and all the merge conflicts and overhead that come with those.


Replies

ReaLNerotoday at 3:51 PM

I don’t understand how this would work.

If you’re using Git and you branch off ‘stable’, you won’t be able to merge to ‘trunk’ unless you rebase to pick up all of its changes. If a commit were to be reverted in the trunk now you need to revert it from all PRs as well. In the end, it’s equivalent to having one branch.

conradludgatetoday at 3:55 PM

How does this work with a monorepo with hundreds of teams around the globe? If you break the trunk, that means no other teams can release