home / github / mergiraf

Mergiraf

Syntax-aware merge driver for resolving Git conflicts structurally across supported code and config formats.

$cargo install --locked mergiraf
Language
Rust
Stars
46
Category
GitHub & Git
Agent
AI Analysis

Mergiraf is a syntax-aware merge driver for resolving version-control conflicts in supported code and data files. It is designed to plug into Git directly and is also documented for Jujutsu workflows through jj resolve --tool mergiraf.

What It Enables
  • Register as a Git merge driver so merges, rebases, cherry-picks, and reverts can auto-resolve supported files structurally instead of falling back immediately to plain text conflicts.
  • Run mergiraf solve on an already conflicted file to rewrite it with fewer or narrower conflict markers, or print the attempted resolution to stdout.
  • List supported languages, compare Mergiraf's result against a line-based merge with review, and package a failing merge into a reproducible zip via report.
Agent Fit
  • Commands operate on explicit files, return meaningful exit codes, and can run non-interactively inside merge, rebase, or CI workflows.
  • The automation surface is narrow and text-first: there is no JSON output, no remote repository inspection, and most outputs are rewritten files, diffs, or logs.
  • Best used as a focused primitive inside Git or Jujutsu conflict-resolution flows rather than as a general replacement for tools like git or jj.
Caveats
  • Best results depend on supported languages and diff3 conflict style; unknown or unparsable files fall back to line-based merging.
  • Jujutsu users should invoke it through jj resolve --tool mergiraf; mergiraf solve does not understand Jujutsu's native conflict marker format.