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

"git gc" leaving gc.pid files around

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Sep 25, 2013, 18:29 UTC
Message-ID
<vpqzjr0rbz5.fsf@anie.imag.fr>
Hi,

Since 64a99eb47, "git gc" creates a lock file gc.pid while running. I just noticed that the file is never deleted. The locking mechanism works, but leaving these files around creates a minor annoyance.

For example, I run "git gc" in all my repos from time to time (in a cron job). It normally does nothing in repos that have not changed, but now, it updates the gc.pid file.

As a result, all the gc.pid files show up in unison (synchronization tool between machines) for example.

Is there any reason not to do something like this:
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -316,5 +316,6 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
                warning(_("There are too many unreachable loose objects; "
                        "run 'git prune' to remove them."));
 
+       unlink(git_path("gc.pid"));
        return 0;
 }

?
-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Next: Duy Nguyen
Message 1 of 2 in “"git gc" leaving gc.pid files around”
  1. Matthieu MoySep 25, 2013
  2. Duy NguyenSep 25, 2013

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.