diff --git a/docs/tutorial.md b/docs/tutorial.md index cb2a93c61..371157651 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -16,6 +16,7 @@ Let's start by cloning the Jujutsu Git repo using `jj`: $ jj git clone https://github.com/martinvonz/jj.git Fetching into new repo in "/jj" Working copy now at: 265ecf5cab2d +Added 98 files, modified 0 files, removed 0 files $ cd jj ``` @@ -34,7 +35,7 @@ Let's check out a particular commit, so we get more predicable output: ```shell script $ jj co 080a9b37ff7e Working copy now at: 608c179a60df -Added 2 files, modified 57 files, removed 5 files +Added 7 files, modified 65 files, removed 21 files $ jj st Parent commit: 080a9b37ff7e cli: make `jj st` show parent commit before working copy commit Working copy : 608c179a60df @@ -226,6 +227,7 @@ modifies a different file. Let's now rebase B2 directly onto A: $ jj rebase -s 5548374c0794 -d cf49e6bec410 Rebased 3 commits Working copy now at: 9195b6d2e8dc +Added 0 files, modified 1 files, removed 0 files $ jj l @ 9195b6d2e8dc 47684978bf4b martinvonz@google.com 2021-05-26 12:39:56.000 -07:00 conflict | @@ -411,6 +413,7 @@ $ jj edit -r ::@ Created 2423c134ea70 ABC Rebased 2 descendant commits Working copy now at: d31c52e8ca41 +Added 0 files, modified 1 files, removed 0 files ``` When Meld starts, edit the right side by e.g. adding something to the first line. Then close Meld. You can now inspect the rewritten commit with diff --git a/src/commands.rs b/src/commands.rs index 58f6eff48..8f2e15678 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -429,11 +429,13 @@ impl RepoCommandHelper { self.repo = tx.commit(); let stats = update_working_copy(ui, &self.repo, &mut self.repo.working_copy_locked())?; if let Some(stats) = &stats { - writeln!( - ui, - "Added {} files, modified {} files, removed {} files", - stats.added_files, stats.updated_files, stats.removed_files - )?; + if stats.added_files > 0 || stats.updated_files > 0 || stats.removed_files > 0 { + writeln!( + ui, + "Added {} files, modified {} files, removed {} files", + stats.added_files, stats.updated_files, stats.removed_files + )?; + } } Ok(stats) } diff --git a/tests/smoke_test.rs b/tests/smoke_test.rs index 1d6c57c26..85b9ae222 100644 --- a/tests/smoke_test.rs +++ b/tests/smoke_test.rs @@ -92,7 +92,6 @@ $", let stdout_string = output.stdout_string(); let output_regex = Regex::new( "^Working copy now at: [[:xdigit:]]+ add some files -Added 0 files, modified 0 files, removed 0 files $", ) .unwrap(); @@ -108,7 +107,6 @@ $", let stdout_string = output.stdout_string(); let output_regex = Regex::new( "^Working copy now at: [[:xdigit:]]+ -Added 0 files, modified 0 files, removed 0 files $", ) .unwrap();