Thread (40 messages) flat view 40 messages, 6 authors, 15h ago

Re: [PATCH v4 3/3] sequencer: disable auto maintenance in spawned commands

From: Phillip Wood <hidden>
Date: 2026-09-09 15:40:15

Hi Thomas

On 09/09/2026 09:25, Thomas Bachem via GitGitGadget wrote:
From: Thomas Bachem <redacted>

Sequencer-spawned commands like 'commit' and 'merge' run
background auto maintenance, which interferes with ongoing
operations (e.g. 'rerere gc' holding MERGE_RR.lock or repacks
deleting active packs).
This is much more concise, but still sounds a bit strange to me. I'd suggest

When the sequencer spawns "git commit", or "git merge", those commands
run "git maintenance --auto" in the background which can interfere with
the sequencer (e.g. 'rerere gc' holding MERGE_RR.lock or repacks 
deleting active packs).
Pass maintenance.auto=false via GIT_CONFIG_PARAMETERS to the
spawned commit, merge and exec commands. Appending it after the
user's own settings ensures it wins, and the environment reaches
whatever they spawn in turn.

Auto maintenance now runs exactly once when the sequence
completes. Commands run manually by the user while stopped are
unaffected and continue to run auto maintenance normally.
Good, and the implementation changes look correct.
quoted hunk ↗ jump to hunk
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index 025787b5f2..16def261b0 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -398,13 +398,18 @@ test_orig_head --merge
  test_expect_success 'rebase runs auto maintenance once it is done' '
  	git checkout -b auto-maintenance topic &&
  	test_must_fail env GIT_TRACE2_EVENT="$(pwd)/stop.txt" \
-		git rebase -x false main &&
+		git rebase -x "git commit --allow-empty -m exec && false" main &&
  	test_subcommand_flex ! git maintenance run --auto <stop.txt &&
  	echo resolved >F2 &&
  	git add F2 &&
-	test_must_fail git rebase --continue &&
+	test_must_fail env GIT_TRACE2_EVENT="$(pwd)/mid.txt" \
+		git rebase --continue &&
What's this trying to check - there wasn't a conflict so 
commit_staged_changes() will error out without trying to commit 
anything. This series is looking pretty good now. Just to let you know 
I'll be off the list from tomorrow until the middle of next week so it 
will be a few days before I look at any new versions of this patch.

Thanks

Phillip
quoted hunk ↗ jump to hunk
+	test_subcommand_flex git commit <mid.txt &&
+	test_subcommand_flex ! git maintenance run --auto <mid.txt &&
  	GIT_TRACE2_EVENT="$(pwd)/end.txt" git rebase --continue &&
-	test_subcommand_flex git maintenance run --auto <end.txt
+	test_subcommand_flex git maintenance run --auto <end.txt &&
+	grep "\"child_start\".*\"maintenance\"" end.txt >maintenance &&
+	test_line_count = 1 maintenance
  '
  
  test_done
diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh
index 2bea55c3b6..1e3fa1803c 100755
--- a/t/t3510-cherry-pick-sequence.sh
+++ b/t/t3510-cherry-pick-sequence.sh
@@ -723,8 +723,11 @@ test_expect_success 'commit descriptions in insn sheet are optional' '
  
  test_expect_success 'cherry-pick runs auto maintenance once it is done' '
  	pristine_detach base &&
-	GIT_TRACE2_EVENT="$(pwd)/single.txt" git cherry-pick picked &&
+	GIT_TRACE2_EVENT="$(pwd)/single.txt" git cherry-pick --edit picked &&
+	test_subcommand_flex git commit <single.txt &&
  	test_subcommand_flex git maintenance run --auto <single.txt &&
+	grep "\"child_start\".*\"maintenance\"" single.txt >maintenance &&
+	test_line_count = 1 maintenance &&
  	GIT_TRACE2_EVENT="$(pwd)/sequence.txt" \
  		git cherry-pick anotherpick yetanotherpick &&
  	test_subcommand_flex git maintenance run --auto <sequence.txt &&
@@ -739,9 +742,14 @@ test_expect_success 'cherry-pick runs auto maintenance once a stopped sequence i
  	test_subcommand_flex ! git maintenance run --auto <stop.txt &&
  	echo resolved >foo &&
  	git add foo &&
-	test_must_fail git cherry-pick --continue &&
+	test_must_fail env GIT_TRACE2_EVENT="$(pwd)/mid.txt" \
+		git cherry-pick --continue &&
+	test_subcommand_flex git commit <mid.txt &&
+	test_subcommand_flex ! git maintenance run --auto <mid.txt &&
  	GIT_TRACE2_EVENT="$(pwd)/end.txt" git cherry-pick --skip &&
-	test_subcommand_flex git maintenance run --auto <end.txt
+	test_subcommand_flex git maintenance run --auto <end.txt &&
+	grep "\"child_start\".*\"maintenance\"" end.txt >maintenance &&
+	test_line_count = 1 maintenance
  '
  
  test_done
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help