RFC: b4 prep --enforce-deps to materialize series dependencies locally

Maurice Hieronymus <[email protected]> Sat, 11 Jul 2026 10:19:37 +0200
Newsgroups org.kernel.linux.tools
Message-ID <[email protected]>
Hi Konstantin,

b4 prep can declare series dependencies (--edit-deps) and verify them
(--check-deps), but it never materializes them: --check-deps applies
everything in a throwaway sparse worktree and discards it. If I work
on stacked series, I still stack the branches by hand, and re-stack
them by hand every time a prerequisite gets a new revision.

I'd like to close that gap with something like:

  b4 prep --enforce-deps

which reads the declared prerequisites, figures out what needs to be
rebased on what, and runs the git commands to bring the local branch
into the state the dependencies describe. Conflicts stop the rebase
as usual and are the user's problem. Since an enforce can involve
several steps, there would also be:

  b4 prep --abort-enforce-deps

which restores the pre-enforce state after a partially completed
enforce. That means saving the branch head and tracking state to
a backup ref before touching anything.

If this is seen as useful I can sketch a prototype and send patches.

Best,

Maurice