Re: Strange unable to unlink error with git-prune-packed
From: Martin Langhoff <hidden>
Date: 2016-06-15 22:42:15
On 1/5/06, Linus Torvalds [off-list ref] 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
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.
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