Skip to content

feat(git-extension): add configurable Conventional Commit support (#3390)#3413

Open
dhruv-15-03 wants to merge 1 commit into
github:mainfrom
dhruv-15-03:feat/3390-conventional-commit-style
Open

feat(git-extension): add configurable Conventional Commit support (#3390)#3413
dhruv-15-03 wants to merge 1 commit into
github:mainfrom
dhruv-15-03:feat/3390-conventional-commit-style

Conversation

@dhruv-15-03

Copy link
Copy Markdown

Summary

Implements issue #3390: adds a configurable commit_style option (fixed | conventional) to the bundled git extension's auto-commit feature.

  • commit_style: fixed (default) — unchanged, static configured messages.
  • commit_style: conventional — the speckit.git.commit hook now instructs the agent to generate a Conventional Commit message from the diff and pass it explicitly to auto-commit.sh / auto-commit.ps1 as a second argument.
  • If commit_style: conventional is 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: new commit_style option with docs.
  • extensions/git/scripts/bash/auto-commit.sh: optional [generated_message] arg, commit_style parsing, 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: new TestAutoCommitBashCommitStyle / TestAutoCommitPowerShellCommitStyle regression 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 existing TestAutoCommitBash/TestAutoCommitPowerShell behavior via @requires_bash / HAS_PWSH).
  • Manually validated all four scenarios (fixed default, conventional success, conventional missing-message failure, no-changes short-circuit) end-to-end against auto-commit.ps1 using 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.

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>
@dhruv-15-03 dhruv-15-03 requested a review from mnriem as a code owner July 8, 2026 16:40
Copilot AI review requested due to automatic review settings July 8, 2026 16:40

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@grafvonb

grafvonb commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

/lgtm

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.

Review details

  • Files reviewed: 7/7 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment on lines +66 to +73
# Top-level scalar key: commit_style (fixed | conventional)
foreach ($line in Get-Content $configFile) {
if ($line -match '^commit_style:\s*(.+)$') {
$styleVal = $matches[1].Trim() -replace '^["'']' -replace '["'']$'
if ($styleVal) { $commitStyle = $styleVal.ToLower() }
break
}
}
Comment on lines 56 to 61
if [ -f "$_config_file" ]; then
# Top-level scalar key: commit_style (fixed | conventional)
_style_val=$(grep '^commit_style:' "$_config_file" 2>/dev/null | sed 's/^commit_style:[[:space:]]*//' | sed 's/^["'\'']//' | sed 's/["'\'']*$//' | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]')
[ -n "$_style_val" ] && _commit_style="$_style_val"

# Parse the auto_commit section for this event.
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.

[Feature]: Add configurable Conventional Commit support to the bundled Git extension

4 participants