You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: git extension: auto_commit.default: true has no effect with the shipped config template #5050
# Auto-commit before/after core commands.# Set "default" to enable for all commands, then override per-command.
But the template lists every event with enabled: false, and auto-commit.sh only falls back to auto_commit.default when an event's section is missing entirely. So setting default: true as the comment suggests enables nothing.
Steps to Reproduce
Install the git extension (specify extension add git). .specify/extensions/git/git-config.yml is created from config-template.yml.
Change only auto_commit.default from false to true.
Make a change in the working tree and run bash .specify/extensions/git/scripts/bash/auto-commit.sh before_plan.
Delete the before_plan: block from git-config.yml and run step 3 again.
Expected Behavior
Step 3 commits, as the comment describes.
Actual Behavior
Step 3 exits 0 without committing. Step 4 commits ([OK] Changes committed before plan), which shows the default only applies to events that are not listed.
Specify CLI Version
1.2.1. The same template text and fallback logic are on main and in v1.2.2.
AI Agent
Not agent-specific (the extension config and bash script).
Operating System
macOS
Python Version
3.15
Error Logs
None. The script exits 0 and skips the commit silently.
Additional Context
Either fix would work:
Reword the comment: default applies only to events that are not listed below, so enable each listed event you want with enabled: true.
Or ship the template without per-event enabled: keys (keep only message:) so default works as described, and let an explicit enabled: override it.
The second option also matches the comment's "then override per-command" wording.
AI Disclosure
Drafted with Claude Code (model claude-opus-5-5), human-supervised. An AI code review first flagged the comment; I reproduced it locally with the steps above before filing.
Issue author @stefanwalther reports that the git extension config comment says auto_commit.default enables all commands unless overridden, but the shipped template also sets every event’s enabled: false. In the implementation, default fallback is only applied when an event section is absent, so setting only default: true does not enable listed events. The report includes a concrete reproduction using before_plan and shows that deleting the before_plan: block makes default apply.
Symptom
When users set auto_commit.default: true in the generated git config, auto-commit still does not run for standard events (for example before_plan) because those events are explicitly present and disabled in the template. Expected behavior per comment wording is that default enables all commands unless an event is explicitly overridden.
Reproduction
Install the git extension so .specify/extensions/git/git-config.yml is created from the shipped template.
Set only auto_commit.default: true.
Make a working-tree change and run bash .specify/extensions/git/scripts/bash/auto-commit.sh before_plan.
Observe no commit.
Remove the before_plan: section from git-config.yml and rerun step 3.
Observe commit succeeds (default path applies).
Suspected Code Paths
extensions/git/config-template.yml:28-36 — comment states default enables all commands, but template explicitly defines events with enabled: false, including before_plan.
extensions/git/scripts/bash/auto-commit.sh:163-168 — default is applied only when event key is missing (if ! grep ... ${EVENT_NAME}:), so explicit event sections suppress default.
extensions/git/scripts/python/auto_commit.py:108-111 — same fallback logic: use default only when event section does not exist.
extensions/git/scripts/powershell/auto-commit.ps1:160-164 — same fallback behavior in PowerShell implementation.
The defect is a configuration contract mismatch between documentation comments and parser semantics across all three script variants. The comments promise "default-on, then override per-command," but shipped config pre-populates per-event enabled: false, and parser logic intentionally treats any present event section as explicit override (so default is ignored). Confidence: high.
Proposed Remediation
Preferred: Align shipped config shape with current parser semantics and documented intent by removing per-event enabled keys from the default template (retain event message stanzas), so auto_commit.default genuinely controls all events unless users add explicit enabled overrides. This keeps parser logic stable across Bash/Python/PowerShell and makes behavior match the existing explanatory comment.
Alternatives:
Reword comments/docs to state that default only applies to events not explicitly listed; lower implementation risk but preserves surprising UX and weakens "enable globally then override" ergonomics.
Change parser semantics so default true can override explicit enabled: false unless an additional explicit "override" marker exists; higher complexity and cross-language parity risk.
Potentially tests under tests/extensions/git/ that validate template/config behavior
Tests to add or update:
Regression: with generated config containing messages but no per-event enabled, default: true should auto-commit for before_plan.
Regression: if a specific event has enabled: false, it must stay disabled even when default: true.
Cross-script parity test to ensure Bash/Python/PowerShell all honor the same precedence rules.
Risks & Considerations
Behavioral change for users relying on current template defaults could alter first-run auto-commit behavior if not documented clearly.
Any parser-semantic change must remain consistent across Bash, Python, and PowerShell to avoid platform drift.
Silent no-op behavior is currently hard to diagnose; consider improved observability/logging if behavior remains conditional.
Open Questions
[NEEDS CLARIFICATION: Should maintainers prefer changing template shape only, or changing parser semantics to make explicit enabled: false interact differently with default?]
[NEEDS CLARIFICATION: Should auto-commit scripts emit a debug/info message when skipped due to config disable to reduce user confusion?]
I'd like to work on this. One note on the assessment's preferred fix: removing the per-event enabled: keys from the template isn't enough on its own, because all three scripts fall back to default only when the event's section is missing entirely (auto-commit.sh L163-169, auto_commit.py L108-112, auto-commit.ps1 L160-166). A section that keeps only its message: still blocks the default.
Proposed fix: in all three scripts, fall back to default when the event has no enabled: key (an explicit enabled: false still wins), and drop the enabled: false lines from config-template.yml and git-config.yml so default: true works as the comment describes. I'd add regression tests for bash, Python and PowerShell, and can include Windows PowerShell 5.1 evidence. Does that work for you, or would you prefer the docs-only rewording?
AI disclosure: posted on behalf of @joshinitin2016883-sketch. Drafted with Claude Code (model: Claude Opus 5.5), human-supervised; the analysis comes from the agent reading the scripts on main, and the contributor reviewed this comment before posting.
Activity
github-actions commentedon Oct 21, 2026
Bug assessment — autocommit-default-ignored: Valid · severity medium
Bug Assessment: git extension
auto_commit.defaultignored when event keys existReport (summarized)
Issue author @stefanwalther reports that the git extension config comment says
auto_commit.defaultenables all commands unless overridden, but the shipped template also sets every event’senabled: false. In the implementation, default fallback is only applied when an event section is absent, so setting onlydefault: truedoes not enable listed events. The report includes a concrete reproduction usingbefore_planand shows that deleting thebefore_plan:block makes default apply.Symptom
When users set
auto_commit.default: truein the generated git config, auto-commit still does not run for standard events (for examplebefore_plan) because those events are explicitly present and disabled in the template. Expected behavior per comment wording is that default enables all commands unless an event is explicitly overridden.Reproduction
.specify/extensions/git/git-config.ymlis created from the shipped template.auto_commit.default: true.bash .specify/extensions/git/scripts/bash/auto-commit.sh before_plan.before_plan:section fromgit-config.ymland rerun step 3.Suspected Code Paths
extensions/git/config-template.yml:28-36— comment states default enables all commands, but template explicitly defines events withenabled: false, includingbefore_plan.extensions/git/scripts/bash/auto-commit.sh:163-168— default is applied only when event key is missing (if ! grep ... ${EVENT_NAME}:), so explicit event sections suppress default.extensions/git/scripts/python/auto_commit.py:108-111— same fallback logic: use default only when event section does not exist.extensions/git/scripts/powershell/auto-commit.ps1:160-164— same fallback behavior in PowerShell implementation.extensions/git/git-config.yml:28-36— installed/default config mirrors the contradictory template behavior users actually encounter.Root Cause Hypothesis
The defect is a configuration contract mismatch between documentation comments and parser semantics across all three script variants. The comments promise "default-on, then override per-command," but shipped config pre-populates per-event
enabled: false, and parser logic intentionally treats any present event section as explicit override (so default is ignored). Confidence: high.Proposed Remediation
Preferred: Align shipped config shape with current parser semantics and documented intent by removing per-event
enabledkeys from the default template (retain event message stanzas), soauto_commit.defaultgenuinely controls all events unless users add explicitenabledoverrides. This keeps parser logic stable across Bash/Python/PowerShell and makes behavior match the existing explanatory comment.Alternatives:
defaultonly applies to events not explicitly listed; lower implementation risk but preserves surprising UX and weakens "enable globally then override" ergonomics.truecan override explicitenabled: falseunless an additional explicit "override" marker exists; higher complexity and cross-language parity risk.Files likely to change:
extensions/git/config-template.ymlextensions/git/git-config.ymlextensions/git/README.md(example/behavior wording)tests/extensions/git/that validate template/config behaviorTests to add or update:
enabled,default: trueshould auto-commit forbefore_plan.enabled: false, it must stay disabled even whendefault: true.Risks & Considerations
Open Questions
enabled: falseinteract differently withdefault?]joshinitin2016883-sketch commentedon Oct 21, 2026
I'd like to work on this. One note on the assessment's preferred fix: removing the per-event
enabled:keys from the template isn't enough on its own, because all three scripts fall back todefaultonly when the event's section is missing entirely (auto-commit.shL163-169,auto_commit.pyL108-112,auto-commit.ps1L160-166). A section that keeps only itsmessage:still blocks the default.Proposed fix: in all three scripts, fall back to
defaultwhen the event has noenabled:key (an explicitenabled: falsestill wins), and drop theenabled: falselines fromconfig-template.ymlandgit-config.ymlsodefault: trueworks as the comment describes. I'd add regression tests for bash, Python and PowerShell, and can include Windows PowerShell 5.1 evidence. Does that work for you, or would you prefer the docs-only rewording?AI disclosure: posted on behalf of @joshinitin2016883-sketch. Drafted with Claude Code (model: Claude Opus 5.5), human-supervised; the analysis comes from the agent reading the scripts on
main, and the contributor reviewed this comment before posting.