fix: validate prefix uniqueness when --number option is used#1340
Open
ggeutzzang wants to merge 1 commit intogithub:mainfrom
Open
fix: validate prefix uniqueness when --number option is used#1340ggeutzzang wants to merge 1 commit intogithub:mainfrom
ggeutzzang wants to merge 1 commit intogithub:mainfrom
Conversation
When --number is explicitly provided, validate that the specified prefix number is not already in use by another spec directory. This prevents collisions like: - Existing: 001-feature-a - New with --number 1: 001-feature-b (COLLISION!) The validation allows retrying the same feature (same suffix) but blocks creating different features with duplicate prefixes. Error message guides users to remove --number for auto-detection. Related to github#1332
Author
|
@copilot review |
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.
Summary
When
--numberis explicitly provided tocreate-new-feature.sh, this PR adds validation to ensure the specified prefix number is not already in use by another spec directory.Problem
Even after PR #1237 fixed the auto-detection logic, users can still create collisions by explicitly using the
--numberoption:Solution
Added validation after
FEATURE_NUMis calculated:Test
Related
Related to #1332 - This addresses a remaining edge case not covered by #1237
🤖 Generated with Claude Code