Skip to content

Commit a5466f0

Browse files
Copilotmnriem
andauthored
fix: quiet git checkout in JSON mode and clarify registry check logic
1. Use `git checkout -q -b` with stdout redirect to prevent status messages from contaminating JSON output in create-new-feature.sh 2. Clarify specify.md registry check: only skip branching when extensions.git.enabled is present and explicitly false; proceed normally in all other cases (missing registry, missing entry, etc.) Co-authored-by: mnriem <15701806+mnriem@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/spec-kit/sessions/67a6414f-e8ce-4455-95e5-299c72d86624
1 parent 363b7dc commit a5466f0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

extensions/git/scripts/bash/create-new-feature.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ if [ ${#BRANCH_NAME} -gt $MAX_BRANCH_LENGTH ]; then
343343
fi
344344

345345
if [ "$HAS_GIT" = true ]; then
346-
if ! git checkout -b "$BRANCH_NAME" 2>/dev/null; then
346+
if ! git checkout -q -b "$BRANCH_NAME" >/dev/null 2>&1; then
347347
# Check if branch already exists
348348
if git branch --list "$BRANCH_NAME" | grep -q .; then
349349
if [ "$USE_TIMESTAMP" = true ]; then

templates/commands/specify.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ Given that feature description, do this:
7777
7878
**Git extension check**: Before running the branch creation script, check if the git extension is enabled:
7979
- Check if `.specify/extensions/.registry` exists (a single JSON file tracking all extensions)
80-
- If it exists, read the JSON and look for `extensions.git`; verify its `"enabled"` field is `true` (or not explicitly `false`)
80+
- If it exists, read the JSON and look for an `extensions.git` entry
81+
- **Only skip branching** when `extensions.git.enabled` is **present and explicitly `false`**. In all other cases — including when the registry file is missing, when `extensions.git` has no entry, or when `"enabled"` is `true` or absent — proceed with normal branch creation (extension script if present, else core `{SCRIPT}` fallback)
8182
- If the git extension is **disabled** (explicitly `"enabled": false`), **skip branch creation entirely** — do **not** run the branch creation script. Instead:
8283
- Derive a spec directory name from the short name, e.g. `specs/<short-name>/`
8384
- Explicitly set the following variables so later steps can use them:

0 commit comments

Comments
 (0)