{"thread":{"id":"2962","subject":"Strange unable to unlink error with git-prune-packed","startedAt":"2006-01-04T04:46:26Z","lastAt":"2006-01-04T22:10:20Z","messageCount":3,"participants":["Martin Langhoff","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"14159","messageId":"46a038f90601032046l31f51742k93f3f9f5a826bef1@mail.gmail.com","threadId":"2962","inReplyTo":null,"subject":"Strange unable to unlink error with git-prune-packed","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-01-04T04:46:26Z","receivedAt":"2006-01-04T04:46:26Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"Weilding a recent git version 1.0.6-g58e3 it turns out I cannot run\ngit-prune-packed on a simple repo on my OSX (Panther 10.3.9). The\nlocal repo looks fine in my eyes, and permissions are similar to those\non Linux. Relaxing permissions doesn't help either, so there may be\nsomething else afoot.\n\nWhen I invoke git-prune-packed I am greeted by (3-line sample):\n\nerror: unable to unlink .git/objects/43/2251e8488dc3c72d94d698ed69003137c47244\nerror: unable to unlink .git/objects/43/6bc8b274ab96944a6f8c3cf5e3fbeef422042b\nerror: unable to unlink .git/objects/43/fe47e9508289ad4eca71613a9f20d7f3323602\n\nFile modes after I ran chmod -R u+w .git/objects to see if\nprune-packed was taking the mode too seriously on OSX\n\n$ ls -la .git/objects/43\ntotal 24\ndrwxr-xr-x    5 martin  martin   170  4 Jan 17:37 .\ndrwxr-xr-x  229 martin  martin  7786  4 Jan 17:37 ..\n-rw-r--r--    1 martin  martin   211 30 Dec 11:21\n2251e8488dc3c72d94d698ed69003137c47244\n-rw-r--r--    1 martin  martin    53 30 Dec 11:21\n6bc8b274ab96944a6f8c3cf5e3fbeef422042b\n-rw-r--r--    1 martin  martin   152 30 Dec 11:21\nfe47e9508289ad4eca71613a9f20d7f3323602\n\nThis is low priority for me, and so weird that it has to be a pilot\nerror -- OTOH I may do a bisect to try and figure out whether it's a\nrecent change...\n\ncheers,\n\n\nmartin\n"},{"id":"14165","messageId":"Pine.LNX.4.64.0601040828590.3668@g5.osdl.org","threadId":"2962","inReplyTo":"46a038f90601032046l31f51742k93f3f9f5a826bef1@mail.gmail.com","subject":"Re: Strange unable to unlink error with git-prune-packed","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-01-04T16:34:18Z","receivedAt":"2006-01-04T16:34:18Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 4 Jan 2006, Martin Langhoff wrote:\n> \n> When I invoke git-prune-packed I am greeted by (3-line sample):\n> \n> error: unable to unlink .git/objects/43/2251e8488dc3c72d94d698ed69003137c47244\n> error: unable to unlink .git/objects/43/6bc8b274ab96944a6f8c3cf5e3fbeef422042b\n> error: unable to unlink .git/objects/43/fe47e9508289ad4eca71613a9f20d7f3323602\n\nDoes it happen for all your files? All your repositories? Or just one \nrepo? Or just one subdirectory in that repo?\n\nThe code is _literally_ just doing a\n\n\tif (unlink(pathname) < 0)\n\t\terror(\"unable to unlink %s\", pathname);\n\nbut maybe you could just make it print out the reason too. So add a \"(%s)\" \nand a \"strerror(errno)\" to that error line..\n\n> $ ls -la .git/objects/43\n> total 24\n> drwxr-xr-x    5 martin  martin   170  4 Jan 17:37 .\n\nI don't see why you couldn't unlink those files. Maybe it's some strange \nHFS issue and you can't just unlink() things that have attributes or \nsomething? Maybe some crazy file manager has added a default icon \nattribute to your files if you happened to look at the .git objects \ndirectory?\n\n\t\tLinus\n"},{"id":"14168","messageId":"46a038f90601041410m7628adfdr3ec81015d80d0f8e@mail.gmail.com","threadId":"2962","inReplyTo":"Pine.LNX.4.64.0601040828590.3668@g5.osdl.org","subject":"Re: Strange unable to unlink error with git-prune-packed","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-01-04T22:10:20Z","receivedAt":"2006-01-04T22:10:20Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 1/5/06, Linus Torvalds <torvalds@osdl.org> wrote:\n> Does it happen for all your files? All your repositories? Or just one\n> repo?\n\nGood questions -- should have sorted those basic things out before\nposting. Apologies. In any case, I haven't seen that before, but I\ndon't run git-prune-packed that often on the OSX commandline. My main\ndev host is a linux machine, and I have a weekly cron that does repack\nand prune packed on all my repos.\n\n> Or just one subdirectory in that repo?\n\nIt refused to unlink _any_ files within .git/objects\n\n> The code is _literally_ just doing a\n>\n>         if (unlink(pathname) < 0)\n>                 error(\"unable to unlink %s\", pathname);\n>\n> but maybe you could just make it print out the reason too. So add a \"(%s)\"\n> and a \"strerror(errno)\" to that error line..\n\nThis morning, after a reboot, I patched prune-packed.c as suggested\nand ran it... and it all worked.\n\nInitially I suspected the files were locked somehow, but I just did a\nnew clone && git-repack && git-prune-packed and it just worked...\nGrrr.\n\n> I don't see why you couldn't unlink those files. Maybe it's some strange\n> HFS issue and you can't just unlink() things that have attributes or\n> something? Maybe some crazy file manager has added a default icon\n> attribute to your files if you happened to look at the .git objects\n> directory?\n\nIt is indeed HFS but I'm pretty sure things should be transparent to\nthe unix side of things. In any case, the (crazy filemanager) Finder\nwasn't involved, as this is a newish repo, I haven't looked at any\ndirectory around it with Finder, and it's known to leave hidden files\nall over the place.\n\nIn any case, I've got my git-prune-packed patched now, and will be\ntrying to repro the bug.\n\ncheers,\n\n\nmartin\n"}]}