Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix: remove bright-black styling from flags in info/warning messages (#533)

Maximilian Roosf1ba5596151c
diff --git a/src/commands/commit.rs b/src/commands/commit.rs
index 220d5c7c5..8e482c414 100644
--- a/src/commands/commit.rs
+++ b/src/commands/commit.rs
@@ -154,9 +154,7 @@ impl CommitOptions<'_> {
// Show skip message
if self.no_verify && any_hooks_exist {
- crate::output::print(info_message(cformat!(
- "Skipping pre-commit hooks (<bright-black>--no-verify</>)"
- )))?;
+ crate::output::print(info_message("Skipping pre-commit hooks (--no-verify)"))?;
}
if !self.no_verify {
diff --git a/src/commands/step_commands.rs b/src/commands/step_commands.rs
index 3acd77a82..394ab788c 100644
--- a/src/commands/step_commands.rs
+++ b/src/commands/step_commands.rs
@@ -131,9 +131,7 @@ pub fn handle_squash(
let has_any_pre_commit = has_project_pre_commit || has_user_pre_commit;
if skip_pre_commit && has_any_pre_commit {
- crate::output::print(info_message(cformat!(
- "Skipping pre-commit hooks (<bright-black>--no-verify</>)"
- )))?;
+ crate::output::print(info_message("Skipping pre-commit hooks (--no-verify)"))?;
}
// Run pre-commit hooks (user first, then project)
diff --git a/src/commands/worktree.rs b/src/commands/worktree.rs
index b8664706f..e441a6294 100644
--- a/src/commands/worktree.rs
+++ b/src/commands/worktree.rs
@@ -565,7 +565,7 @@ pub fn handle_switch(
let path_display = worktrunk::path::format_path_for_display(&worktree_path);
let backup_display = worktrunk::path::format_path_for_display(&backup_path);
crate::output::print(warning_message(cformat!(
- "Moving <bold>{path_display}</> to <bold>{backup_display}</> (<bright-black>--clobber</>)"
+ "Moving <bold>{path_display}</> to <bold>{backup_display}</> (--clobber)"
)))?;
std::fs::rename(&worktree_path, &backup_path)
diff --git a/tests/snapshots/integration__integration_tests__merge__step_commit_with_both_flags.snap b/tests/snapshots/integration__integration_tests__merge__step_commit_with_both_flags.snap
index cf72b323b..c9c4fd4ef 100644
--- a/tests/snapshots/integration__integration_tests__merge__step_commit_with_both_flags.snap
+++ b/tests/snapshots/integration__integration_tests__merge__step_commit_with_both_flags.snap
@@ -10,7 +10,7 @@ info:
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
- COLUMNS: "150"
+ COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
@@ -23,6 +23,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_COMMIT_GENERATION__ARGS: "fix: update file"
WORKTRUNK_COMMIT_GENERATION__COMMAND: echo
@@ -35,7 +36,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-○ Skipping pre-commit hooks (--no-verify)
+○ Skipping pre-commit hooks (--no-verify)
◎ Generating commit message and committing tracked changes... (1 file, +1, -1)
  fix: update file
✓ Committed changes @ [HASH]
diff --git a/tests/snapshots/integration__integration_tests__merge__step_commit_with_no_verify_flag.snap b/tests/snapshots/integration__integration_tests__merge__step_commit_with_no_verify_flag.snap
index 819250193..888f5079b 100644
--- a/tests/snapshots/integration__integration_tests__merge__step_commit_with_no_verify_flag.snap
+++ b/tests/snapshots/integration__integration_tests__merge__step_commit_with_no_verify_flag.snap
@@ -9,7 +9,7 @@ info:
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
- COLUMNS: "150"
+ COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
@@ -22,6 +22,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_COMMIT_GENERATION__ARGS: "feat: add file"
WORKTRUNK_COMMIT_GENERATION__COMMAND: echo
@@ -34,7 +35,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-○ Skipping pre-commit hooks (--no-verify)
+○ Skipping pre-commit hooks (--no-verify)
▲ Auto-staging 2 untracked paths:
  .config/
  file1.txt
diff --git a/tests/snapshots/integration__integration_tests__merge__step_squash_with_both_flags.snap b/tests/snapshots/integration__integration_tests__merge__step_squash_with_both_flags.snap
index 3791ceb3c..5247e8af6 100644
--- a/tests/snapshots/integration__integration_tests__merge__step_squash_with_both_flags.snap
+++ b/tests/snapshots/integration__integration_tests__merge__step_squash_with_both_flags.snap
@@ -10,7 +10,7 @@ info:
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
- COLUMNS: "150"
+ COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
@@ -23,6 +23,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_COMMIT_GENERATION__ARGS: "squash: combined commits"
WORKTRUNK_COMMIT_GENERATION__COMMAND: echo
@@ -35,7 +36,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-○ Skipping pre-commit hooks (--no-verify)
+○ Skipping pre-commit hooks (--no-verify)
◎ Squashing 2 commits & tracked changes into a single commit (3 files, +3)...
↳ Backup created @ ef0df66
◎ Generating squash commit message...
diff --git a/tests/snapshots/integration__integration_tests__merge__step_squash_with_no_verify_flag.snap b/tests/snapshots/integration__integration_tests__merge__step_squash_with_no_verify_flag.snap
index 897751625..8b377fdf5 100644
--- a/tests/snapshots/integration__integration_tests__merge__step_squash_with_no_verify_flag.snap
+++ b/tests/snapshots/integration__integration_tests__merge__step_squash_with_no_verify_flag.snap
@@ -9,7 +9,7 @@ info:
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
- COLUMNS: "150"
+ COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
@@ -22,6 +22,7 @@ info:
PATH: "[PATH]"
RUST_LOG: warn
SOURCE_DATE_EPOCH: "1735776000"
+ TERM: alacritty
USERPROFILE: "[TEST_HOME]"
WORKTRUNK_COMMIT_GENERATION__ARGS: "squash: combined commits"
WORKTRUNK_COMMIT_GENERATION__COMMAND: echo
@@ -34,7 +35,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-○ Skipping pre-commit hooks (--no-verify)
+○ Skipping pre-commit hooks (--no-verify)
◎ Squashing 2 commits into a single commit (3 files, +3)...
◎ Generating squash commit message...
  squash: combined commits
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_clobber_path_with_extension.snap b/tests/snapshots/integration__integration_tests__switch__switch_clobber_path_with_extension.snap
index 97a9ad83c..cbdeed838 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_clobber_path_with_extension.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_clobber_path_with_extension.snap
@@ -10,7 +10,7 @@ info:
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
- COLUMNS: "150"
+ COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
@@ -34,7 +34,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-▲ Moving _REPO_.clobber-ext.txt to _REPO_.clobber-ext.txt.bak.20250102-000000 (--clobber)
+▲ Moving _REPO_.clobber-ext.txt to _REPO_.clobber-ext.txt.bak.20250102-000000 (--clobber)
✓ Created branch clobber-ext.txt and worktree from main @ _REPO_.clobber-ext.txt
↳ Customize worktree locations: wt config create
▲ Cannot change directory — shell integration not installed
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_dir.snap b/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_dir.snap
index 9d2f67e39..d23c72d9f 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_dir.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_dir.snap
@@ -10,7 +10,7 @@ info:
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
- COLUMNS: "150"
+ COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
@@ -34,7 +34,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-▲ Moving _REPO_.clobber-dir-test to _REPO_.clobber-dir-test.bak.20250102-000000 (--clobber)
+▲ Moving _REPO_.clobber-dir-test to _REPO_.clobber-dir-test.bak.20250102-000000 (--clobber)
✓ Created branch clobber-dir-test and worktree from main @ _REPO_.clobber-dir-test
↳ Customize worktree locations: wt config create
▲ Cannot change directory — shell integration not installed
diff --git a/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_file.snap b/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_file.snap
index f8b4e2757..d3029c7d2 100644
--- a/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_file.snap
+++ b/tests/snapshots/integration__integration_tests__switch__switch_clobber_removes_stale_file.snap
@@ -10,7 +10,7 @@ info:
env:
APPDATA: "[TEST_CONFIG_HOME]"
CLICOLOR_FORCE: "1"
- COLUMNS: "150"
+ COLUMNS: "500"
GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
@@ -34,7 +34,7 @@ exit_code: 0
----- stdout -----
----- stderr -----
-▲ Moving _REPO_.clobber-file-test to _REPO_.clobber-file-test.bak.20250102-000000 (--clobber)
+▲ Moving _REPO_.clobber-file-test to _REPO_.clobber-file-test.bak.20250102-000000 (--clobber)
✓ Created branch clobber-file-test and worktree from main @ _REPO_.clobber-file-test
↳ Customize worktree locations: wt config create
▲ Cannot change directory — shell integration not installed