Skip to content

fix(git): preserve option-like branch descriptions - #5124

Open
WOLIKIMCHENG wants to merge 2 commits into
github:mainfrom
WOLIKIMCHENG:fix/5096-bash-description-parity
Open

WOLIKIMCHENG wants to merge 2 commits into
github:mainfrom
WOLIKIMCHENG:fix/5096-bash-description-parity

Conversation

@WOLIKIMCHENG

@WOLIKIMCHENG WOLIKIMCHENG commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Preserve literal option-like descriptions such as -n, -e, and -E in the Git extension's Bash feature-branch hook, matching Python behavior.
  • Keep the Git extension version and catalog entry in sync at 1.0.4.
  • Leave the core feature-script change and its parity tests for a separate PR, as requested.

Related to #5096.

Testing

  • Rebuilt candidate on Linux/Python 3.13.7: 49 focused tests passed, covering literal descriptions, empty-input rejection, the Git manifest, and catalog/version consistency.
  • Earlier generated Codex/Bash projects exercised both required command paths with literal -n and no short-name override; the relevant scripts and templates are unchanged after the merge rebuild.
Command tested Result
$speckit-git-feature -n Git branch hook created 001-n without spec or state files.
$speckit-specify -n Required Git hook created the branch; Specify then produced the spec, feature state, and checklist.
  • bash -n and git diff --cached --check passed on the rebuilt candidate. Full CI and native Windows/macOS validation of this candidate have not been run locally.

AI Disclosure

  • I did use AI assistance (described below)

AI disclosure: AI-assisted tools were used to implement the fix and develop tests.

Assisted-by: Codex CLI (model: gpt-6.1-sol, autonomous)
@WOLIKIMCHENG
WOLIKIMCHENG requested a review from mnriem as a code owner October 26, 2026 08:14
@mnriem mnriem added the triage-can-wait Verdict: valid and in-scope but deprioritized; held behind the evidence gate label Oct 26, 2026
@mnriem
mnriem requested a max review from Copilot October 26, 2026 14:17

@yxshee yxshee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I checked this against main (7370e59). The change is right: in bash, $(echo "-n") is empty while $(printf '%s\n' "-n") is -n, so the trim step was the only thing turning these descriptions into the "cannot be empty" error.

I also looked for the same pattern elsewhere so a follow-up isn't needed. Both places that pipe the raw description through echo are covered here: scripts/bash/create-new-feature.sh:91 and extensions/git/scripts/bash/create-new-feature-branch.sh:103. The other $(echo "$var" | ...) calls in those two scripts (create-new-feature.sh:122, create-new-feature-branch.sh:120 and :155) only see directory or branch names already matched against ^[0-9]{3,}-, so they can't start with a dash. In generate_branch_name, echo "$result" and echo "$cleaned" only get words split out by unicode_words or the output of clean_branch_name, and neither one starts with -.

The branch merges cleanly with current main, and it also merges cleanly alongside #5201, which edits the same git extension script.

Posted on behalf of @yxshee. AI disclosure: Claude Code (model: Claude Opus 5.5, autonomous) read the diff, searched the bash scripts on main for the same pattern, test-merged the branch, and drafted this review. I did not run the PR branch's tests.


Generated by Claude Code

@mnriem
mnriem requested an auto review from Copilot and removed request for Copilot November 2, 2026 15:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The parity test compares incompatible PowerShell and Bash persistence hints and assumes matching Windows and MSYS paths, risking failures under Git-for-Windows Bash.

1 open issue
What changed in this PR

This PR fixes #5096 by preserving option-like feature descriptions in the Bash scripts, aligning their behavior with Python.

Changes:

  • Replace echo with printf when trimming descriptions in both feature-creation scripts.
  • Add parity tests for literal descriptions, whitespace rejection, creation, and dry-run behavior.
  • Bump the bundled Git extension to version 1.0.2.
