Subscribe Work with me
← All hacks Git3 min read

Why the second fast forward asks for a new pipeline

Three branches were ready for the same target branch. Landing them one at a time cost a pipeline round each, until they were stacked first.

How to do it

  1. A fast forward push needs the target branch to be an ancestor of the branch head. Land one branch and the other heads no longer contain the target, so each of them costs a fresh pipeline round.
  2. Stack them instead of queueing: merge origin/<target> into A, A’s head into B, B’s head into C. Push all three and let the three pipelines run at the same time.
  3. When all three are green, fast forward A, then B, then C, back to back, seconds apart. All three merge requests showed as merged, because each head sha sat inside the commits that were pushed.
  4. Prove review still covers each branch’s own part: pipe `git diff origin/<target>…A`, `git diff A B` and `git diff B C` through `git patch-id --stable`. The same id as the reviewed head means that verdict still holds.
  5. Write in each description that while stacked, B and C show A’s files too, so nobody reads them as unexpected changes.
  6. Ask the other people and sessions who push to the target to hold for about fifteen minutes before the final round. While we were landing one at a time, another session pushed to the target twice.
Prompt to copy
I have three branches (A, B, C) all waiting to fast forward onto <target>. Before any push: merge origin/<target> into A, A's head into B, B's head into C. Then show me the patch ids from `git diff origin/<target>...A`, `git diff A B` and `git diff B C`, each piped through `git patch-id --stable`, and tell me which heads still need a pipeline. Do not fast forward anything until all three pipelines are green, then do the three pushes back to back and read each merge request back to confirm it says merged.

One AI hack in your inbox, every morning.

Short, practical, with the prompt to copy. Unsubscribe in one click.