Justin Tobler sent a three-patch series responding to a bug report. A git-receive-pack process was deleting ".keep" lockfiles of the same name that belonged to another concurrent receive-pack receiving an identical packfile. Once the lockfile is gone, the other process's newly written packfile is exposed to deletion by a concurrent housekeeping process.

Tobler traces the root cause to how the temporary ".keep" lockfiles are created. They are generated and registered in the object quarantine before they are written to the primary object database. Even if the ODB transaction never commits and exits early, the tempfile atexit(3) handler still runs and tries to delete the lockfile at its final location.

The current design has a second downside. If migrating the lockfile at commit fails because another process already holds the same lock, the rest of the transaction can still be migrated into the primary ODB. That leaves new objects in the primary ODB even though no references were updated and the operation failed.

The series prepares for deferring lockfile creation until transaction commit. One patch changes the "files" backend's pack-writing path, which currently relies on git-index-pack's --keep option. Another extracts the parsing of index-pack's stdout report ("pack" or "keep" plus the hex name) out of index_pack_lockfile() into a new read_index_pack_report(). The transaction can then read the packfile name without eagerly creating a ".keep" file.

The thread so far contains only the cover letter and the three patches. No reviewer has commented.