File Description
tests/​test_create_new_feature_python_parity.py Add core-script regression and parity coverage.
tests/​extensions/​git/​test_git_extension.py Update the expected extension version.
tests/​extensions/​git/​test_git_extension_python_parity.py Add branch-hook parity and side-effect checks.
scripts/​bash/​create-new-feature.sh Preserve option-like descriptions during trimming.
extensions/​git/​scripts/​bash/​create-new-feature-branch.sh Apply the same trimming fix to branch creation.
extensions/​git/​extension.yml Bump the extension version to 1.0.2.
extensions/​catalog.json Synchronize the catalog version.

Review effort: Balanced (auto)

@mnriem

mnriem commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Could you split this into two independently mergeable PRs: one for the Git extension fix, keeping its tests, version bump, and catalog update together, and one for the core script fix and its regression tests? Neither fix depends on the other, so this would let us review and land the extension change separately while assessing the core change on its own evidence. The Windows parity concern raised in this review belongs with the core PR; please address the shell-specific persistence hints and native/MSYS path differences there.

AI disclosure: Drafted for @mnriem using GitHub Copilot, powered by GPT-6.1 Sol, in an interactive, user-directed session; AI inspected the diff and review feedback and drafted this response.

@mnriem mnriem added the author-awaiting Waiting on author response label Nov 2, 2026
Merge current main and keep the Git extension fix, tests, version bump,
and catalog update together. Leave the core script change for a separate PR.

Assisted-by: Codex (model: gpt-6.1-sol, autonomous)
Copilot AI auto review requested due to automatic review settings November 5, 2026 03:27
@WOLIKIMCHENG WOLIKIMCHENG changed the title fix: preserve option-like feature descriptions fix(git): preserve option-like branch descriptions Nov 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the Git extension’s option-like description handling fix.

1 open issue

Review effort: Balanced (auto)

@WOLIKIMCHENG

Copy link
Copy Markdown
Contributor Author

Thank you for suggesting the split. I've updated this PR to contain only the Git extension fix, its regression tests, and the 1.0.4 manifest/catalog update. I haven't opened the separate core-script PR yet. The Windows parity concern, including shell-specific persistence hints and native/MSYS paths, remains to be addressed with that core change; I don't consider the existing review thread resolved by this PR.

Review-round summary for commit 1d5405b07a75dc96d26282eb730bd4504cdd8662:

  • 49 focused tests passed on Linux/Python 3.13.7. The generated Codex/Bash standalone and Specify paths were also exercised earlier with literal -n.
  • Full CI and native Windows/macOS validation have not been run locally.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the Git extension’s literal-description handling update.

1 open issue

Review effort: Balanced (auto)

@mnriem

mnriem commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback

@WOLIKIMCHENG

Copy link
Copy Markdown
Contributor Author

Thanks for flagging this. The Copilot thread points to tests/test_create_new_feature_python_parity.py, which is no longer in this PR after the split at 1d5405b. #5124 now contains only the Git extension fix, its tests, and version/catalog metadata. The Windows core-script parity concern moved to #5245, where it is still under review. I have not resolved the thread or changed this PR in response. Please let me know if you see a Git-extension-specific issue here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified in the Git extension’s literal-description handling changes.

1 open issue

Review effort: Balanced (auto)

@mnriem

mnriem commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback. If not applicable, please explain why

@WOLIKIMCHENG

Copy link
Copy Markdown
Contributor Author

Thank you for the follow-up. Review-round summary for 1d5405b07a75dc96d26282eb730bd4504cdd8662: no code changes. I replied in the original Copilot thread with the current test-scope and comparison details.

For additional Windows evidence, I ran the 24 new Git-extension cases locally with Windows Python 3.12.1 and Git-for-Windows Bash: 24 passed, 0 failed, 0 skipped. The isolated run used a temporary repo-external shim to select Git Bash rather than the WSL launcher; the shim and test environment were removed. The Windows/Python 3.13 CI job skipped these cases, and I did not rerun CI or the full suite. The original thread remains unresolved for reviewer confirmation.

This branch has not been deployed

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

Labels

author-awaiting Waiting on author response triage-can-wait Verdict: valid and in-scope but deprioritized; held behind the evidence gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants