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

Re: git clone error

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 5, 2008, 20:09 UTC
Message-ID
<7vabk8vzby.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<a00d3c7f0804051020u366e978ei7252c904c48461f6@mail.gmail.com>
"Chuck Ritter" <cfr100@psu.edu> writes:
Show 11 quoted lines
> $ git clone ~dab143/src/OVER-REL/SOURCE-GIT-TEST OVER-REL
> Initialized empty Git repository in /home/cfr100/OVER-REL/.git/
> cpio: objects/pack/pack-80a0460fc07be5e0628b02549fdaa186b792d3f3.keep:
> Permission denied
> 888 blocks
>
> # cat pack-80a0460fc07be5e0628b02549fdaa186b792d3f3.keep
> fetch-pack 31620 on githost.arl.psu.edu
>
> Permission on the keep file are 600. Of course this looks like a stale
> lock of some sort.

The original repository you are cloning from is owned by somebody else, and a file in it is not readable by you. Bad.

No, .keep is not a stale lock. It is active and valid --- do not remove it --- it prevents the corresponding pack from being subject to repacking.

The bug is that index-pack.c::final() tries to make the resulting pack and idx readable with chmod(0444), but it forgets to make .keep readable.

To unblock you, you would need to ask the user "dab143" to make the repository readable by you; the damage has already been done. There may be files other than that .keep file that is unreadable.

The following patch would prevent the breakage the repository you are trying to clone from is suffering from happening again.

---
 index-pack.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/index-pack.c b/index-pack.c
index 9c0c278..9dc3cfd 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -720,6 +720,7 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
 				die("cannot write keep file");
 			report = "keep";
 		}
+		chmod(keep_name, 0444);
 	}
 
 	if (final_pack_name != curr_pack_name) {
Previous: Chuck Ritter
Message 2 of 2 in “git clone error”
  1. Chuck RitterApr 5, 2008
  2. Junio C HamanoApr 5, 2008

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.