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

Re: Strange unable to unlink error with git-prune-packed

From
Linus Torvalds <torvalds@osdl.org>
Date
Jan 4, 2006, 16:34 UTC
Message-ID
<Pine.LNX.4.64.0601040828590.3668@g5.osdl.org>
In-Reply-To
<46a038f90601032046l31f51742k93f3f9f5a826bef1@mail.gmail.com>
On Wed, 4 Jan 2006, Martin Langhoff wrote:
Show 6 quoted lines
> 
> When I invoke git-prune-packed I am greeted by (3-line sample):
> 
> error: unable to unlink .git/objects/43/2251e8488dc3c72d94d698ed69003137c47244
> error: unable to unlink .git/objects/43/6bc8b274ab96944a6f8c3cf5e3fbeef422042b
> error: unable to unlink .git/objects/43/fe47e9508289ad4eca71613a9f20d7f3323602

Does it happen for all your files? All your repositories? Or just one repo? Or just one subdirectory in that repo?

The code is _literally_ just doing a
	if (unlink(pathname) < 0)
		error("unable to unlink %s", pathname);

but maybe you could just make it print out the reason too. So add a "(%s)" and a "strerror(errno)" to that error line..

> $ ls -la .git/objects/43
> total 24
> drwxr-xr-x    5 martin  martin   170  4 Jan 17:37 .

I don't see why you couldn't unlink those files. Maybe it's some strange HFS issue and you can't just unlink() things that have attributes or something? Maybe some crazy file manager has added a default icon attribute to your files if you happened to look at the .git objects directory?

		Linus
Previous: Martin LanghoffNext: Martin Langhoff
Message 2 of 3 in “Strange unable to unlink error with git-prune-packed”
  1. Martin LanghoffJan 4, 2006
  2. Linus TorvaldsJan 4, 2006
  3. Martin LanghoffJan 4, 2006

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.