* Strange unable to unlink error with git-prune-packed
@ 2006-01-04 4:46 Martin Langhoff
2006-01-04 16:34 ` Linus Torvalds
0 siblings, 1 reply; 3+ messages in thread
From: Martin Langhoff @ 2006-01-04 4:46 UTC (permalink / raw)
To: Git Mailing List
Weilding a recent git version 1.0.6-g58e3 it turns out I cannot run
git-prune-packed on a simple repo on my OSX (Panther 10.3.9). The
local repo looks fine in my eyes, and permissions are similar to those
on Linux. Relaxing permissions doesn't help either, so there may be
something else afoot.
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
File modes after I ran chmod -R u+w .git/objects to see if
prune-packed was taking the mode too seriously on OSX
$ ls -la .git/objects/43
total 24
drwxr-xr-x 5 martin martin 170 4 Jan 17:37 .
drwxr-xr-x 229 martin martin 7786 4 Jan 17:37 ..
-rw-r--r-- 1 martin martin 211 30 Dec 11:21
2251e8488dc3c72d94d698ed69003137c47244
-rw-r--r-- 1 martin martin 53 30 Dec 11:21
6bc8b274ab96944a6f8c3cf5e3fbeef422042b
-rw-r--r-- 1 martin martin 152 30 Dec 11:21
fe47e9508289ad4eca71613a9f20d7f3323602
This is low priority for me, and so weird that it has to be a pilot
error -- OTOH I may do a bisect to try and figure out whether it's a
recent change...
cheers,
martin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Strange unable to unlink error with git-prune-packed
2006-01-04 4:46 Strange unable to unlink error with git-prune-packed Martin Langhoff
@ 2006-01-04 16:34 ` Linus Torvalds
2006-01-04 22:10 ` Martin Langhoff
0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2006-01-04 16:34 UTC (permalink / raw)
To: Martin Langhoff; +Cc: Git Mailing List
On Wed, 4 Jan 2006, Martin Langhoff wrote:
>
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Strange unable to unlink error with git-prune-packed
2006-01-04 16:34 ` Linus Torvalds
@ 2006-01-04 22:10 ` Martin Langhoff
0 siblings, 0 replies; 3+ messages in thread
From: Martin Langhoff @ 2006-01-04 22:10 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Git Mailing List
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
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-01-04 22:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-04 4:46 Strange unable to unlink error with git-prune-packed Martin Langhoff
2006-01-04 16:34 ` Linus Torvalds
2006-01-04 22:10 ` Martin Langhoff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).