Skip to content

feat(cli): cli-3.44.0 — install-merge-driver, and correct what skipping it costs - #414

Merged
montfort merged 1 commit into
mainfrom
feat/merge-driver-setup
Aug 7, 2026
Merged

feat(cli): cli-3.44.0 — install-merge-driver, and correct what skipping it costs#414
montfort merged 1 commit into
mainfrom
feat/merge-driver-setup

Conversation

@montfort

@montfort montfort commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Closes FU-001.

What the premise check found

The registry merge driver shipped in cli-3.41.0 to close #391 — reported from Sentinel with concrete evidence: three closures silently reverted while merging three parallel PRs of one Charter.

Before building, I checked whether the fix was in use. It was inert everywhere:

Installation Registry entries .gitattributes git config
Sentinel (filed #391) 296 absent absent
LNXDrive 19 absent absent
straymark (self-adoption) 4 absent absent

The global CLI was already 3.41.0, so the driver was available in all three.

Stated up front and unchanged by this PR: that is not evidence of setup friction — the driver was ~16 hours old, and 16 hours of non-adoption proves nothing. The build proceeded on your call, and AILOG-2026-08-06-001 R2 records it that way rather than retro-justifying it.

What the data did support was a different framing: the fix was not reaching the adopter who asked for it, because a two-command step had not been run. That is what made a standalone command necessary — FU-001 proposed an init prompt, but init refuses to run on an existing installation, so a flag alone would have helped nobody who has already adopted.

Changes

  • straymark followups install-merge-driver [--path .] — writes both halves, idempotently. An existing binding (even to a different driver) and a merge.straymark-followups.driver pointing elsewhere are left untouched and reported: silently overwriting a deliberate override is not the tool's call.
  • straymark init --merge-driver / --no-merge-driver, plus a prompt when neither is given — gated on stdin.is_terminal() and on the target being a git repo. init runs in CI and provisioning scripts, where a blocking prompt is a hang. Mirrors the --hooks precedent (principle fix: consistent fw-/cli- version display across all commands #6).
  • Dogfooded here, with the clone step added to CONTRIBUTING.md.

A correction to my own work

I had written — in the module doc and in the .gitattributes block the command generates — that without the git-config half the attribute line is "inert" and git "silently falls back to a normal conflict".

Both are wrong. An A/B merge on a seeded registry (same two branches with diverging counters, driver configured in one clone and unset in the other):

Result
Driver wired merge succeeds, all closures survive, counters consistent
Driver missing fatal: custom merge driver straymark-followups lacks command line — merge aborts

The committable half does not just fail to help; it breaks merges for anyone who has not run the setup. Corrected in the module doc, the generated .gitattributes comment, the command output, and CLI-REFERENCE (EN/es/zh-CN). It also sharpens FU-001's case: forgetting the step is a hard stop, not friction.

Verified

  • cargo test: 958 passed, 0 failed.
  • 5 new tests: both halves written; idempotent (a second run adds no duplicate line — load-bearing, since the init prompt can be accepted more than once); an existing .gitattributes survives including its last line when the file has no trailing newline; a foreign driver is preserved and reported; refuses outside a git repo; init exposes both flags.
  • End to end in anger, the only test that proves the wiring does anything: two branches closing different entries so the CLI-owned counters diverge and conflict. Clean merge, all closures intact.

Known consequence

Committing .gitattributes here means a contributor who merges a branch touching the registry hits that fatal until they run the command. Mitigated where they will look — a numbered step in CONTRIBUTING.md § Setup Steps, and the failure mode spelled out inside .gitattributes itself. The alternative, not committing the binding, means the driver never works for anyone, which is the state this PR exists to leave.

Left open: wiring Sentinel and LNXDrive. Sentinel is the adopter that filed #391 and the only installation with the registry volume to hit the conflict routinely — until then the fix stays unexercised where it was needed. Recorded as a follow-up.

🤖 Generated with Claude Code

…ng it costs

Closes FU-001. The registry merge driver shipped in cli-3.41.0 to close #391,
but taking effect needs two per-clone edits, and checking before building found
the fix inert in every installation — Sentinel (296 entries, the adopter that
filed #391), LNXDrive, and this repo.

That reframed the ask. FU-001 proposed an `init` prompt, but `init` cannot run
on an existing installation, so a flag alone would have helped nobody who
already adopted. Hence a standalone command as well:

- `straymark followups install-merge-driver [--path .]` — writes both halves,
  idempotently. An existing binding or a differently-configured driver is left
  untouched and reported; overwriting a deliberate override silently is not
  ours to do.
- `straymark init --merge-driver` / `--no-merge-driver`, plus a prompt when
  neither is given. Gated on stdin being a TTY: init runs in CI and
  provisioning scripts, where a blocking prompt is a hang. Mirrors --hooks.

Verifying it corrected something I had written into the code an hour earlier.
I claimed that without the git-config half the .gitattributes line is "inert"
and git "silently falls back to a normal conflict". Both wrong. An A/B merge on
a seeded registry — same two branches, driver set in one clone and unset in the
other — gives a clean merge with all closures intact in the first, and

    fatal: custom merge driver straymark-followups lacks command line

in the second. The committable half BREAKS merges for anyone who has not run
the setup. Corrected in the module doc, the generated .gitattributes comment,
the command output and CLI-REFERENCE (en/es/zh-CN) — and it strengthens the
case FU-001 made, since forgetting the step is a hard stop rather than friction.

Dogfooded here, with the required clone step added to CONTRIBUTING.md, because
committing the binding means contributors hit that fatal until they run it.

Recorded honestly in AILOG-2026-08-06-001 R2: the premise behind FU-001 ("manual
setup causes friction") was never verified — the driver was 16 hours old and
non-adoption proved nothing. Built on the operator's call over a stated
recommendation to dogfood first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

followups: the registry is a guaranteed conflict between parallel PRs, and the correct resolution silently reverts closures

1 participant