Skip to content

Conversation

@ignatremizov
Copy link

@ignatremizov ignatremizov commented Feb 11, 2026

Summary

  • prevent create-new-feature.sh from capturing git fetch --all output into BRANCH_NUMBER
  • fix arithmetic expansion failure like 10#Fetching: value too great for base

Root Cause

check_existing_branches runs in command substitution and previously called:

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

This suppresses stderr but not stdout. In environments where fetch prints status text to stdout (for example Fetching ...), that text can be captured alongside the numeric return value and later break numeric parsing.

Fix

Changed fetch redirection to suppress both stdout and stderr:

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

This keeps behavior the same while ensuring check_existing_branches emits only the intended numeric value.

Validation

  • Ran in spec-kit repo:
    • bash scripts/bash/create-new-feature.sh --json "test fetch output capture fix"
    • Result: JSON returned successfully, no 10#Fetching error
  • Ran from external repo (vue-tailwind-datepicker) against local spec-kit script:
    • bash /Users/iremizov/code/spec-kit/scripts/bash/create-new-feature.sh --json "verify fetch output fix from external repo"
    • Result: JSON returned successfully, no 10#Fetching error

AI Disclosure

This PR was prepared with AI assistance (OpenAI Codex gpt-5.3-codex high), then reviewed and validated by me.

Closes #1592

The branch number is computed via command substitution when create-new-feature.sh runs check_existing_branches. In some environments git fetch prints 'Fetching ...' to stdout, which was captured into BRANCH_NUMBER and later caused arithmetic expansion failures like '10#Fetching'.

Redirect fetch stdout and stderr to /dev/null inside check_existing_branches so only the numeric value is returned. This keeps behavior unchanged aside from eliminating the noisy-output failure mode.

Refs: github#1592
Copilot AI review requested due to automatic review settings February 11, 2026 18:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Prevents scripts/bash/create-new-feature.sh --json from failing when git fetch writes status text to stdout during branch-number auto-detection, ensuring the command substitution used to compute BRANCH_NUMBER remains numeric-only.

Changes:

  • Redirect git fetch --all --prune stdout + stderr to /dev/null inside check_existing_branches to avoid contaminating captured output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant