I had saved this to comment on, but Peff beat me to it :-) On Wed, Jan 13, 2021 at 6:07 AM Jeff King <peff@xxxxxxxx> wrote: > There might be a solution using link() to have an atomic winner, but it > gets tricky around unlinking the old name out of the way. You definitely should be able to do this atomically with link(), but the cleanup is indeed messy, and there's already existing locking code, so it's probably better to press that into service here. Chris