Listed Twice, Four Lines Apart

Written later and filed to this date, as part of filling in every day of the year.

The instruction file at the top of my game’s repository, the one a model is handed before it edits anything, draws the game’s scenes as a tree. After one Wednesday in March the tree listed the achievements scene and the codex scene twice each, four lines apart, with different descriptions: “achievements & milestones” above, “achievement viewer” below; “discovered weapons/enemies/upgrades” above, “encyclopedia/bestiary” below. Further down, two sections headed Storage System follow each other directly, and an Achievements System and a Codex System sit a page above a section called Achievement & Codex Systems. Nobody wrote the file that way. Two authors did, if a checkout counts as an author.

The week

On the Sunday, a session in the browser wrote ninety-five lines of documentation into that file and opened a pull request. The same evening another session implemented a to-do, tracking the damage a run deals, across three files. On the Monday a third wired a recorder that had never been called. Three pull requests, each merged on the hosting side with a click, so the repository’s main line moved three times without any checkout having to be told.

On the Wednesday evening a commit arrived from a checkout on another machine. Its subject is “polish”, one word, no body: thirty-three files, two thousand four hundred lines in, six hundred and fifty-nine out. A grid background rewritten, eight hundred and twenty-one lines of it; a new scene-transition module; a depth-layer table; a neon palette; every one of the fourteen weapon files. Its parent is the February commit. That checkout had not pulled since the ninth of February, had seen none of the week’s three pull requests, and had been handed the same to-do list.

Three and a half minutes later, the merge, under the message git writes when a pull finds two histories. Five files needed a hand: the instruction file, the collision system, the status-effect system, the game scene, the weapon manager.

What collided

The damage counter, first. The polish commit had implemented it too, on its own: the same accumulator, reset at the same line, fed from the same four sources, replacing the same three TODO comments, under its own names. setEnemyDamageCallback on one side, setCollisionDamageDealtCallback on the other. Same work, different words, done three days apart on one machine and five weeks apart on the other. The merge kept the pull request’s names and the recorder; the polish commit’s spelling survives nowhere.

Then the documentation. The Sunday session had documented six systems it found undocumented, achievements, codex and storage among them, and had added the two new scenes to the tree. The polish commit, on the other machine, had documented the same scenes in the same tree, and storage, and the achievement and codex managers, and the spatial hash, and the UI managers. Where both sides changed the same lines, git stopped and the merge chose. Where both sides added lines in the same neighbourhood, git did not stop, because there was nothing to choose between: two additions are both kept. So the tree gained each scene a second time, and the file gained its second Storage System directly under its first.

Why nothing complained

Nothing fails on a duplicated paragraph. There were no tests in the repository to fail; a build does not read prose; a merge tool interrupts for a conflict and never for a repeat, which is the whole point of a merge tool. The file that holds the duplicates is read by models, which do not complain about redundancy either. They read both descriptions of the codex scene and carry on.

The turn is that a stale checkout is not a stale copy. It is a second author, with the same backlog and the same instruction file, who has been working from a different starting point for five weeks, and whose work is exactly the kind that merges clean: additions. One day behind, the merge would have been trivial. Five weeks behind with nothing done, it would have been a fast-forward. Five weeks behind with the same to-do list is the one case where everything lands twice and nothing says so.

The merged tree lists both scenes twice, four lines apart. One line says encyclopedia; the other says discovered.


← all writing