From a5466f08de3e3759aafdb7c406d6923e59318d31 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 22:31:01 +0000 Subject: [PATCH] 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 --- extensions/git/scripts/bash/create-new-feature.sh | 2 +- templates/commands/specify.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/git/scripts/bash/create-new-feature.sh b/extensions/git/scripts/bash/create-new-feature.sh index 8af4fa511..63b2f26b1 100644 --- a/extensions/git/scripts/bash/create-new-feature.sh +++ b/extensions/git/scripts/bash/create-new-feature.sh @@ -343,7 +343,7 @@ if [ ${#BRANCH_NAME} -gt $MAX_BRANCH_LENGTH ]; then fi if [ "$HAS_GIT" = true ]; then - if ! git checkout -b "$BRANCH_NAME" 2>/dev/null; then + if ! git checkout -q -b "$BRANCH_NAME" >/dev/null 2>&1; then # Check if branch already exists if git branch --list "$BRANCH_NAME" | grep -q .; then if [ "$USE_TIMESTAMP" = true ]; then diff --git a/templates/commands/specify.md b/templates/commands/specify.md index ec52c00e5..df2e7747b 100644 --- a/templates/commands/specify.md +++ b/templates/commands/specify.md @@ -77,7 +77,8 @@ Given that feature description, do this: **Git extension check**: Before running the branch creation script, check if the git extension is enabled: - Check if `.specify/extensions/.registry` exists (a single JSON file tracking all extensions) - - If it exists, read the JSON and look for `extensions.git`; verify its `"enabled"` field is `true` (or not explicitly `false`) + - If it exists, read the JSON and look for an `extensions.git` entry + - **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) - If the git extension is **disabled** (explicitly `"enabled": false`), **skip branch creation entirely** — do **not** run the branch creation script. Instead: - Derive a spec directory name from the short name, e.g. `specs//` - Explicitly set the following variables so later steps can use them: