fix(artifact): put binary macro before merge=ours in generated .gitattributes#916
Conversation
…tributes
gitattributes apply left to right and the binary macro expands to
-diff -merge -text, so the generated line
graph.db.zst merge=ours binary
leaves the merge attribute UNSET (git check-attr merge reports
"unset"), and concurrent artifact refreshes produce a binary merge
conflict instead of auto-resolving -- the exact failure this file is
generated to prevent. Reordering to
graph.db.zst binary merge=ours
makes check-attr report merge: ours while keeping -diff/-text intact.
Verified on a real repository: before the reorder git check-attr merge
-- .codebase-memory/graph.db.zst printed "unset"; after, "ours".
Extends artifact_gitattributes_created to pin the ordering so the
regression cannot return.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Alex <plosceac.alexandre@gmail.com>
|
Thanks for the focused artifact attributes fix. Triage: artifact workflow bug, normal priority. Review should confirm the generated attributes order does what the comment promises across Git versions and that no other artifact file behavior changes. The git check-attr proof is exactly the right evidence to include. |
|
Verified and correct — gitattributes apply left to right, the One gap to consider (fine as a follow-up if you prefer): |
|
Merged as-is — thank you! The self-heal for already-generated files is tracked as a follow-up; feel free to pick it up if you fancy it, otherwise we'll get to it. Great catch on the macro ordering. |
What does this PR do?
Fixes the attribute ordering in the auto-generated
.codebase-memory/.gitattributesso themerge=oursconflict prevention it exists for actually engages.The writer currently emits:
gitattributes apply left to right, and the
binarymacro expands to-diff -merge -text, so the trailing macro unsets themerge=oursthat precedes it:Concurrent artifact refreshes on two branches therefore hit a binary merge conflict instead of auto-resolving — the exact failure the generated file's own comment says it prevents. Reordering to
graph.db.zst binary merge=oursfixes it:-diffand-textfrom the macro remain in effect.How this was found: while investigating the v0.8.1 layout memory blow-up on a 155k-node repository (17.6GB peak RSS for a 50k-node layout; full evidence, lldb SIGKILL capture, and measurements confirming
mainis fixed are in #917), we committed the graph artifact for team bootstrap and noticedcheck-attrreportingmerge: unseton the freshly generated file.Verification, reproduce-first: extended
artifact_gitattributes_createdto pin the ordering (asserts the fixed order present, broken order absent). It fails on unmodifiedmain(5914 passed / 1 failed) and passes with this change (5915 / 0, ASan+UBSan build).Scope notes:
O_EXCL), so existing repos keep their old file; affected users need a one-line manual edit. Happy to add a fix-up pass if preferred.merge=oursneedsmerge.ours.driver=truein the clone's git config; the tool sets it where it runs, but teammates' fresh clones won't have it and degrade to a normal conflict. Possibly worth a docs note (out of scope here).Checklist
git commit -s) — required, CI rejectsunsigned commits (DCO, see CONTRIBUTING.md)
make -f Makefile.cbm test) — 5915 passed, 0 failed, 1 skippedmake -f Makefile.cbm lint-ci) — cppcheck, clang-format, NOLINT whitelist all greenartifact_gitattributes_createdextended; RED on main, GREEN with fix