From: Allan Gardner <allanegardner@gmail.com>
To: git@vger.kernel.org
Subject: git fetch sha1
Date: Fri, 4 Jul 2014 19:51:10 +0200 [thread overview]
Message-ID: <CABo2x6A_cA8KoFbe4Hcg0SJw+gOGeOFun3VDM1gx3ZVWK8wy3Q@mail.gmail.com> (raw)
Currently fetching a sha1 fails on git.kernel.org:
$ git --version && uname -a
git version 1.9.4
Linux nixos 3.12.23 #1-NixOS SMP Thu Jan 1 00:00:01 UTC 1970 x86_64 GNU/Linux
$ rm -rf test && mkdir test && cd test && git init
Initialized empty Git repository in ~/test/.git/
$ git fetch --depth 1 https://git.kernel.org/pub/scm/git/git.git
782735203c316041df120748e5e88c1787cdf4da
error: no such remote ref 782735203c316041df120748e5e88c1787cdf4da
I tried with head, same error. However, if I clone the full repository
and then manually execute git upload-pack, it successfully fetches the
commit:
$ git fetch https://git.kernel.org/pub/scm/git/git.git master
<wait an hour>
$ git checkout -b sha1 782735203c316041df120748e5e88c1787cdf4da
$ printf "0045want %s multi_ack_detailed\n000Ddeepen
1\n00000009done\n0000" "782735203c316041df120748e5e88c1787cdf4da"
>input
$ cat input | git upload-pack --stateless-rpc . > output
$ sed -z "s/.*0008NAK\n//" < output > output.pack
$ git index-pack output.pack && git verify-pack -v output.pack | grep commit
f239687a5dbbd1bbb761d09edec582418c66c297
782735203c316041df120748e5e88c1787cdf4da commit 374 234 12
So theoretically this is supported server-side. Unfortunately
kernel.org does not agree:
$ curl --data-binary @input --header "Content-Type:
application/x-git-upload-pack-request" --header "Accept-Encoding:
gzip" --header "Accept: application/x-git-upload-pack-result" --header
"Expect:" https://git.kernel.org/pub/scm/git/git.git/git-upload-pack >
output
$ wc -c output
0 output
Why is there a discrepancy between git.kernel.org and upload-pack
--stateless-rpc?
-- Allan Gardner
next reply other threads:[~2014-07-04 17:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-04 17:51 Allan Gardner [this message]
2014-07-04 20:41 ` git fetch sha1 Shawn Pearce
[not found] ` <CABo2x6CJz6PSFCDfn47cVQi44-J0oHsGqzSiyBe8Kt5NgWibog@mail.gmail.com>
2014-07-05 16:30 ` Shawn Pearce
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=CABo2x6A_cA8KoFbe4Hcg0SJw+gOGeOFun3VDM1gx3ZVWK8wy3Q@mail.gmail.com \
--to=allanegardner@gmail.com \
--cc=git@vger.kernel.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).