Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
fix(commit): stage before pre-commit hooks as well as after (#4520)
Maximilian Roos9f08a9572084
diff --git a/docs/src/content/docs/merge.md b/docs/src/content/docs/merge.mdindex 6e9d1a077..72ade3017 100644--- a/docs/src/content/docs/merge.md+++ b/docs/src/content/docs/merge.md@@ -87,7 +87,7 @@ $ wt merge --no-commit --no-rebase`wt merge` runs these steps:1. **Commit** — Pre-commit hooks run, then uncommitted changes are committed. Post-commit hooks run in the background. This step is skipped when squashing (the default) — changes are staged during the squash step instead. With `--no-squash`, this is the only commit step.-2. **Squash** — Combines all commits since target into one (like GitHub's "Squash and merge"). Pre-commit hooks run before staging; post-commit hooks run in the background after committing. Use `--stage` to control what gets staged: `all` (default), `tracked`, or `none`. Working-tree changes swept into the squash are backed up first to `refs/wt-backup/<branch>`; see [`wt step squash`](/step/#wt-step-squash) for recovery. With `--no-squash`, individual commits are preserved.+2. **Squash** — Combines all commits since target into one (like GitHub's "Squash and merge"). Pre-commit hooks see the staged changes, and their edits are staged into the squash commit; post-commit hooks run in the background after committing. Use `--stage` to control what gets staged: `all` (default), `tracked`, or `none`. Working-tree changes swept into the squash are backed up first to `refs/wt-backup/<branch>`; see [`wt step squash`](/step/#wt-step-squash) for recovery. With `--no-squash`, individual commits are preserved.3. **Rebase** — Rebases onto target, skipping when nothing needs replaying ([`wt step rebase`](/step/#wt-step-rebase) gives the conditions). A conflict stops the merge with the rebase left open in the worktree, to resolve or abort. With `--no-rebase`, the graph produced by earlier commit/squash steps is preserved and the target must be able to fast-forward to its tip.4. **Pre-merge hooks** — Hooks run after rebase, before merge. Failures abort. See [`wt hook`](/hook/).5. **Merge** — Fast-forward merge to the target branch ([`wt step push`](/step/#wt-step-push)). With `--no-ff`, a merge commit is created instead — semi-linear history after the default rebase, while explicit `--no-rebase` preserves the graph produced by earlier steps before adding the merge commit. Non-fast-forward merges are rejected.diff --git a/plugins/worktrunk/skills/worktrunk/reference/merge.md b/plugins/worktrunk/skills/worktrunk/reference/merge.mdindex 76d924694..4efc4fe9e 100644--- a/plugins/worktrunk/skills/worktrunk/reference/merge.md+++ b/plugins/worktrunk/skills/worktrunk/reference/merge.md@@ -73,7 +73,7 @@ $ wt merge --no-commit --no-rebase`wt merge` runs these steps:1. **Commit** — Pre-commit hooks run, then uncommitted changes are committed. Post-commit hooks run in the background. This step is skipped when squashing (the default) — changes are staged during the squash step instead. With `--no-squash`, this is the only commit step.-2. **Squash** — Combines all commits since target into one (like GitHub's "Squash and merge"). Pre-commit hooks run before staging; post-commit hooks run in the background after committing. Use `--stage` to control what gets staged: `all` (default), `tracked`, or `none`. Working-tree changes swept into the squash are backed up first to `refs/wt-backup/<branch>`; see [`wt step squash`](https://worktrunk.dev/step/#wt-step-squash) for recovery. With `--no-squash`, individual commits are preserved.+2. **Squash** — Combines all commits since target into one (like GitHub's "Squash and merge"). Pre-commit hooks see the staged changes, and their edits are staged into the squash commit; post-commit hooks run in the background after committing. Use `--stage` to control what gets staged: `all` (default), `tracked`, or `none`. Working-tree changes swept into the squash are backed up first to `refs/wt-backup/<branch>`; see [`wt step squash`](https://worktrunk.dev/step/#wt-step-squash) for recovery. With `--no-squash`, individual commits are preserved.3. **Rebase** — Rebases onto target, skipping when nothing needs replaying ([`wt step rebase`](https://worktrunk.dev/step/#wt-step-rebase) gives the conditions). A conflict stops the merge with the rebase left open in the worktree, to resolve or abort. With `--no-rebase`, the graph produced by earlier commit/squash steps is preserved and the target must be able to fast-forward to its tip.4. **Pre-merge hooks** — Hooks run after rebase, before merge. Failures abort. See [`wt hook`](https://worktrunk.dev/hook/).5. **Merge** — Fast-forward merge to the target branch ([`wt step push`](https://worktrunk.dev/step/#wt-step-push)). With `--no-ff`, a merge commit is created instead — semi-linear history after the default rebase, while explicit `--no-rebase` preserves the graph produced by earlier steps before adding the merge commit. Non-fast-forward merges are rejected.diff --git a/skills/worktrunk/reference/merge.md b/skills/worktrunk/reference/merge.mdindex 76d924694..4efc4fe9e 100644--- a/skills/worktrunk/reference/merge.md+++ b/skills/worktrunk/reference/merge.md@@ -73,7 +73,7 @@ $ wt merge --no-commit --no-rebase`wt merge` runs these steps:1. **Commit** — Pre-commit hooks run, then uncommitted changes are committed. Post-commit hooks run in the background. This step is skipped when squashing (the default) — changes are staged during the squash step instead. With `--no-squash`, this is the only commit step.-2. **Squash** — Combines all commits since target into one (like GitHub's "Squash and merge"). Pre-commit hooks run before staging; post-commit hooks run in the background after committing. Use `--stage` to control what gets staged: `all` (default), `tracked`, or `none`. Working-tree changes swept into the squash are backed up first to `refs/wt-backup/<branch>`; see [`wt step squash`](https://worktrunk.dev/step/#wt-step-squash) for recovery. With `--no-squash`, individual commits are preserved.+2. **Squash** — Combines all commits since target into one (like GitHub's "Squash and merge"). Pre-commit hooks see the staged changes, and their edits are staged into the squash commit; post-commit hooks run in the background after committing. Use `--stage` to control what gets staged: `all` (default), `tracked`, or `none`. Working-tree changes swept into the squash are backed up first to `refs/wt-backup/<branch>`; see [`wt step squash`](https://worktrunk.dev/step/#wt-step-squash) for recovery. With `--no-squash`, individual commits are preserved.3. **Rebase** — Rebases onto target, skipping when nothing needs replaying ([`wt step rebase`](https://worktrunk.dev/step/#wt-step-rebase) gives the conditions). A conflict stops the merge with the rebase left open in the worktree, to resolve or abort. With `--no-rebase`, the graph produced by earlier commit/squash steps is preserved and the target must be able to fast-forward to its tip.4. **Pre-merge hooks** — Hooks run after rebase, before merge. Failures abort. See [`wt hook`](https://worktrunk.dev/hook/).5. **Merge** — Fast-forward merge to the target branch ([`wt step push`](https://worktrunk.dev/step/#wt-step-push)). With `--no-ff`, a merge commit is created instead — semi-linear history after the default rebase, while explicit `--no-rebase` preserves the graph produced by earlier steps before adding the merge commit. Non-fast-forward merges are rejected.diff --git a/src/cli/mod.rs b/src/cli/mod.rsindex 187a463c3..ab614935b 100644--- a/src/cli/mod.rs+++ b/src/cli/mod.rs@@ -1514,7 +1514,7 @@ $ wt merge --no-commit --no-rebase`wt merge` runs these steps:1. **Commit** — Pre-commit hooks run, then uncommitted changes are committed. Post-commit hooks run in the background. This step is skipped when squashing (the default) — changes are staged during the squash step instead. With `--no-squash`, this is the only commit step.-2. **Squash** — Combines all commits since target into one (like GitHub's "Squash and merge"). Pre-commit hooks run before staging; post-commit hooks run in the background after committing. Use `--stage` to control what gets staged: `all` (default), `tracked`, or `none`. Working-tree changes swept into the squash are backed up first to `refs/wt-backup/<branch>`; see [`wt step squash`](/step/#wt-step-squash) for recovery. With `--no-squash`, individual commits are preserved.+2. **Squash** — Combines all commits since target into one (like GitHub's "Squash and merge"). Pre-commit hooks see the staged changes, and their edits are staged into the squash commit; post-commit hooks run in the background after committing. Use `--stage` to control what gets staged: `all` (default), `tracked`, or `none`. Working-tree changes swept into the squash are backed up first to `refs/wt-backup/<branch>`; see [`wt step squash`](/step/#wt-step-squash) for recovery. With `--no-squash`, individual commits are preserved.3. **Rebase** — Rebases onto target, skipping when nothing needs replaying ([`wt step rebase`](/step/#wt-step-rebase) gives the conditions). A conflict stops the merge with the rebase left open in the worktree, to resolve or abort. With `--no-rebase`, the graph produced by earlier commit/squash steps is preserved and the target must be able to fast-forward to its tip.4. **Pre-merge hooks** — Hooks run after rebase, before merge. Failures abort. See [`wt hook`](/hook/).5. **Merge** — Fast-forward merge to the target branch ([`wt step push`](/step/#wt-step-push)). With `--no-ff`, a merge commit is created instead — semi-linear history after the default rebase, while explicit `--no-rebase` preserves the graph produced by earlier steps before adding the merge commit. Non-fast-forward merges are rejected.diff --git a/src/commands/commit.rs b/src/commands/commit.rsindex 6043b8ecd..a014a3b41 100644--- a/src/commands/commit.rs+++ b/src/commands/commit.rs@@ -9,7 +9,7 @@ use worktrunk::styling::{use super::command_executor::CommandContext;use super::command_executor::FailureStrategy;use super::hooks::{HookAnnouncer, execute_hook};-use super::repository_ext::warn_about_untracked_files;+use super::repository_ext::auto_stage;use super::template_vars::TemplateVars;// Re-export StageMode from config for use by CLI@@ -247,25 +247,20 @@ impl CommitOptions<'_> {.target_branch.map_or_else(TemplateVars::new, |t| TemplateVars::new().with_target(t));+ // Stage on both sides of the pre-commit hooks (user first, then+ // project); `auto_stage` says why. Each stage re-checks for unmerged+ // paths, since a hook is free to leave them behind.+ auto_stage(&wt, self.stage_mode)?;if self.hooks.run() {- // Run pre-commit hooks (user first, then project).execute_hook(self.ctx,HookType::PreCommit,&template_vars.as_extra_vars(),FailureStrategy::FailFast,)?;+ auto_stage(&wt, self.stage_mode)?;}- if self.stage_mode == StageMode::All {- warn_about_untracked_files(&wt)?;- }-- // Stage changes based on mode. Re-gated inside `stage`: the refusal- // above ran before the pre-commit hooks, and a hook is free to leave- // unmerged paths behind.- wt.stage(self.stage_mode)?;-let effective_config = self.ctx.commit_generation();// Skip the approval gate when the LLM isn't configured — the fallback// message generator doesn't render the prompt template, so guidancediff --git a/src/commands/repository_ext.rs b/src/commands/repository_ext.rsindex a5e5db5dd..f4ff4d828 100644--- a/src/commands/repository_ext.rs+++ b/src/commands/repository_ext.rs@@ -3,6 +3,7 @@ use std::path::{Path, PathBuf};use super::worktree::{RemovalPlan, SharedBranchCheckout};use anyhow::{Context, bail};use color_print::cformat;+use worktrunk::config::StageMode;use worktrunk::git::{BranchDeletionMode, GitError, IntegrationReason, RefSnapshot, Repository, WorkingTree,WorktreeInfo, parse_porcelain_z, parse_untracked_files,@@ -623,6 +624,21 @@ pub(crate) fn check_not_default_branch(Ok(())}+/// Stage the paths `mode` selects for a commit, first warning about any+/// untracked paths that all-files mode is about to add.+///+/// Commit paths call this on both sides of the `pre-commit` hooks: before them+/// so a hook that reads the index (`pre-commit run`, lint-staged,+/// `git diff --cached`) sees the changes about to be committed, and after them+/// so a formatter hook's edits land in the commit. The second call warns only+/// about untracked paths the hooks created.+pub(crate) fn auto_stage(wt: &WorkingTree, mode: StageMode) -> anyhow::Result<()> {+ if mode == StageMode::All {+ warn_about_untracked_files(wt)?;+ }+ wt.stage(mode)+}+/// Warn about untracked files that will be auto-staged.////// Paths come from git's `normal` untracked mode, which overrides a@@ -632,7 +648,7 @@ pub(crate) fn check_not_default_branch(////// The listing has at most `MAX_ROWS` rows. Past that many paths, the last row/// is a hint counting the rest, which is always at least two paths.-pub(crate) fn warn_about_untracked_files(wt: &WorkingTree) -> anyhow::Result<()> {+fn warn_about_untracked_files(wt: &WorkingTree) -> anyhow::Result<()> {const MAX_ROWS: usize = 10;let status = wtdiff --git a/src/commands/step/squash.rs b/src/commands/step/squash.rsindex 78f68ef34..95f481732 100644--- a/src/commands/step/squash.rs+++ b/src/commands/step/squash.rs@@ -17,7 +17,7 @@ use super::super::command_executor::FailureStrategy;use super::super::commit::{CommitGenerator, CommitOutcome, HookGate, StageMode};use super::super::context::CommandEnv;use super::super::hooks::{HookAnnouncer, execute_hook};-use super::super::repository_ext::warn_about_untracked_files;+use super::super::repository_ext::auto_stage;use super::super::template_vars::TemplateVars;use super::shared::print_dry_run;@@ -180,9 +180,9 @@ pub fn handle_squash_in(.unwrap_or_else(|| integration_target.clone());let template_vars = TemplateVars::new().with_target(&integration_target);- // Run pre-commit hooks (user first, then project) before staging, as- // `wt step commit` does, so the edits a formatter hook makes are staged- // into the squash commit rather than left in the working tree.+ // Stage on both sides of the pre-commit hooks (user first, then project);+ // `auto_stage` says why.+ auto_stage(&wt, stage_mode)?;if hooks.run() {execute_hook(&ctx,@@ -190,13 +190,9 @@ pub fn handle_squash_in(&template_vars.as_extra_vars(),FailureStrategy::FailFast,)?;+ auto_stage(&wt, stage_mode)?;}- if stage_mode == StageMode::All {- warn_about_untracked_files(&wt)?;- }- wt.stage(stage_mode)?;-// Resolve HEAD once, so the span, the message's commit list, and the// compare-and-swap that finally moves the branch all describe one tip.let head_sha = wt.run_command(&["rev-parse", "HEAD"])?.trim().to_string();diff --git a/tests/integration_tests/merge.rs b/tests/integration_tests/merge.rsindex d206571a9..38dca5ddc 100644--- a/tests/integration_tests/merge.rs+++ b/tests/integration_tests/merge.rs@@ -1290,7 +1290,7 @@ fn test_merge_pre_commit_collected_for_squash_clean_worktree(}/// A pre-commit hook's edits land in the squash commit, as they do in the-/// commit `wt step commit` makes: the hook runs before staging, not after.+/// commit `wt step commit` makes: Worktrunk stages again after the hook runs.#[rstest]fn test_step_squash_includes_pre_commit_hook_edits(repo_with_multi_commit_feature: TestRepo) {let repo = &repo_with_multi_commit_feature;@@ -1333,6 +1333,53 @@ fn test_step_squash_includes_pre_commit_hook_edits(repo_with_multi_commit_featur);}+/// A pre-commit hook that reads the index (`pre-commit run`, lint-staged,+/// `git diff --cached`) sees the uncommitted changes Worktrunk is about to+/// commit, so a gate on them blocks the commit. `merge` covers the squash path+/// and `step commit` the plain commit path.+#[rstest]+#[case::merge(&["merge", "main", "--yes"])]+#[case::step_commit(&["step", "commit", "--yes"])]+fn test_pre_commit_hook_sees_staged_changes(+ repo_with_multi_commit_feature: TestRepo,+ #[case] args: &[&str],+) {+ let repo = &repo_with_multi_commit_feature;+ let feature_wt = repo.worktrees["feature"].clone();++ let config_dir = feature_wt.join(".config");+ fs::create_dir_all(&config_dir).unwrap();+ fs::write(+ config_dir.join("wt.toml"),+ "pre-commit = \"! git diff --cached | grep -q FORBIDDEN\"",+ )+ .unwrap();+ repo.run_git_in(&feature_wt, &["add", ".config/wt.toml"]);+ repo.run_git_in(&feature_wt, &["commit", "-m", "Add config"]);+ let feature_head = repo.git_output(&["rev-parse", "feature"]);+ let main_head = repo.git_output(&["rev-parse", "main"]);++ fs::write(feature_wt.join("new.txt"), "FORBIDDEN\n").unwrap();++ let output = repo+ .wt_command()+ .args(args)+ .current_dir(&feature_wt)+ .env(+ "WORKTRUNK_COMMIT__GENERATION__COMMAND",+ "cat >/dev/null && echo 'feat: combined'",+ )+ .output()+ .unwrap();+ assert!(+ !output.status.success(),+ "pre-commit gate passed: {}",+ String::from_utf8_lossy(&output.stderr)+ );+ assert_eq!(repo.git_output(&["rev-parse", "feature"]), feature_head);+ assert_eq!(repo.git_output(&["rev-parse", "main"]), main_head);+}+// README EXAMPLE GENERATION TESTS// These tests are specifically designed to generate realistic output examples for the README.// The snapshots from these tests are manually copied into README.md to show users what@@ -4584,10 +4631,14 @@ fn test_step_push_refuses_mid_rebase(mut repo: TestRepo) {/// this.#[rstest]fn test_step_commit_refuses_hook_created_conflict(mut repo: TestRepo) {- // A pre-commit hook that conflicts the index. `|| true` so the hook- // succeeds and the commit proceeds to staging; output suppressed to keep- // git's own wording out of the snapshot.- repo.write_project_config(r#"pre-commit = "git merge side >/dev/null 2>&1 || true""#);+ // A pre-commit hook that conflicts the index. It unstages first because+ // Worktrunk stages before the hooks run and `git merge` refuses to start+ // with a dirty index. `|| true` so the hook succeeds and the commit+ // proceeds to staging; output suppressed to keep git's own wording out of+ // the snapshot.+ repo.write_project_config(+ r#"pre-commit = "git reset -q && git merge side >/dev/null 2>&1 || true""#,+ );repo.run_git(&["add", ".config/wt.toml"]);repo.run_git(&["commit", "-m", "Add project config"]);diff --git a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap b/tests/snapshots/integration__integration_tests__help__help_md_merge.snapindex 5cc7113f0..ef2f07971 100644--- a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap+++ b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap@@ -185,7 +185,7 @@ $ wt merge --no-commit --no-rebase`wt merge` runs these steps:1. **Commit** — Pre-commit hooks run, then uncommitted changes are committed. Post-commit hooks run in the background. This step is skipped when squashing (the default) — changes are staged during the squash step instead. With `--no-squash`, this is the only commit step.-2. **Squash** — Combines all commits since target into one (like GitHub's "Squash and merge"). Pre-commit hooks run before staging; post-commit hooks run in the background after committing. Use `--stage` to control what gets staged: `all` (default), `tracked`, or `none`. Working-tree changes swept into the squash are backed up first to `refs/wt-backup/<branch>`; see [`wt step squash`](/step/#wt-step-squash) for recovery. With `--no-squash`, individual commits are preserved.+2. **Squash** — Combines all commits since target into one (like GitHub's "Squash and merge"). Pre-commit hooks see the staged changes, and their edits are staged into the squash commit; post-commit hooks run in the background after committing. Use `--stage` to control what gets staged: `all` (default), `tracked`, or `none`. Working-tree changes swept into the squash are backed up first to `refs/wt-backup/<branch>`; see [`wt step squash`](/step/#wt-step-squash) for recovery. With `--no-squash`, individual commits are preserved.3. **Rebase** — Rebases onto target, skipping when nothing needs replaying ([`wt step rebase`](/step/#wt-step-rebase) gives the conditions). A conflict stops the merge with the rebase left open in the worktree, to resolve or abort. With `--no-rebase`, the graph produced by earlier commit/squash steps is preserved and the target must be able to fast-forward to its tip.4. **Pre-merge hooks** — Hooks run after rebase, before merge. Failures abort. See [`wt hook`](/hook/).5. **Merge** — Fast-forward merge to the target branch ([`wt step push`](/step/#wt-step-push)). With `--no-ff`, a merge commit is created instead — semi-linear history after the default rebase, while explicit `--no-rebase` preserves the graph produced by earlier steps before adding the merge commit. Non-fast-forward merges are rejected.diff --git a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap b/tests/snapshots/integration__integration_tests__help__help_merge_long.snapindex 8c3582607..2c78a5a70 100644--- a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap+++ b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap@@ -167,7 +167,7 @@ Preserve the exact clean commit graph and tip:[2mwt merge[0m runs these steps:1. [1mCommit[0m — Pre-commit hooks run, then uncommitted changes are committed. Post-commit hooks run in the background. This step is skipped when squashing (the default) — changes are staged during the squash step instead. With [2m--no-squash[0m, this is the only commit step.-2. [1mSquash[0m — Combines all commits since target into one (like GitHub's "Squash and merge"). Pre-commit hooks run before staging; post-commit hooks run in the background after committing. Use [2m--stage[0m to control what gets staged: [2mall[0m (default), [2mtracked[0m, or [2mnone[0m. Working-tree changes swept into the squash are backed up first to [2mrefs/wt-backup/<branch>[0m; see [2mwt step squash[0m for recovery. With [2m--no-squash[0m, individual commits are preserved.+2. [1mSquash[0m — Combines all commits since target into one (like GitHub's "Squash and merge"). Pre-commit hooks see the staged changes, and their edits are staged into the squash commit; post-commit hooks run in the background after committing. Use [2m--stage[0m to control what gets staged: [2mall[0m (default), [2mtracked[0m, or [2mnone[0m. Working-tree changes swept into the squash are backed up first to [2mrefs/wt-backup/<branch>[0m; see [2mwt step squash[0m for recovery. With [2m--no-squash[0m, individual commits are preserved.3. [1mRebase[0m — Rebases onto target, skipping when nothing needs replaying ([2mwt step rebase[0m gives the conditions). A conflict stops the merge with the rebase left open in the worktree, to resolve or abort. With [2m--no-rebase[0m, the graph produced by earlier commit/squash steps is preserved and the target must be able to fast-forward to its tip.4. [1mPre-merge hooks[0m — Hooks run after rebase, before merge. Failures abort. See [2mwt hook[0m.5. [1mMerge[0m — Fast-forward merge to the target branch ([2mwt step push[0m). With [2m--no-ff[0m, a merge commit is created instead — semi-linear history after the default rebase, while explicit [2m--no-rebase[0m preserves the graph produced by earlier steps before adding the merge commit. Non-fast-forward merges are rejected.diff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snapindex d4d496ce1..1481866a8 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_failure.snap@@ -60,6 +60,8 @@ exit_code: 1----- stdout ---------- stderr -----+[33m▲[39m [33mAuto-staging 1 untracked path:[39m+[107m [0m feature.txt[36m◎[39m [36mRunning pre-commit project hook[39m[107m [0m [2m[0m[2m[34mexit[0m[2m 1[0m[0m[31m✗[39m [31m[1mpre-commit project hook[22m failed (exit code 1)[39mdiff --git a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snapindex 160457f4b..4d56ebf2f 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_pre_commit_command_success.snap@@ -60,11 +60,11 @@ exit_code: 0----- stdout ---------- stderr -----+[33m▲[39m [33mAuto-staging 1 untracked path:[39m+[107m [0m feature.txt[36m◎[39m [36mRunning pre-commit project hook[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'Pre-commit check passed'[0m[0mPre-commit check passed-[33m▲[39m [33mAuto-staging 1 untracked path:[39m-[107m [0m feature.txt[36m◎[39m [36mCommitting changes with default message... [90m(1 file, [32m+1[39m, no squashing needed[39m[90m)[39m[39m[2m↳[22m [2mUsing fallback commit message. For LLM setup guide, run [4mwt config --help[24m[22m[107m [0m [1mChanges to feature.txt[22mdiff --git a/tests/snapshots/integration__integration_tests__merge__step_commit_refuses_hook_created_conflict.snap b/tests/snapshots/integration__integration_tests__merge__step_commit_refuses_hook_created_conflict.snapindex af5ac88c6..4c1a62c13 100644--- a/tests/snapshots/integration__integration_tests__merge__step_commit_refuses_hook_created_conflict.snap+++ b/tests/snapshots/integration__integration_tests__merge__step_commit_refuses_hook_created_conflict.snap@@ -60,8 +60,10 @@ exit_code: 1----- stdout ---------- stderr -----+[33m▲[39m [33mAuto-staging 1 untracked path:[39m+[107m [0m other.txt[36m◎[39m [36mRunning pre-commit project hook[39m-[107m [0m [2m[0m[2m[34mgit[0m[2m merge side [0m[2m[36m>[0m[2m/dev/null [0m[2m[33m2[0m[2m>&1 || [0m[2m[34mtrue[0m+[107m [0m [2m[0m[2m[34mgit[0m[2m reset [0m[2m[36m-q[0m[2m [0m[2m[36m&&[0m[2m [0m[2m[34mgit[0m[2m merge side [0m[2m[36m>[0m[2m/dev/null [0m[2m[33m2[0m[2m>&1 || [0m[2m[34mtrue[0m[0m[33m▲[39m [33mAuto-staging 1 untracked path:[39m[107m [0m other.txt[31m✗[39m [31mCannot commit: 1 path with unresolved conflicts[39mdiff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_executes.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_executes.snapindex 2a601210f..895ff87f6 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_executes.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_executes.snap@@ -61,10 +61,11 @@ exit_code: 0----- stdout ---------- stderr -----+[33m▲[39m [33mAuto-staging 1 untracked path:[39m+[107m [0m uncommitted.txt[36m◎[39m [36mRunning pre-commit [1muser:lint[22m[39m[107m [0m [2m[0m[2m[34mecho[0m[2m [0m[2m[32m'USER_PRE_COMMIT_RAN'[0m[2m [0m[2m[36m>[0m[2m user_precommit.txt[0m-[0m[33m▲[39m [33mAuto-staging 2 untracked paths:[39m-[107m [0m uncommitted.txt+[0m[33m▲[39m [33mAuto-staging 1 untracked path:[39m[107m [0m user_precommit.txt[36m◎[39m [36mCommitting changes with default message... [90m(2 files, [32m+2[39m, no squashing needed[39m[90m)[39m[39m[2m↳[22m [2mUsing fallback commit message. For LLM setup guide, run [4mwt config --help[24m[22mdiff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_failure.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_failure.snapindex 1645e5e2d..b4d87b3b1 100644--- a/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_failure.snap+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_pre_commit_failure.snap@@ -61,6 +61,8 @@ exit_code: 1----- stdout ---------- stderr -----+[33m▲[39m [33mAuto-staging 1 untracked path:[39m+[107m [0m uncommitted.txt[36m◎[39m [36mRunning pre-commit [1muser:lint[22m[39m[107m [0m [2m[0m[2m[34mexit[0m[2m 1[0m[0m[31m✗[39m [31m[1mpre-commit user:lint[22m failed (exit code 1)[39m