Expand description
§aura-merge
Structured 3-way merge engine that picks the right strategy per file type:
- Code files — scaffold extraction (the non-function portions) plus function-level merge primitives.
- JSON / YAML / TOML — key-level deep merge with conflict reporting.
- Text / Markdown — line-level 3-way merge.
- Everything else — file-level hash compare as a safe fallback.
Pure stdlib, no external dependencies.
Originally extracted from Aura, the semantic version control engine.
Structs§
Enums§
Functions§
- apply_
scaffold - Re-insert function bodies into a scaffold.
- detect_
file_ type - extract_
scaffold - Extract the “scaffold” of a code file — everything OUTSIDE function bodies. Returns the scaffold text with function bodies replaced by placeholders.
- merge_
env - Merge .env files by key. Same key with different values = conflict.
- merge_
file - Merge any two file versions based on file type.
- merge_
json - Merge two JSON values. base = common ancestor (if known), local = ours, remote = theirs. If no base, treat it as a 2-way merge (conflicts when same key differs).
- merge_
text - 3-way line-level merge for text files (markdown, CSS, HTML, plain text). If no base, falls back to 2-way merge.