Skip to content

Commit 7aa605e

Browse files
show only diff stats in version review
1 parent f0434ad commit 7aa605e

6 files changed

Lines changed: 5 additions & 34 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ adheres to [Semantic Versioning](https://semver.org/). Work in progress lives un
1616
### Fixed
1717
- **version** — Modified `git checkout -b` to `git checkout -B` so that release branch creation gracefully handles previously abandoned branches by resetting them instead of crashing.
1818
- **version** — Removed the startup `gh` confirmation prompt and moved confirmation to a final
19-
review that shows the computed plan, changed files, and full git diff before commit/push/PR.
19+
review that shows the computed plan and changed-file stats before commit/push/PR.
2020
- **init/npm** — npm workspace discovery now skips workspace manifests that are not release
2121
packages because they lack `name` or `version`, prints each skipped manifest with the reason,
2222
and still fails on malformed `package.json` files.

crates/cli/tests/publish_flow.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@ impl GitOps for FakeGit {
109109
fn diff_stat(&self) -> Result<String> {
110110
Ok(String::new())
111111
}
112-
fn diff(&self) -> Result<String> {
113-
Ok(String::new())
114-
}
115112
fn reset_hard(&self) -> Result<()> {
116113
Ok(())
117114
}

crates/cli/tests/version_flow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ fn version_flow_releases_on_a_branch_and_never_touches_main() {
210210
let confirmations = prompt.confirmations.borrow();
211211
assert_eq!(confirmations.len(), 1);
212212
assert!(confirmations[0].contains("Changed Files:"));
213-
assert!(confirmations[0].contains("Diff:"));
213+
assert!(!confirmations[0].contains("Diff:"));
214214
assert!(confirmations[0].contains("packages/core/package.json"));
215215

216216
// main is untouched: core is still 1.0.0 there.

crates/core/src/git.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ pub trait GitOps {
9191
fn create_branch(&self, name: &str) -> Result<()>;
9292
fn checkout_branch(&self, name: &str) -> Result<()>;
9393
fn diff_stat(&self) -> Result<String>;
94-
fn diff(&self) -> Result<String>;
9594
fn reset_hard(&self) -> Result<()>;
9695
fn add_all(&self) -> Result<()>;
9796
fn commit(&self, message: &str) -> Result<()>;
@@ -125,10 +124,6 @@ impl GitOps for GitRepo {
125124
run_git(&self.root, &["diff", "--stat"])
126125
}
127126

128-
fn diff(&self) -> Result<String> {
129-
run_git(&self.root, &["diff"])
130-
}
131-
132127
fn reset_hard(&self) -> Result<()> {
133128
run_git(&self.root, &["reset", "--hard"]).map(|_| ())
134129
}

crates/core/src/version.rs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ pub fn orchestrate_many(
366366

367367
// 9. Final review: show the actual files and diff produced by the release edits. On cancel,
368368
// discard only the generated release-branch changes and return to the original branch.
369-
let review_text = render_final_review(&summary_text, &git.diff_stat()?, &git.diff()?, opts);
369+
let review_text = render_final_review(&summary_text, &git.diff_stat()?, opts);
370370
if !prompt.confirm(&review_text)? {
371371
git.reset_hard()?;
372372
git.checkout_branch(&branch)?;
@@ -395,12 +395,7 @@ pub fn orchestrate_many(
395395
Ok(())
396396
}
397397

398-
fn render_final_review(
399-
summary_text: &str,
400-
diff_stat: &str,
401-
diff: &str,
402-
opts: &VersionOptions,
403-
) -> String {
398+
fn render_final_review(summary_text: &str, diff_stat: &str, opts: &VersionOptions) -> String {
404399
let mut out = String::new();
405400
out.push_str(summary_text);
406401
if opts.skip_pr {
@@ -418,15 +413,6 @@ fn render_final_review(
418413
out.push('\n');
419414
}
420415
}
421-
out.push_str("\nDiff:\n");
422-
if diff.trim().is_empty() {
423-
out.push_str(" (empty diff)\n");
424-
} else {
425-
out.push_str(diff);
426-
if !diff.ends_with('\n') {
427-
out.push('\n');
428-
}
429-
}
430416
out.push('\n');
431417
out
432418
}
@@ -675,10 +661,6 @@ mod tests {
675661
Ok(" CHANGELOG.md | 2 ++\n 1 file changed, 2 insertions(+)\n".to_string())
676662
}
677663

678-
fn diff(&self) -> Result<String> {
679-
Ok("diff --git a/CHANGELOG.md b/CHANGELOG.md\n".to_string())
680-
}
681-
682664
fn reset_hard(&self) -> Result<()> {
683665
Ok(())
684666
}

docs/commands/version.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Implemented in `crates/core/src/version.rs`.
4242
stub `_Dependency updates._`. See [changelog-format.md](../changelog-format.md).
4343
- `adapter.update_lockfile` — refresh the lockfile in the **same commit**, or a CI install
4444
will drift.
45-
10. **Final review / confirm** — print the actual `git diff --stat` and `git diff`, then ask
45+
10. **Final review / confirm** — print the actual `git diff --stat`, then ask
4646
whether to commit, push, and open the PR. On cancel, generated release-branch changes are
4747
discarded and the command returns to the original branch.
4848
11. **Commit** (`chore(release): …`), **push**, and **open a PR** via `gh`.
@@ -66,9 +66,6 @@ Changed Files:
6666
Cargo.toml | 2 +-
6767
CHANGELOG.md | 8 +++++++-
6868
69-
Diff:
70-
diff --git a/Cargo.toml b/Cargo.toml
71-
...
7269
```
7370

7471
Three blocks: explicitly **selected** packages, **auto-bumped** dependents (with the reason),

0 commit comments

Comments
 (0)