From: Jeff King <peff@peff.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Daniel Barkalow <barkalow@iabervon.org>, git@vger.kernel.org
Subject: [RFC] http clone does not checkout working tree
Date: Wed, 4 Jun 2008 14:38:58 -0400 [thread overview]
Message-ID: <20080604183858.GA7095@sigill.intra.peff.net> (raw)
If I try cloning a repository by http with the current 'master', I end
up with a proper git directory, but nothing gets checked out in the
working tree [I see the problem with any repository; I randomly picked
the one in the example below because it is small, and http clone can be
painfully slow]:
$ git clone http://repo.or.cz/r/bigint.git
[...]
$ cd bigint
$ ls
$
I think the problem is that the builtin-clone now does the http commit
walking and the tree unpacking in the same process, and the commit
walker leaves the in-core objects in a funny state.
Specifically, the top-level tree object has its "parsed" flag set to 1,
but the buffer and size members are set to NULL and 0, respectively.
This happens in walker.c:process_tree, where we free the tree buffer
after walking it. It seems like we are violating the meaning of "parsed"
here, which implies that those other members are valid.
The following patch fixes it for me, but I really have no idea if there
isn't something more subtle at work. Sending to Linus, since "git blame"
points the surrounding code to you, and to Daniel, since the new clone
and the commit walker are your areas.
---
diff --git a/walker.c b/walker.c
index 31de6c1..0e68ee6 100644
--- a/walker.c
+++ b/walker.c
@@ -59,6 +59,7 @@ static int process_tree(struct walker *walker, struct tree *tree)
free(tree->buffer);
tree->buffer = NULL;
tree->size = 0;
+ tree->object.parsed = 0;
return 0;
}
next reply other threads:[~2008-06-04 18:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-04 18:38 Jeff King [this message]
2008-06-04 18:59 ` [RFC] http clone does not checkout working tree Linus Torvalds
2008-06-04 19:30 ` Linus Torvalds
2008-06-04 19:59 ` Daniel Barkalow
2008-06-04 20:10 ` Daniel Barkalow
2008-06-04 19:02 ` Junio C Hamano
2008-06-04 19:16 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080604183858.GA7095@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).