git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 6, 2026, 19:31 UTC
Message-ID
<xmqqecmxekjd.fsf@gitster.g>
In-Reply-To
<aYYWfb1E6EHxEyQQ@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 37 quoted lines
> On Thu, Jan 22, 2026 at 07:23:35PM +0000, Paulo Casaretto via GitGitGadget wrote:
>> diff --git a/t/t0031-lockfile-pid.sh b/t/t0031-lockfile-pid.sh
>> new file mode 100755
>> index 0000000000..8ef87addf5
>> --- /dev/null
>> +++ b/t/t0031-lockfile-pid.sh
>> @@ -0,0 +1,105 @@
>> +#!/bin/sh
>> +
>> +test_description='lock file PID info tests
>> +
>> +Tests for PID info file alongside lock files.
>> +The feature is opt-in via core.lockfilePid config setting (boolean).
>> +'
>> +
>> +. ./test-lib.sh
>> +
>> +test_expect_success 'stale lock detected when PID is not running' '
>> +	git init repo &&
>> +	(
>> +		cd repo &&
>> +		touch .git/index.lock &&
>> +		printf "pid 99999" >.git/index~pid.lock &&
>> +		test_must_fail git -c core.lockfilePid=true add . 2>err &&
>> +		test_grep "process 99999, which is no longer running" err &&
>> +		test_grep "appears to be stale" err
>> +	)
>> +'
>> +
>> +test_expect_success 'PID info not shown by default' '
>> +	git init repo2 &&
>
> Nit, not really worth addressing on its own: you could avoid the
> numbering if you used `test_when_finished rm -rf repo`.
>
> Other than that I don't have any complaints from the ref side anymore,
> and the code seems sensible to me. Thanks!
Thanks, both.
Previous: Patrick Steinhardt
Message 36 of 36 in “lockfile: add PID file for debugging stale locks”
  1. lockfile: add PID file for debugging stale locksPaulo Casaretto via GitGitGadget, Dec 2, 2025
  2. D. Ben KnobleDec 2, 2025
  3. Torsten BögershausenDec 3, 2025
  4. Jeff KingDec 3, 2025
  5. Junio C HamanoDec 3, 2025
  6. Jeff KingDec 3, 2025
  7. Taylor BlauDec 3, 2025
  8. Patrick SteinhardtDec 5, 2025
  9. Jeff KingDec 5, 2025
  10. Taylor BlauDec 3, 2025
  11. lockfile: add PID file for debugging stale locksPaulo Casaretto via GitGitGadget, Dec 17, 2025
  12. Junio C HamanoDec 18, 2025
  13. Junio C HamanoDec 18, 2025
  14. Junio C HamanoDec 18, 2025
  15. Ben KnobleDec 18, 2025
  16. Patrick SteinhardtDec 18, 2025
  17. lockfile: add PID file for debugging stale locksPaulo Casaretto via GitGitGadget, Dec 24, 2025
  18. Junio C HamanoDec 25, 2025
  19. Jeff KingDec 27, 2025
  20. Patrick SteinhardtJan 5, 2026
  21. lockfile: add PID file for debugging stale locksPaulo Casaretto via GitGitGadget, Jan 7, 2026
  22. Junio C HamanoJan 8, 2026
  23. D. Ben KnobleJan 8, 2026
  24. lockfile: add PID file for debugging stale locksPaulo Casaretto via GitGitGadget, Jan 20, 2026
  25. Junio C HamanoJan 20, 2026
  26. Jeff KingJan 21, 2026
  27. Eric SunshineJan 21, 2026
  28. Johannes SixtJan 21, 2026
  29. Jeff KingJan 21, 2026
  30. Junio C HamanoJan 21, 2026
  31. Jeff KingJan 21, 2026
  32. Junio C HamanoJan 21, 2026
  33. lockfile: add PID file for debugging stale locksPaulo Casaretto via GitGitGadget, Jan 22, 2026
  34. Junio C HamanoJan 22, 2026
  35. Patrick SteinhardtFeb 6, 2026
  36. Junio C HamanoFeb 6, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.