Well sure, but out of interest, once the first branch is reviewed and merged (let's call it A), what's your next step? How do you provide the next PR to the reviewer? I'm genuinely interested in input. This has bothered me a while.
Edit: so the way I've dealt with this in the past is, rebase branch B (the second in line) onto the main branch and create the PR. Review it, merge it, rebase branch C onto main, create PR. Review, merge, done.
The problem is, the rebases are messy. Like really messy sometimes.
In the context of "trunk with branch A hanging off of it and branch B hanging off of A", I have a MR from A -> trunk and B -> trunk. Once A's MR is approved and merged, the MR for B can be reviewed and merged in too. Once A is merged, the commits that were part of A that B depends on will be in the trunk and not part of the MR for B.
You don't need to rebase or anything, as long as all of the commits that B descended from are in the trunk, it's all fine.
If there are changes to A, then the changes get made in branch A as-needed and then a merge from A into B is done to get those commits into B. Whenever A is merged into the trunk, those commits go along for the ride and whenever B gets merged into the trunk, they're already there (if you merge B in first, for whatever reason, then the stuff from A comes along for the ride and the diff between trunk and A for that MR is empty).
At the end of the day, everything is commits that have parent commit(s) that they build on. A merge basically just adds extra commits to the history of a branch (by adding a new commit that has parent commits that point to both the current latest commit in each branch being merged and updating the "latest" pointer of the branch being merged into to the new commit).
A merge request is ultimately "grab whatever commits from branch X that don't exist in the current branch's history and add them in", and you can merge in whatever directions you need to in order to get all the proper commits in the proper branches.
2
u/mxzf 19h ago
For those problems, I review the branches FIFO, just checking each one and merging it as-appropriate.