# The provenance ledgers are append-only JSONL: every contributor's PR adds rows at
# the end, so two PRs in flight always "conflict" on the final line even though the
# right resolution is simply to keep both sets of rows. `merge=union` makes git take
# both sides' lines instead of raising a conflict, which is exactly correct for an
# append-only log and stops concurrent match PRs from blocking each other.
#
# Order within the file stops being meaningful under union merge, but nothing depends
# on it: both stores are keyed by id and read into a dict (last write wins), and the
# CI stamper dedupes by content before appending. A duplicate row from two sides
# stamping the same landing is harmless.
config/match_provenance.jsonl merge=union
config/match_attempts.jsonl   merge=union

# nearmiss/db.jsonl is union-merged too, so concurrent match PRs stop conflicting on it.
# Union keeps both sides' lines instead of raising a conflict.
#
# It is one row per function keyed by (module, addr), so a union of two edits to the same
# function leaves two rows for it with different divergence counts. That is cleaned
# automatically: the update-chaos-data workflow runs `nearmiss_db.py dedupe` on every push
# to main, collapsing duplicate keys to the LOWEST divergence (a merge never regresses a
# tip). The duplicate rows are transient - present only between a merge and the next CI
# refresh - and load_db()/save_db() already key by (module, addr), so nothing that reads
# the DB is confused by them in the meantime.
nearmiss/db.jsonl merge=union

# Same shape again: tools/tiers_ratchet.py appends one row per file that left the
# CONVERTED set, with the reason the byte match required it. Append-only, keyed by
# path, read by humans -- a union of two sides is the right LOCAL merge resolution.
#
# NOTE: this driver only runs on a local `git merge`. GitHub's own merge (what actually
# lands a PR) does not honor merge=union and will still show a real conflict the instant
# two PRs touch this file's tail concurrently -- land PRs that append here one at a time,
# same as the other union-merged ledgers above.
config/converted-backslide-exceptions.jsonl merge=union

# A patch file must keep LF endings: core.autocrlf=true would give the working copy
# CRLF, and `git apply` of a CRLF patch against LF sources fails every hunk.
*.patch -text

# The TU manifest is written by tools/tu_manifest.py with newline="\n" and read back
# byte-for-byte: TrackedManifestTests.test_rewriting_the_tracked_manifest_is_a_no_op
# asserts that re-saving what was just loaded rewrites nothing. Under core.autocrlf=true
# a checkout hands the working copy CRLF while tu_manifest.save writes LF, so every entry
# file looks rewritten -- the test fails on any Windows clone, and a tubuild run that
# saves the manifest shows a whole-tree diff on entries it never touched. Observed after
# #1724-#1737: 13 entry files arrived through git's checkout filter (CRLF in the worktree)
# while 60 were written directly by tu_manifest.save (LF). Every committed blob was LF;
# only the working copy diverged. Pin the endings so the two writers agree.
config/tu_manifest.d/**/*.json text eol=lf
