在 2016年11月24日星期四 SGT 上午9:43:40,Holger Levsen 写道: > however, cloning using --depth 1 did not work :( > > $ git clone --depth 1 https://anonscm.debian.org/cgit/webwml/webwml2git.git > Cloning into 'webwml2git'... > fatal: The remote end hung up unexpectedly > fatal: protocol error: bad pack header
That's interesting. I tried to dig into the problem but yet to find its origin: * Git shallow clone was quite limited before v1.9. On Alioth we have git v1.9.1, however. * Any shallow clone via cgit would fail (e.g. using anonscm.d.o/{cgit,git}/). * Shallow cloning via SSH (alioth account) would *fail* if the user does not have write permission into the repository. If the user has write permission then everything would be OK: % LC_ALL=C git clone --depth 1 git+ssh://hosiet-gu...@git.debian.org:/git/ webwml/webwml2git.git/ Cloning into 'webwml2git'... fatal: Unable to create temporary file '/srv/git.debian.org/git/webwml/ webwml2git.git/shallow_DrNR7B': Permission denied fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed % LC_ALL=C git clone --depth 1 git+ssh://hosiet-gu...@git.debian.org:/git/ collab-maint/shadowsocks-libev.git/ Cloning into 'shadowsocks-libev'... remote: Counting objects: 124, done. remote: Compressing objects: 100% (114/114), done. remote: Total 124 (delta 25), reused 36 (delta 5) Receiving objects: 100% (124/124), 206.81 KiB | 36.00 KiB/s, done. Resolving deltas: 100% (25/25), done. ( In the example, I am one of the uploaders of the latter package but I don't have write permission to webwml). Really interesting. Seems that shallow cloning would create a temp file inside the repository. For GitHub they handled it properly, and on Alioth the strict repo owner limitation made it impossible. -- Sincerely, Boyuan Yang
signature.asc
Description: This is a digitally signed message part.