Expand description
Git merge driver for spec files.
This module implements a custom merge driver for .chant/specs/*.md files
that intelligently resolves frontmatter conflicts while preserving body content.
§Problem
When merging spec branches back to main, frontmatter conflicts occur because:
- Main has
status: completed(from finalize) - Feature branch has
status: in_progress - Main may have
completed_atandmodelfields - Feature branch may not have these fields yet
§Solution
This merge driver:
- Parses frontmatter from base, ours, and theirs versions
- Intelligently merges frontmatter fields
- Uses standard 3-way merge for body content
- Produces a clean merge result or marks conflicts
§Git Configuration
To use this merge driver, add to .gitattributes:
.chant/specs/*.md merge=chant-specThen configure git:
git config merge.chant-spec.name "Chant spec merge driver"
git config merge.chant-spec.driver "chant merge-driver %O %A %B"§Doc Audit
- audited: 2026-01-27
- docs: guides/recovery.md
- ignore: false
Structs§
- Merge
Driver Setup Result - Result of setting up the merge driver
- Parsed
Spec - Result of parsing a spec file into frontmatter and body
Functions§
- assemble_
spec - Assemble a spec file from frontmatter and body
- get_
setup_ instructions - Generate git configuration instructions for the merge driver
- merge_
body - Merge body content using git’s 3-way merge
- merge_
frontmatter - Merge frontmatter from base, ours, and theirs
- parse_
spec_ file - Parse a spec file into frontmatter and body components
- run_
merge_ driver - Run the merge driver
- serialize_
frontmatter - Serialize frontmatter back to YAML string
- setup_
merge_ driver - Set up the merge driver for the current repository