Files
spec-kit/scripts
Joseph Mearman 33df8976ca fix: use global maximum for branch numbering to prevent collisions
The check_existing_branches (bash) and Get-NextBranchNumber (PowerShell)
functions were only looking for branches/specs matching the SAME short name
when determining the next feature number. This caused collisions where
multiple features could be assigned the same number if they had different
short names.

For example, if feature 023-ci-optimization existed, creating a new feature
with a different short name would incorrectly use 001 instead of 024.

This fix changes both functions to:
1. Use get_highest_from_branches() / Get-HighestNumberFromBranches to find
   the highest number across ALL branches globally
2. Use get_highest_from_specs() / Get-HighestNumberFromSpecs to find the
   highest number across ALL spec directories globally
3. Return the maximum of both + 1

The helper functions already existed but were not being used. This fix
properly utilizes them to ensure features are numbered sequentially
regardless of their short names.

Issue: Branch number collisions when creating features with different names
Impact: Prevents multiple features from sharing the same number prefix
2025-11-23 16:01:56 +00:00
..