{"thread":{"id":"12994","subject":"git clone error","startedAt":"2008-04-05T17:20:25Z","lastAt":"2008-04-05T20:09:05Z","messageCount":2,"participants":["Chuck Ritter","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"73703","messageId":"a00d3c7f0804051020u366e978ei7252c904c48461f6@mail.gmail.com","threadId":"12994","inReplyTo":null,"subject":"git clone error","fromName":"Chuck Ritter","fromEmail":"cfr100@psu.edu","sentAt":"2008-04-05T17:20:25Z","receivedAt":"2008-04-05T17:20:25Z","isPatch":false,"sender":{"key":"cfr100@psu.edu","avatar":null},"body":"Hello,\n\nI'm getting an error when I try to clone a git repo:\n\n$ git clone ~dab143/src/OVER-REL/SOURCE-GIT-TEST OVER-REL\nInitialized empty Git repository in /home/cfr100/OVER-REL/.git/\ncpio: objects/pack/pack-80a0460fc07be5e0628b02549fdaa186b792d3f3.keep:\nPermission denied\n888 blocks\n\n# cat pack-80a0460fc07be5e0628b02549fdaa186b792d3f3.keep\nfetch-pack 31620 on githost.arl.psu.edu\n\nPermission on the keep file are 600. Of course this looks like a stale\nlock of some sort.\n\nWe are using git version 1.5.4.1. The owner of the repository had\npushed changes to it from msysgit under Windows. I am not sure of the\nversion. It worked fine before that.\n\nIs this an issue I should take up with the msysgit developers?\n\nOnce in this state what is the best way to resolve it and verify the\nintegrity of the repository?\n\nThanks\nChuck\n"},{"id":"73711","messageId":"7vabk8vzby.fsf@gitster.siamese.dyndns.org","threadId":"12994","inReplyTo":"a00d3c7f0804051020u366e978ei7252c904c48461f6@mail.gmail.com","subject":"Re: git clone error","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-05T20:09:05Z","receivedAt":"2008-04-05T20:09:05Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Chuck Ritter\" <cfr100@psu.edu> writes:\n\n> $ git clone ~dab143/src/OVER-REL/SOURCE-GIT-TEST OVER-REL\n> Initialized empty Git repository in /home/cfr100/OVER-REL/.git/\n> cpio: objects/pack/pack-80a0460fc07be5e0628b02549fdaa186b792d3f3.keep:\n> Permission denied\n> 888 blocks\n>\n> # cat pack-80a0460fc07be5e0628b02549fdaa186b792d3f3.keep\n> fetch-pack 31620 on githost.arl.psu.edu\n>\n> Permission on the keep file are 600. Of course this looks like a stale\n> lock of some sort.\n\nThe original repository you are cloning from is owned by somebody else,\nand a file in it is not readable by you.  Bad.\n\nNo, .keep is not a stale lock.  It is active and valid --- do not\nremove it --- it prevents the corresponding pack from being subject to\nrepacking.\n\nThe bug is that index-pack.c::final() tries to make the resulting pack and\nidx readable with chmod(0444), but it forgets to make .keep readable.\n\nTo unblock you, you would need to ask the user \"dab143\" to make the\nrepository readable by you; the damage has already been done.  There may\nbe files other than that .keep file that is unreadable.\n\nThe following patch would prevent the breakage the repository you are\ntrying to clone from is suffering from happening again.\n\n---\n\n index-pack.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/index-pack.c b/index-pack.c\nindex 9c0c278..9dc3cfd 100644\n--- a/index-pack.c\n+++ b/index-pack.c\n@@ -720,6 +720,7 @@ static void final(const char *final_pack_name, const char *curr_pack_name,\n \t\t\t\tdie(\"cannot write keep file\");\n \t\t\treport = \"keep\";\n \t\t}\n+\t\tchmod(keep_name, 0444);\n \t}\n \n \tif (final_pack_name != curr_pack_name) {\n"}]}