From 5e0ad592a1706478f59bc5d0618da9cdfe12d3bf Mon Sep 17 00:00:00 2001 From: Lakkanna Walikar Date: Fri, 9 Jan 2026 13:44:35 +0530 Subject: [PATCH] Fix global branch numbering in specify command Resolves #1454 Update the branch numbering logic to use globally sequential numbers across all branches rather than restarting from 001 for each unique short name. This allows users to track the chronological order of features added to the project. Changes: - Add fallback logic to use highest branch number from all sources - If no numbered branches exist, use specs directory count + 1 - Update documentation to reflect the four-source checking approach --- templates/commands/specify.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/commands/specify.md b/templates/commands/specify.md index 3c952d683e..bf9b9867f2 100644 --- a/templates/commands/specify.md +++ b/templates/commands/specify.md @@ -51,9 +51,10 @@ Given that feature description, do this: - Remote branches: `git ls-remote --heads origin | grep -E 'refs/heads/[0-9]+-$'` - Local branches: `git branch | grep -E '^[* ]*[0-9]+-$'` - Specs directories: Check for directories matching `specs/[0-9]+-` + - Use the highest branch number found across all sources, or if none exists, set the number to one more than the count of existing specs c. Determine the next available number: - - Extract all numbers from all three sources + - Extract all numbers from all four sources - Find the highest number N - Use N+1 for the new branch number