Skip to content

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

Display hint for single commit merge squash

Maximilian Roosf01c79df54e8
diff --git a/src/commands/merge.rs b/src/commands/merge.rs
index 001969082..6d3058dc8 100644
--- a/src/commands/merge.rs
+++ b/src/commands/merge.rs
@@ -1,6 +1,6 @@
use worktrunk::config::{ProjectConfig, WorktrunkConfig};
use worktrunk::git::{GitError, GitResultExt, Repository};
-use worktrunk::styling::{AnstyleStyle, CYAN, CYAN_BOLD, format_with_gutter};
+use worktrunk::styling::{AnstyleStyle, CYAN, CYAN_BOLD, HINT, HINT_EMOJI, format_with_gutter};
use super::command_executor::{CommandContext, prepare_project_commands};
use super::worktree::handle_push;
@@ -262,9 +262,8 @@ fn handle_squash(target_branch: &str) -> Result<Option<usize>, GitError> {
if commit_count == 1 && !has_staged {
// Single commit, no staged changes - nothing to do
- let dim = AnstyleStyle::new().dimmed();
- crate::output::progress(format!(
- "{dim}Only 1 commit since {CYAN_BOLD}{target_branch}{CYAN_BOLD:#} - no squashing needed{dim:#}"
+ crate::output::hint(format!(
+ "{HINT_EMOJI} {HINT}Only 1 commit since {CYAN_BOLD}{target_branch}{CYAN_BOLD:#} - no squashing needed{HINT:#}"
))?;
return Ok(None);
}
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_single_commit.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_single_commit.snap
index bdc346da7..1a1f97949 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_single_commit.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_single_commit.snap
@@ -17,12 +17,12 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpJHQMgc/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpVJnMrc/test-config.toml
---
success: true
exit_code: 0
----- stdout -----
-Only 1 commit since main - no squashing needed
+πŸ’‘ Only 1 commit since main - no squashing needed
πŸ”„ Rebasing onto main...
πŸ”„ Merging 1 commit to main @ [SHA]