Linux maintainer tooling and workflows
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: "Kernel.org Tools" <tools@kernel.org>
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
	 "Christian Brauner (Amutable)" <brauner@kernel.org>
Subject: [PATCH b4 3/6] review-tui: use the shared scratch-worktree overrides for test applies
Date: Wed, 29 Jul 2026 12:44:30 +0200	[thread overview]
Message-ID: <20260729-work-b4-scratch-worktrees-v1-3-e96995158d4a@kernel.org> (raw)
In-Reply-To: <20260729-work-b4-scratch-worktrees-v1-0-e96995158d4a@kernel.org>

The test-apply paths build the same sparse scratch worktree in five
places, the four modal am probes and the take flow's cherry-pick probe.
Each of them passes -c commit.gpgsign=false on the apply by hand and
nothing at all on the checkout.

That checkout is the bug just fixed in git_fetch_am_into_repo(). With
submodule.recurse=true the probe's checkout -f dies in any repo that
carries submodules, so every test apply reported a failure that had
nothing to do with the patches.

Let's switch all five sites to SCRATCH_GIT_OPTS. gpgsign means nothing
to a checkout and recursion means nothing to am and cherry-pick, so the
one list serves every command and the applies keep behaving as before.
The per-site "# No signing" comments go with it.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
---
 src/b4/review_tui/_modals.py       | 44 ++++++++++++++++++++++++--------------
 src/b4/review_tui/_tracking_app.py | 11 ++++++----
 2 files changed, 35 insertions(+), 20 deletions(-)

diff --git a/src/b4/review_tui/_modals.py b/src/b4/review_tui/_modals.py
index 89253bc..1d8ea4f 100644
--- a/src/b4/review_tui/_modals.py
+++ b/src/b4/review_tui/_modals.py
@@ -1075,15 +1075,18 @@ class TakeConfirmScreen(ModalScreen[bool]):
             # Test apply in a temporary sparse worktree
             try:
                 with b4.git_temp_worktree(topdir, resolved_base) as gwt:
-                    ecode, out = b4.git_run_command(gwt, ['sparse-checkout', 'set'])
+                    ecode, out = b4.git_run_command(
+                        gwt, [*b4.SCRATCH_GIT_OPTS, 'sparse-checkout', 'set']
+                    )
                     if ecode > 0:
                         return False, 'failed to set up worktree'
-                    ecode, out = b4.git_run_command(gwt, ['checkout', '-f'])
+                    ecode, out = b4.git_run_command(
+                        gwt, [*b4.SCRATCH_GIT_OPTS, 'checkout', '-f']
+                    )
                     if ecode > 0:
                         return False, 'failed to checkout base'
-                    # No signing: gpg would prompt while the TUI owns the tty.
                     ecode, out = b4.git_run_command(
-                        gwt, ['-c', 'commit.gpgsign=false', 'am'], stdin=ambytes
+                        gwt, [*b4.SCRATCH_GIT_OPTS, 'am'], stdin=ambytes
                     )
                     if ecode > 0:
                         for line in out.splitlines():
@@ -2069,15 +2072,18 @@ class RebaseScreen(ModalScreen[bool]):
         with _quiet_worker():
             try:
                 with b4.git_temp_worktree(topdir, branch) as gwt:
-                    ecode, out = b4.git_run_command(gwt, ['sparse-checkout', 'set'])
+                    ecode, out = b4.git_run_command(
+                        gwt, [*b4.SCRATCH_GIT_OPTS, 'sparse-checkout', 'set']
+                    )
                     if ecode > 0:
                         return False, 'failed to set up worktree'
-                    ecode, out = b4.git_run_command(gwt, ['checkout', '-f'])
+                    ecode, out = b4.git_run_command(
+                        gwt, [*b4.SCRATCH_GIT_OPTS, 'checkout', '-f']
+                    )
                     if ecode > 0:
                         return False, 'failed to checkout base'
-                    # No signing: gpg would prompt while the TUI owns the tty.
                     ecode, out = b4.git_run_command(
-                        gwt, ['-c', 'commit.gpgsign=false', 'am'], stdin=ambytes
+                        gwt, [*b4.SCRATCH_GIT_OPTS, 'am'], stdin=ambytes
                     )
                     if ecode > 0:
                         for line in out.splitlines():
@@ -2342,15 +2348,18 @@ class TargetBranchScreen(ModalScreen[Optional[str]]):
         with _quiet_worker():
             try:
                 with b4.git_temp_worktree(topdir, branch) as gwt:
-                    ecode, out = b4.git_run_command(gwt, ['sparse-checkout', 'set'])
+                    ecode, out = b4.git_run_command(
+                        gwt, [*b4.SCRATCH_GIT_OPTS, 'sparse-checkout', 'set']
+                    )
                     if ecode > 0:
                         return False, 'failed to set up worktree'
