Skip to content

Bash script creates duplicate feature numbers (filters by short name instead of checking all branches) #1101

@armoucar

Description

@armoucar

Bug Description

The bash script .specify/scripts/bash/create-new-feature.sh generates duplicate feature numbers when multiple feature branches exist, similar to the PowerShell bug fixed in #1023.

Root Cause

The check_existing_branches function (lines 84-112) filters branches by the specific short_name:

# Line 91: Only matches branches with the SAME short name
grep -E "refs/heads/[0-9]+-${short_name}$"

This causes it to check only branches matching the current feature name pattern, not ALL branches globally.

Expected Behavior

Should scan all feature branches (like the non-git fallback in lines 201-207) and return the next global sequential number.

Actual Behavior

With existing specs 001-build-an-account and 002-oauth2-google-auth, running the script with --short-name multilingual-support creates 001-multilingual-support instead of 003-multilingual-support.

Fix

Apply the same fix from #1023: remove the short_name filter from check_existing_branches and match pattern refs/heads/[0-9]+- globally.


Note: PowerShell version already fixed in #1023, bash version needs same treatment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions