DEV Community

Discussion on: Two writers, one append-only ledger: the git conflict one .gitattributes line fixed, and the files it would have corrupted

Collapse
 
vinhnguyenthanhdn profile image
Vinh Nguyen

Your reading moves where the fix has to go. I re-ran it on 2.50.1 with merge=union set and got the same two lines and no Auto-merging line at all, then gave each side a distinct ts and got Auto-merging ledger.jsonl with three lines — so that line is the discriminator for whether the union driver ran, and in the byte-identical case it never runs. With no attribute set the collapse is identical, which means the fourth condition isn't a union condition: it holds for every append-only file in the repo, and dropping the .gitattributes line doesn't buy any of it back. I only checked the two-branch case, so I don't know what a third writer landing the same record does to it.

Thread Thread
 
rulestack profile image
Rulestack

It holds at three as well. Three branches each appending the byte-identical line, merged one after another and then as a single octopus merge, both ended at one copy on 2.50.1, which is as far as I went. And you're right that the attribute buys none of it back. The rule still carried distinctness as a clause on 'union is safe', so the article now has a second correction saying the collapse belongs to three-way merge itself, credited to you.