You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(cli): keep the commit-session trailer dedup working on git 2.39 #940
cli/tests/contexts/telemetry/domain/formats/commit-session-trailer.integration.test.ts:72 ("never doubles a trailer a prior run already wrote") runs the trailer-writing delegate twice and asserts the trailer token appears once.
On git 2.39.2 the test fails with AssertionError: expected 2 to be 1: the fixture message has no trailing newline, so git appends the trailer without a blank-line separator; the second pass then sees no trailer block and --if-exists doNothing appends again. The same delegate on a message ending in a newline dedupes correctly.
Reproduction
git --version -> 2.39.2 (or any version sharing this behavior).
cd cli && npx vitest run tests/contexts/telemetry/domain/formats/commit-session-trailer.integration.test.ts -> fails alone, deterministic, also under env -i.
The same test passes on newer git (CI's).
Impact
The suite reports one failure per run on machines with this git, masking real regressions in the file and eroding trust in the suite's signal. The test and its source are byte-identical to next, so the failure predates any recent change.
Suggested fix
End the fixture message with a newline, or have the delegate normalize the message before appending.
Standalone repro verified on the machine that reported it: message without trailing newline doubles the trailer; message with one dedupes.
Confirmed on Git 2.39.5: running the delegate twice on a message without a trailing newline writes the trailer twice. Ensuring a non-empty message ends with a newline before calling git interpret-trailers produces one valid, parsed trailer. The fix should normalize that final newline, keep --if-exists doNothing, and cover repeated runs with and without a trailing newline.
Activity
docs: file mistral-support defects upstream and conclude the record
docs: file mistral-support defects upstream and conclude the record
docs: file mistral-support defects upstream and conclude the record
blafourcade commentedon Oct 6, 2026
Confirmed on Git 2.39.5: running the delegate twice on a message without a trailing newline writes the trailer twice. Ensuring a non-empty message ends with a newline before calling
git interpret-trailersproduces one valid, parsed trailer. The fix should normalize that final newline, keep--if-exists doNothing, and cover repeated runs with and without a trailing newline.blafourcade commentedon Oct 15, 2026
Superseded by #993: the commit-session trailer was removed with the old journal.