[PATCH b4 0/3] review-tui: align take->merge with b4 shazam
Christian Brauner <[email protected]> Mon, 22 Jun 2026 14:20:42 +0200
| Newsgroups | org.kernel.linux.tools |
|---|---|
| Message-ID | <[email protected]> |
The review TUI's "take" action (merge method) applies a reviewed series to
a target branch, but it had drifted from how `b4 shazam` behaves on the
command line in two annoying ways.
It ignored b4.shazam-merge-flags entirely, so --log, --stat and --gpg-sign
had no effect from the TUI, and because the cover was composed in b4's own
editor and then committed with `git merge --no-edit`, git never got a
chance to apply those flags or to show the --log shortlog for review.
Worse, it applied the merge by checking out the target branch in the
current worktree. That clobbered whatever was checked out there, and when
the target was already checked out in another worktree it just failed:
Could not checkout vfs-7.3.kfunc: fatal: 'vfs-7.3.kfunc' is already
used by worktree at '/home/brauner/src/git/linux/vfs/vfs-7.3.kfunc'
which makes the whole thing unusable if you drive review from a different
worktree than the one you merge into, as I do.
So make the TUI take->merge behave like shazam: honor shazam-merge-flags,
write the cover with -F and let `git merge --edit` open it (with a real tty
under the TUI's suspend()) so the flags apply and the message -- shortlog
included -- can be reviewed before committing, and label FETCH_HEAD the way
shazam does. Run the fetch and merge in whichever worktree already holds
the target branch, or a throwaway one when it isn't checked out anywhere,
instead of touching the current checkout -- so a series can be taken onto a
branch that lives in any worktree.
Signed-off-by: Christian Brauner (Amutable) <[email protected]>
---
Christian Brauner (3):
review-tui: honor shazam-merge-flags in take->merge
review-tui: run take->merge in the target branch's worktree
review-tui: test shazam-merge-flags and worktree resolution
src/b4/__init__.py | 16 ++-
src/b4/review_tui/_modals.py | 6 +-
src/b4/review_tui/_tracking_app.py | 286 ++++++++++++++++++++++++-------------
src/tests/test_tui_tracking.py | 185 +++++++++++++++++++++++-
4 files changed, 390 insertions(+), 103 deletions(-)
---
base-commit: 63c58f10c35d45a3ab9f63f22d285866b9f2fbee
change-id: 20260622-review-tui-take-merge-177ee85e0a0b