feat(cli): add diff command to compare two versions - #751
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #222
Adds
ferrflow diff [package] <from>..<to>— a detailed comparison of what went into a version range.Output
<package> <from> → <to> (<overall bump>).major/minor/patch/none).!/BREAKING CHANGE:commit).--jsonemits the same data as a structured object.Endpoint resolution
Each side of the range resolves to a commit by trying, in order: the literal string as a tag (a real tag, or
v1.4.0in a single-package repo), then the package's tag for that version (api@v1.4.0). An unresolvable endpoint errors with the candidates it tried.Implementation
version_diffmodule (the existingdiffmodule is the unified-diff util). Reusesconventional_commits(bump/breaking classification) andbuild_section_with(changelog rendering) — no new logic duplicated.get_commits_between/get_changed_files_between(rangefrom..to) andresolve_tag_name_to_commit(peels annotated tags).Tests
[package] <range>in any order, range required) and range splitting (rejects empty sides). 973 in the suite, clippy-D warningsclean, wasm builds (the command is CLI-only).ferrflow diff v5.40.0..v5.43.0lists 8 commits with bumps, 33 changed files, and the rendered changelog;--jsonproduces the structured form.Note
For a monorepo the range spans all commits between the two tags (not path-scoped to the named package) — correct for single-package repos and a useful window audit for monorepos. Path-scoping to the package could be a follow-up.