-                    ecode, out = b4.git_run_command(gwt, ['checkout', '-f'])
+                    ecode, out = b4.git_run_command(
+                        gwt, [*b4.SCRATCH_GIT_OPTS, 'checkout', '-f']
+                    )
                     if ecode > 0:
                         return False, 'failed to checkout base'
-                    # No signing: gpg would prompt while the TUI owns the tty.
                     ecode, out = b4.git_run_command(
-                        gwt, ['-c', 'commit.gpgsign=false', 'am'], stdin=ambytes
+                        gwt, [*b4.SCRATCH_GIT_OPTS, 'am'], stdin=ambytes
                     )
                     if ecode > 0:
                         for line in out.splitlines():
@@ -3059,15 +3068,18 @@ class BaseSelectionScreen(ModalScreen[Optional[str]]):
         with _quiet_worker():
             try:
                 with b4.git_temp_worktree(topdir, base) as gwt:
-                    ecode, out = b4.git_run_command(gwt, ['sparse-checkout', 'set'])
+                    ecode, out = b4.git_run_command(
+                        gwt, [*b4.SCRATCH_GIT_OPTS, 'sparse-checkout', 'set']
+                    )
                     if ecode > 0:
                         return False, 'failed to set up worktree'
-                    ecode, out = b4.git_run_command(gwt, ['checkout', '-f'])
+                    ecode, out = b4.git_run_command(
+                        gwt, [*b4.SCRATCH_GIT_OPTS, 'checkout', '-f']
+                    )
                     if ecode > 0:
                         return False, 'failed to checkout base'
-                    # No signing: gpg would prompt while the TUI owns the tty.
                     ecode, out = b4.git_run_command(
-                        gwt, ['-c', 'commit.gpgsign=false', 'am'], stdin=ambytes
+                        gwt, [*b4.SCRATCH_GIT_OPTS, 'am'], stdin=ambytes
                     )
                     if ecode > 0:
                         # Extract just the "Patch failed" line
diff --git a/src/b4/review_tui/_tracking_app.py b/src/b4/review_tui/_tracking_app.py
index 2b29dc1..efdfeaf 100644
--- a/src/b4/review_tui/_tracking_app.py
+++ b/src/b4/review_tui/_tracking_app.py
@@ -3370,11 +3370,15 @@ class TrackingApp(LoreNodeShutdownMixin, CheckRunnerMixin, App[Optional[str]]):
             with b4.git_temp_worktree(topdir, target_head) as gwt:
                 # Set up sparse checkout for minimal disk usage
                 ecode, out = b4.git_run_command(
-                    gwt, ['sparse-checkout', 'set'], logstderr=True
+                    gwt,
+                    [*b4.SCRATCH_GIT_OPTS, 'sparse-checkout', 'set'],
+                    logstderr=True,
                 )
                 if ecode != 0:
                     logger.warning('Could not set up sparse checkout: %s', out.strip())
-                ecode, out = b4.git_run_command(gwt, ['checkout', '-f'], logstderr=True)
+                ecode, out = b4.git_run_command(
+                    gwt, [*b4.SCRATCH_GIT_OPTS, 'checkout', '-f'], logstderr=True
+                )
                 if ecode != 0:
                     logger.warning(
                         'Could not checkout sparse worktree: %s', out.strip()
@@ -3382,8 +3386,7 @@ class TrackingApp(LoreNodeShutdownMixin, CheckRunnerMixin, App[Optional[str]]):
 
                 # Try cherry-picking the commits
                 gitargs = [
-                    '-c',
-                    'commit.gpgsign=false',
+                    *b4.SCRATCH_GIT_OPTS,
                     'cherry-pick',
                     f'{base_commit}..{series_tip}',
                 ]

-- 
2.53.0


  parent reply	other threads:[~2026-07-29 10:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 10:44 [PATCH b4 0/6] Keep the user's git config out of b4's scratch worktrees Christian Brauner
2026-07-29 10:44 ` [PATCH b4 1/6] git_run_command: look past -c overrides for the subcommand Christian Brauner
2026-07-29 10:44 ` [PATCH b4 2/6] shazam: ignore the user's submodule.recurse in the scratch worktree Christian Brauner
2026-07-29 10:44 ` Christian Brauner [this message]
2026-07-29 10:44 ` [PATCH b4 4/6] fake-am: use the scratch-worktree overrides in the staging worktree Christian Brauner
2026-07-29 10:44 ` [PATCH b4 5/6] send: use the scratch-worktree overrides when tagging a sent series Christian Brauner
2026-07-29 10:44 ` [PATCH b4 6/6] tests: exercise the scratch worktrees under submodule.recurse Christian Brauner
2026-07-31  5:08 ` [PATCH b4 0/6] Keep the user's git config out of b4's scratch worktrees Konstantin Ryabitsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260729-work-b4-scratch-worktrees-v1-3-e96995158d4a@kernel.org \
    --to=brauner@kernel.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=tools@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox