feat(git-extension): add configurable Conventional Commit support (#3390)#3413
Open
dhruv-15-03 wants to merge 1 commit into
Open
feat(git-extension): add configurable Conventional Commit support (#3390)#3413dhruv-15-03 wants to merge 1 commit into
dhruv-15-03 wants to merge 1 commit into
Conversation
Adds a commit_style option (fixed | conventional) to the git extension's auto-commit config. When set to conventional, the speckit.git.commit hook instructs the agent to generate a Conventional Commit message from the diff and pass it to auto-commit.sh / auto-commit.ps1 as an explicit argument. If no message is supplied in conventional mode, the scripts fail loudly (stderr + exit 1) instead of silently falling back to the fixed message, but still short-circuit cleanly when there are no changes to commit. - extensions/git/config-template.yml, git-config.yml: new commit_style: fixed (default) / conventional option. - extensions/git/scripts/bash/auto-commit.sh: optional [generated_message] arg, commit_style parsing, conventional-mode enforcement. - extensions/git/scripts/powershell/auto-commit.ps1: mirrored PowerShell implementation. - extensions/git/commands/speckit.git.commit.md: documents commit message styles and updated execution/config guidance. - extensions/git/README.md: documents the new option. - tests/extensions/git/test_git_extension.py: regression tests for fixed default, conventional success, conventional missing-message failure, and no-changes short-circuit (bash + PowerShell). Fixes github#3390 Assisted-by: GitHub Copilot (model: claude-sonnet-5, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
|
/lgtm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements issue #3390: adds a configurable
commit_styleoption (fixed|conventional) to the bundled git extension's auto-commit feature.commit_style: fixed(default) — unchanged, static configured messages.commit_style: conventional— thespeckit.git.commithook now instructs the agent to generate a Conventional Commit message from the diff and pass it explicitly toauto-commit.sh/auto-commit.ps1as a second argument.commit_style: conventionalis set but no generated message is supplied, the scripts fail loudly (stderr message + exit 1) instead of silently committing with the fixed message — while still short-circuiting cleanly when there are no changes to commit.Changes
extensions/git/config-template.yml,extensions/git/git-config.yml: newcommit_styleoption with docs.extensions/git/scripts/bash/auto-commit.sh: optional[generated_message]arg,commit_styleparsing, conventional-mode enforcement (ordered after the "no changes" check).extensions/git/scripts/powershell/auto-commit.ps1: mirrored PowerShell implementation.extensions/git/commands/speckit.git.commit.md: documents the new "Commit Message Styles" section and updated execution/config/graceful-degradation guidance.extensions/git/README.md: documents the new option in the configuration example.tests/extensions/git/test_git_extension.py: newTestAutoCommitBashCommitStyle/TestAutoCommitPowerShellCommitStyleregression tests covering fixed-default, conventional success, conventional missing-message failure, and no-changes short-circuit.Testing
pytest tests/extensions/git/test_git_extension.py -v— all bash/PowerShell tests requiring bash/pwsh skip consistently in this environment (matching existingTestAutoCommitBash/TestAutoCommitPowerShellbehavior via@requires_bash/HAS_PWSH).auto-commit.ps1using Windows PowerShell, since pwsh (PowerShell 7) isn't installed in this environment.pytest tests/(full suite): 3614 passed, 295 skipped, 39 failed — all 39 failures are pre-existing, environment-specific (Windows symlink-permission tests and pwsh-only tests), unrelated to this change.ruff check extensions/git tests/extensions/git: all checks passed.Fixes #3390
This PR was prepared with the assistance of GitHub Copilot (model: claude-sonnet-5, operating autonomously) on behalf of @dhruv-15-03.