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

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

From
Martin Langhoff <martin.langhoff@gmail.com>
Date
Jan 4, 2006, 22:10 UTC
Message-ID
<46a038f90601041410m7628adfdr3ec81015d80d0f8e@mail.gmail.com>
In-Reply-To
<Pine.LNX.4.64.0601040828590.3668@g5.osdl.org>
On 1/5/06, Linus Torvalds <torvalds@osdl.org> wrote:
> Does it happen for all your files? All your repositories? Or just one
> repo?

Good questions -- should have sorted those basic things out before posting. Apologies. In any case, I haven't seen that before, but I don't run git-prune-packed that often on the OSX commandline. My main dev host is a linux machine, and I have a weekly cron that does repack and prune packed on all my repos.

> Or just one subdirectory in that repo?
It refused to unlink _any_ files within .git/objects
Show 7 quoted lines
> 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..

This morning, after a reboot, I patched prune-packed.c as suggested and ran it... and it all worked.

Initially I suspected the files were locked somehow, but I just did a new clone && git-repack && git-prune-packed and it just worked... Grrr.

Show 5 quoted lines
> 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?

It is indeed HFS but I'm pretty sure things should be transparent to the unix side of things. In any case, the (crazy filemanager) Finder wasn't involved, as this is a newish repo, I haven't looked at any directory around it with Finder, and it's known to leave hidden files all over the place.

In any case, I've got my git-prune-packed patched now, and will be trying to repro the bug.

cheers,
martin
Previous: Linus Torvalds
Message 3 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.