From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Cc: Daniel Barkalow <barkalow@iabervon.org>, torvalds@osdl.org
Subject: Help cloning over http.
Date: Sat, 17 Sep 2005 01:50:37 -0700 [thread overview]
Message-ID: <7vvf10axia.fsf_-_@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vacicccxl.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Sat, 17 Sep 2005 01:32:06 -0700")
Even when repository is packed, the new "we trust only the refs
we already have" code wasted too much time verifying what are
already in packs, walking down to the root commits. Since we
slurp all the necessary packs upfront and run verify pack on
them, temporarily register their edge commits as "known to be
good" before invoking git-http-fetch.
I am not proud of this workaround -- this would probably break
in a pathological case where the remote repository has packs
that depend on ancient unpacked objects, but people should not
be making such packs anyway (git repack would not create such
packs).
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
git-clone.sh | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
34414e4170ab8d1d2a9ef582256530dc3b42d3e2
diff --git a/git-clone.sh b/git-clone.sh
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -50,11 +50,30 @@ Perhaps git-update-server-info needs to
git-verify-pack ".git/objects/pack/$idx" || exit 1
done <"$clone_tmp/packs"
+ while read type idx sha1 commit
+ do
+ case "$type,$commit" in
+ T,commit) ;;
+ *) continue ;;
+ esac &&
+ echo "$sha1" >.git/refs/tags/clone-tmp-$sha1
+ done <"$clone_tmp/packs"
+
while read sha1 refname
do
name=`expr "$refname" : 'refs/\(.*\)'` &&
git-http-fetch -v -a -w "$name" "$name" "$1/" || exit 1
done <"$clone_tmp/refs"
+
+ while read type idx sha1 commit
+ do
+ case "$type,$commit" in
+ T,commit) ;;
+ *) continue ;;
+ esac &&
+ rm -f .git/refs/tags/clone-tmp-$sha1
+ done <"$clone_tmp/packs"
+
rm -fr "$clone_tmp"
}
next prev parent reply other threads:[~2005-09-17 8:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-15 1:31 [PATCH] Fix fetch completeness assumptions Daniel Barkalow
2005-09-15 8:09 ` Junio C Hamano
2005-09-15 16:42 ` Daniel Barkalow
2005-09-15 11:02 ` Sergey Vlasov
2005-09-15 16:54 ` Daniel Barkalow
2005-09-16 6:04 ` Junio C Hamano
2005-09-17 8:02 ` Junio C Hamano
2005-09-17 8:32 ` Junio C Hamano
2005-09-17 8:50 ` Junio C Hamano [this message]
2005-09-17 17:37 ` Help cloning over http Daniel Barkalow
2005-09-18 17:38 ` [PATCH] Improve the safety check used in fetch.c Junio C Hamano
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=7vvf10axia.fsf_-_@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.