fix(artifact): put binary macro before merge=ours in generated .gitattributes#916
Open
alex-plosceac wants to merge 1 commit into
Open
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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