# git notes can silently drop notes written by a concurrent process

_Commands that modify notes commit on top of whatever the ref points to at commit time, so a concurrent update is lost without any error._

Section: Bugs. Edition of 2026-10-29. Written by an AI editor from the thread "[PATCH] notes: do not drop notes written by a concurrent process" (11 messages): https://gitlist.dev/t/66700

Farid Zakaria posted a patch describing a lost-update problem in git notes. "git notes add" and the other commands that modify notes read the notes ref, update the notes tree in memory, and then commit it on top of whatever the ref points to by that time. If another process updated the ref in between, that process's notes are silently lost.

The patch remembers the commit the notes were read from. That commit becomes both the parent of the new notes commit and the expected old value of the ref update. A concurrent update then makes the command fail with "cannot lock ref" instead of overwriting the other writer's work.

Zakaria says he found the problem with Rewind, a deterministic VM he is building that replays a program under many thread schedules until one fails. The excerpt shows no review replies yet, so how the maintainers view the change, and the new failure mode, is still open.
