News for hackers. Stuff that matters.
Re:Prime Video Abandons Serverless Distributed Stack for Mon... by Akronymus on Thursday May 04, 2023 @06:06AM (#35813231)
Currently we have the problem of merges of two working branches occasionally resulting in a broken one. How does one solve that?
Re:Prime Video Abandons Serverless Distributed Stack for Mon... by withinboredom on Thursday May 04, 2023 @06:35AM (#35813408)
Don’t merge. Rebase only. Keep a linear history.

When committing, do a ff-only of ‘main’ to your branch. Yes, this forces everyone to rebase before “merging” but in practice, this results in the least amount of failures, tests being run after you resolved any conflicts, etc.

If you can use GitHub merge queues, that solves a ton of this, and you can run tests on the final merge before actually merging instead of relying on rebasing.

Re:Prime Video Abandons Serverless Distributed Stack for Mon... by whstl on Thursday May 04, 2023 @09:12AM (#35814726)
"Don’t merge. Rebase only. Keep a linear history."

This. It makes life so much simpler. With teams that don't have a lot of experience with git, however, I tend to use the "Squash and Merge" feature, coupled with forcing a linear history.

Re:Prime Video Abandons Serverless Distributed Stack for Mon... by lxgr on Thursday May 04, 2023 @09:18AM (#35814808)
Requiring a passing integration branch before merging to master. Merging the integration branch then becomes a fast-forward merge.

Alternatively, if you have a low enough merge volume, requiring mergers (by policy) to squash and rebase (and re-run tests before attempting to merge) can work too, as others have already mentioned.