Subject: Re: [PATCH] lockfile: add PID file for debugging stale locks

From: Junio C Hamano <[email-masked]>
Date: Wed, 03 Dec 2025 14:21:11 -0800

Jeff King <[email-masked]> writes:

> So I dunno what that means for your patch. I notice that the user has to
> enable the feature manually. But it feels more like it should be
> selective based on which subsystem is using the lockfile (so refs would
> never want it, but other lockfiles/tempfiles might).

Or perhaps the way to opt into the feature is to create an empty
file $GIT_DIR/lockfile-audit, and the lockfile subsystem will append
to it every time a lock is taken?  We need to ensure that a PID and
pathname formatted into a single record is small enough and O_APPEND
would relieve us from worrying about multi writer races, which may
introduce different kind of complications, though.