Skip to content

fix(config): omit empty [commit] header when only generation is set#879

Merged
max-sixty merged 2 commits intomainfrom
commit
Jan 27, 2026
Merged

fix(config): omit empty [commit] header when only generation is set#879
max-sixty merged 2 commits intomainfrom
commit

Conversation

@max-sixty
Copy link
Owner

Summary

  • When saving commit config with only [commit.generation] (no stage), the TOML output now renders cleanly without a redundant [commit] header
  • The fix marks the [commit] table as implicit when it contains only subtables

Before:

[commit]

[commit.generation]
command = "..."

After:

[commit.generation]
command = "..."

Test plan

  • Added test verifying [commit] is omitted when only generation is set
  • Added test verifying [commit] is present when both stage and generation are set
  • Updated snapshot for set_commit_generation_command_saves_to_disk
  • All existing tests pass

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits January 26, 2026 17:04
When saving commit config with only [commit.generation] (no stage),
the TOML output now correctly renders as:

```toml
[commit.generation]
command = "..."
```

Instead of the redundant:

```toml
[commit]

[commit.generation]
command = "..."
```

The fix marks the [commit] table as implicit when it contains only
subtables (no direct key-value pairs like stage).

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty merged commit c9a3db1 into main Jan 27, 2026
20 of 21 checks passed
@max-sixty max-sixty deleted the commit branch January 27, 2026 01:40
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.

1 participant