spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

create-new-feature.sh --json can fail with '10#Fetching: value too great for base'

Open ignatremizov opened this issue 9 months ago • 2 comments

Summary

Running scripts/bash/create-new-feature.sh --json can fail with:

line 250: 10#Fetching: value too great for base (error token is "10#Fetching")

Reproduction

  1. In any git repo, run:
bash /path/to/spec-kit/scripts/bash/create-new-feature.sh --json "Native-like month/year scrolling selector mode"
  1. Observe failure:
.../create-new-feature.sh: line 250: 10#Fetching: value too great for base (error token is "10#Fetching")

Script location

  • scripts/bash/create-new-feature.sh
  • Failing line: FEATURE_NUM=$(printf "%03d" "$((10#$BRANCH_NUMBER))")

Likely cause

BRANCH_NUMBER is populated via command substitution:

BRANCH_NUMBER=$(check_existing_branches "$SPECS_DIR")

Inside check_existing_branches, this runs:

git fetch --all --prune 2>/dev/null || true

If git fetch --all writes status text like Fetching ... to stdout, command substitution captures that output along with the numeric result, so BRANCH_NUMBER can become a non-numeric string (for example Fetching...), which then breaks numeric expansion on line 250.

Suggested fix

Silence both stdout and stderr for fetch (or otherwise ensure check_existing_branches emits only the final integer):

git fetch --all --prune >/dev/null 2>&1 || true

Environment

  • Date observed: 2026-02-11
  • Invocation target repo: /Users/iremizov/code/vue-tailwind-datepicker
  • Script source repo: github/spec-kit

ignatremizov avatar Feb 11 '26 17:02 ignatremizov

This issue has been automatically marked as stale because it has not had any activity for 150 days. It will be closed in 30 days if no further activity occurs.

github-actions[bot] avatar Jul 12 '26 00:07 github-actions[bot]

This issue has been automatically closed due to inactivity (180 days total). If you believe this issue is still relevant, please reopen it or create a new issue.

github-actions[bot] avatar Aug 12 '26 00:08 github-actions[bot]