Skip to content

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

Remove redundant parenthesized text from squash message

Maximilian Roosed5366261d9a
diff --git a/CLAUDE.md b/CLAUDE.md
index 1ea56ec7c..064fbb8b0 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -63,6 +63,26 @@ When users provide explicit arguments (flags, options, values), the output shoul
- Don't just use defaults silently—show what was chosen
- For optional arguments, conditionally include them in the message
+**Avoid redundant parenthesized content:**
+
+Parenthesized text should add new information, not restate what's already said. If the parentheses just rephrase the main message in different words, remove them.
+
+```rust
+// ❌ BAD - parentheses restate "no changes"
+"No changes after squashing 3 commits (commits resulted in no net changes)"
+
+// ✅ GOOD - clear and concise
+"No changes after squashing 3 commits"
+
+// ✅ GOOD - parentheses add supplementary info (stats)
+"Committing with default message... (3 files, +45, -12)"
+
+// ✅ GOOD - parentheses explain why
+"Worktree preserved (--no-remove)"
+```
+
+When reviewing messages, ask: "Does the parenthesized text add information, or just reword what's already clear?"
+
### The anstyle Ecosystem
All styling uses the **anstyle ecosystem** for composable, auto-detecting terminal output:
diff --git a/src/commands/beta.rs b/src/commands/beta.rs
index 29c8b2468..9bac29b37 100644
--- a/src/commands/beta.rs
+++ b/src/commands/beta.rs
@@ -251,7 +251,7 @@ pub fn handle_beta_squash(
if !repo.has_staged_changes()? {
let dim = AnstyleStyle::new().dimmed();
crate::output::info(format!(
- "{dim}No changes after squashing {commit_count} {commit_text} (commits resulted in no net changes){dim:#}"
+ "{dim}No changes after squashing {commit_count} {commit_text}{dim:#}"
))?;
return Ok(false);
}
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_empty_changes.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_empty_changes.snap
index b1bb4a99b..d50501e76 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_empty_changes.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_empty_changes.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpy6rjfB/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpn0ZfDz/test-config.toml
---
success: true
exit_code: 0
@@ -30,7 +30,7 @@ exit_code: 0
  - Change 1
  - Change 2
  - Revert to initial
-⚪ No changes after squashing 3 commits (commits resulted in no net changes)
+⚪ No changes after squashing 3 commits
✅ Merged to main
✅ Returned to primary at [REPO]
🔄 Removing worktree & branch...