Skip to content

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

Refactor: Remove detailed merge summary output

Maximilian Roos458249e912ec
diff --git a/src/commands/merge.rs b/src/commands/merge.rs
index c6bb6e000..8cd909612 100644
--- a/src/commands/merge.rs
+++ b/src/commands/merge.rs
@@ -108,40 +108,14 @@ pub fn handle_merge(
/// Print a comprehensive summary of the merge operation
fn print_merge_summary(
- from_branch: &str,
- to_branch: &str,
- squashed_count: Option<usize>,
- cleaned_up: bool,
+ _from_branch: &str,
+ _to_branch: &str,
+ _squashed_count: Option<usize>,
+ _cleaned_up: bool,
) {
let green = AnstyleStyle::new().fg_color(Some(Color::Ansi(AnsiColor::Green)));
- let green_bold = green.bold();
- let dim = AnstyleStyle::new().dimmed();
println!("βœ… {green}Merge complete{green:#}");
- println!();
-
- // Summary of operations
- let mut operations = Vec::new();
-
- if let Some(count) = squashed_count {
- operations.push(format!("Squashed {count} commits into 1"));
- }
-
- operations.push(format!(
- "Rebased {green_bold}{from_branch}{green_bold:#} onto {green_bold}{to_branch}{green_bold:#}"
- ));
-
- operations.push(format!("Pushed to {green_bold}{to_branch}{green_bold:#}"));
-
- if cleaned_up {
- operations.push("Cleaned up worktree".to_string());
- } else {
- operations.push("Preserved worktree".to_string());
- }
-
- for (i, op) in operations.iter().enumerate() {
- println!(" {dim}{}. {}{dim:#}", i + 1, op);
- }
}
fn handle_squash(target_branch: &str) -> Result<Option<usize>, GitError> {
diff --git a/src/commands/worktree.rs b/src/commands/worktree.rs
index 6b1daa70b..b50e05e5c 100644
--- a/src/commands/worktree.rs
+++ b/src/commands/worktree.rs
@@ -684,9 +684,10 @@ pub fn handle_push(target: Option<&str>, allow_merge_commits: bool) -> Result<()
);
println!();
- // Show the commit graph
+ // Show the commit graph with color
let log_output = repo.run_command(&[
"log",
+ "--color=always",
"--graph",
"--oneline",
"--decorate",
@@ -695,13 +696,16 @@ pub fn handle_push(target: Option<&str>, allow_merge_commits: bool) -> Result<()
println!("{}", log_output.trim());
println!();
- // Show diff statistics
- let diff_stat =
- repo.run_command(&["diff", "--stat", &format!("{}..HEAD", target_branch)])?;
+ // Show diff statistics with color
+ let diff_stat = repo.run_command(&[
+ "diff",
+ "--color=always",
+ "--stat",
+ &format!("{}..HEAD", target_branch),
+ ])?;
if !diff_stat.trim().is_empty() {
- let dim = AnstyleStyle::new().dimmed();
- println!("{dim}{}{dim:#}", diff_stat.trim());
+ println!("{}", diff_stat.trim());
println!();
}
}
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap b/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap
index d77ba9508..0e61ca802 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap
@@ -22,10 +22,10 @@ exit_code: 0
πŸ”„ Rebasing onto main...
πŸ”„ Pushing 1 commit to main @ [SHA]
-* [SHA] (HEAD -> feature) Add feature file
+* 6551244 (HEAD -> feature) Add feature file
-feature.txt | 1 +
- 1 file changed, 1 insertion(+)
+feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
βœ… Pushed to main (1 commit, 1 file, +1) 
πŸ”„ Cleaning up worktree...
@@ -36,8 +36,4 @@ To enable automatic cd, run: wt configure-shell
βœ… Merge complete
- 1. Rebased feature onto main
- 2. Pushed to main
- 3. Cleaned up worktree
-
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap b/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap
index d77ba9508..31c35de65 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap
@@ -22,10 +22,10 @@ exit_code: 0
πŸ”„ Rebasing onto main...
πŸ”„ Pushing 1 commit to main @ [SHA]
-* [SHA] (HEAD -> feature) Add feature file
+* 4af48f0 (HEAD -> feature) Add feature file
-feature.txt | 1 +
- 1 file changed, 1 insertion(+)
+feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
βœ… Pushed to main (1 commit, 1 file, +1) 
πŸ”„ Cleaning up worktree...
@@ -36,8 +36,4 @@ To enable automatic cd, run: wt configure-shell
βœ… Merge complete
- 1. Rebased feature onto main
- 2. Pushed to main
- 3. Cleaned up worktree
-
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap
index af7e3e674..469e4b44e 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_deterministic.snap
@@ -25,12 +25,12 @@ exit_code: 0
πŸ”„ Rebasing onto main...
πŸ”„ Pushing 1 commit to main @ [SHA]
-* [SHA] (HEAD -> feature) Squash commits from main
+* 27eb169 (HEAD -> feature) Squash commits from main
-file1.txt | 1 +
- file2.txt | 1 +
- file3.txt | 1 +
- 3 files changed, 3 insertions(+)
+file1.txt | 1 +
+ file2.txt | 1 +
+ file3.txt | 1 +
+ 3 files changed, 3 insertions(+)
βœ… Pushed to main (1 commit, 3 files, +3) 
πŸ”„ Cleaning up worktree...
@@ -41,10 +41,5 @@ To enable automatic cd, run: wt configure-shell
βœ… Merge complete
- 1. Squashed 3 commits into 1
- 2. Rebased feature onto main
- 3. Pushed to main
- 4. Cleaned up worktree
-
----- stderr -----
🟑 LLM generation failed, using deterministic message
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_fallback.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_fallback.snap
index cf0393f90..8c6a2c3cf 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_fallback.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_llm_fallback.snap
@@ -26,11 +26,11 @@ exit_code: 0
πŸ”„ Rebasing onto main...
πŸ”„ Pushing 1 commit to main @ [SHA]
-* [SHA] (HEAD -> feature) Squash commits from main
+* 091f0c5 (HEAD -> feature) Squash commits from main
-file1.txt | 1 +
- file2.txt | 1 +
- 2 files changed, 2 insertions(+)
+file1.txt | 1 +
+ file2.txt | 1 +
+ 2 files changed, 2 insertions(+)
βœ… Pushed to main (1 commit, 2 files, +2) 
πŸ”„ Cleaning up worktree...
@@ -41,10 +41,5 @@ To enable automatic cd, run: wt configure-shell
βœ… Merge complete
- 1. Squashed 2 commits into 1
- 2. Rebased feature onto main
- 3. Pushed to main
- 4. Cleaned up worktree
-
----- stderr -----
🟑 LLM generation failed, using deterministic message
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 b9d68aa5a..1197a06e8 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
@@ -24,10 +24,10 @@ exit_code: 0
πŸ”„ Rebasing onto main...
πŸ”„ Pushing 1 commit to main @ [SHA]
-* [SHA] (HEAD -> feature) feat: single commit
+* 525a81f (HEAD -> feature) feat: single commit
-file1.txt | 1 +
- 1 file changed, 1 insertion(+)
+file1.txt | 1 +
+ 1 file changed, 1 insertion(+)
βœ… Pushed to main (1 commit, 1 file, +1) 
πŸ”„ Cleaning up worktree...
@@ -38,8 +38,4 @@ To enable automatic cd, run: wt configure-shell
βœ… Merge complete
- 1. Rebased feature onto main
- 2. Pushed to main
- 3. Cleaned up worktree
-
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_squash_with_llm.snap b/tests/snapshots/integration__integration_tests__merge__merge_squash_with_llm.snap
index 4ca5be98c..27663bd78 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_squash_with_llm.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_squash_with_llm.snap
@@ -27,10 +27,10 @@ exit_code: 0
πŸ”„ Rebasing onto main...
πŸ”„ Pushing 1 commit to main @ [SHA]
-* [SHA] (HEAD -> feature) Squash commits from main
+* ffa5181 (HEAD -> feature) Squash commits from main
-auth.txt | 1 +
- 1 file changed, 1 insertion(+)
+auth.txt | 1 +
+ 1 file changed, 1 insertion(+)
βœ… Pushed to main (1 commit, 1 file, +1) 
πŸ”„ Cleaning up worktree...
@@ -41,10 +41,5 @@ To enable automatic cd, run: wt configure-shell
βœ… Merge complete
- 1. Squashed 2 commits into 1
- 2. Rebased feature onto main
- 3. Pushed to main
- 4. Cleaned up worktree
-
----- stderr -----
🟑 LLM generation failed, using deterministic message
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap b/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap
index 6ba6da291..6d7084036 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap
@@ -21,10 +21,10 @@ exit_code: 0
πŸ”„ Rebasing onto main...
πŸ”„ Pushing 1 commit to main @ [SHA]
-* [SHA] (HEAD -> feature) Add feature file
+* 6551244 (HEAD -> feature) Add feature file
-feature.txt | 1 +
- 1 file changed, 1 insertion(+)
+feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
βœ… Pushed to main (1 commit, 1 file, +1) 
πŸ”„ Cleaning up worktree...
@@ -35,8 +35,4 @@ To enable automatic cd, run: wt configure-shell
βœ… Merge complete
- 1. Rebased feature onto main
- 2. Pushed to main
- 3. Cleaned up worktree
-
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_with_keep.snap b/tests/snapshots/integration__integration_tests__merge__merge_with_keep.snap
index 8c5c71247..65af24e71 100644
--- a/tests/snapshots/integration__integration_tests__merge__merge_with_keep.snap
+++ b/tests/snapshots/integration__integration_tests__merge__merge_with_keep.snap
@@ -23,17 +23,13 @@ exit_code: 0
πŸ”„ Rebasing onto main...
πŸ”„ Pushing 1 commit to main @ [SHA]
-* [SHA] (HEAD -> feature) Add feature file
+* 6551244 (HEAD -> feature) Add feature file
-feature.txt | 1 +
- 1 file changed, 1 insertion(+)
+feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
βœ… Pushed to main (1 commit, 1 file, +1) 
βœ… Merge complete
- 1. Rebased feature onto main
- 2. Pushed to main
- 3. Preserved worktree
-
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__push__push_fast_forward.snap b/tests/snapshots/integration__integration_tests__push__push_fast_forward.snap
index e218e0d2f..6e60e5d65 100644
--- a/tests/snapshots/integration__integration_tests__push__push_fast_forward.snap
+++ b/tests/snapshots/integration__integration_tests__push__push_fast_forward.snap
@@ -21,10 +21,10 @@ exit_code: 0
----- stdout -----
πŸ”„ Pushing 1 commit to main @ [SHA]
-* [SHA] (HEAD -> feature) Add test file
+* c2e2bcc (HEAD -> feature) Add test file
-test.txt | 1 +
- 1 file changed, 1 insertion(+)
+test.txt | 1 +
+ 1 file changed, 1 insertion(+)
βœ… Pushed to main (1 commit, 1 file, +1) 
diff --git a/tests/snapshots/integration__integration_tests__push__push_not_fast_forward.snap b/tests/snapshots/integration__integration_tests__push__push_not_fast_forward.snap
index fd6d53216..905765756 100644
--- a/tests/snapshots/integration__integration_tests__push__push_not_fast_forward.snap
+++ b/tests/snapshots/integration__integration_tests__push__push_not_fast_forward.snap
@@ -21,10 +21,10 @@ exit_code: 0
----- stdout -----
πŸ”„ Pushing 1 commit to main @ [SHA]
-* [SHA] (HEAD -> feature) Add feature file
+* 4af48f0 (HEAD -> feature) Add feature file
-feature.txt | 1 +
- 1 file changed, 1 insertion(+)
+feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
βœ… Pushed to main (1 commit, 1 file, +1) 
diff --git a/tests/snapshots/integration__integration_tests__push__push_to_default.snap b/tests/snapshots/integration__integration_tests__push__push_to_default.snap
index 0f206765c..956ce36f5 100644
--- a/tests/snapshots/integration__integration_tests__push__push_to_default.snap
+++ b/tests/snapshots/integration__integration_tests__push__push_to_default.snap
@@ -20,10 +20,10 @@ exit_code: 0
----- stdout -----
πŸ”„ Pushing 1 commit to main @ [SHA]
-* [SHA] (HEAD -> feature) Add feature file
+* 6551244 (HEAD -> feature) Add feature file
-feature.txt | 1 +
- 1 file changed, 1 insertion(+)
+feature.txt | 1 +
+ 1 file changed, 1 insertion(+)
βœ… Pushed to main (1 commit, 1 file, +1)