Add --what-if option to prepare-release command for simulating version changes #1242
+293
−44
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.
This PR adds a
--what-ifoption to thenbgv prepare-releasecommand that allows users to simulate the prepare-release operation and see what versions would be set without actually making any git changes.What it does
The
--what-ifflag enables users to preview the results of a prepare-release operation before committing to it:Implementation
--what-ifoption: Added to the prepare-release command with appropriate help textSimulatePrepareReleasemethod: New method inReleaseManagerthat performs all the same validation and version calculation logic as the regularPrepareReleasemethod, but without making any git changesExample outputs
Text format:
JSON format:
{ "CurrentBranch": { "Name": "main", "Commit": "abc123...", "Version": "3.9-alpha" }, "NewBranch": { "Name": "v3.8", "Commit": "abc123...", "Version": "3.8" } }This enhancement provides a safe way for users to understand the impact of prepare-release operations before executing them, addressing the need for predictable version management workflows.
Fixes #1019.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.