Skip to content

Instantly share code, notes, and snippets.

@treyharris
Created February 1, 2019 00:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save treyharris/49ab08018e88bdc7c662068866672f63 to your computer and use it in GitHub Desktop.
Save treyharris/49ab08018e88bdc7c662068866672f63 to your computer and use it in GitHub Desktop.

Odd hub-clone/hub-pull behavior

I first discovered this issue in trying to do a git pull on repo with the origin remote origin git://github.com/moritz/perl6-all-modules.git using hub (which, on my machine, is aliased to git).

After ensuring that I didn't have hub.protocol set in my config files, I first tried modifying the HUB_PROTOCOL variable:

% protos=(https git ssh)
% for p in $protos; do
echo "\nPROTOCOL: $p\n==================="
HUB_PROTOCOL=$p git clone moritz/perl6-all-modules ALL-MODULES
rm -rf ALL-MODULES
──(for)── done

PROTOCOL: https
===================
Cloning into 'ALL-MODULES'...
remote: Enumerating objects: 4803, done.
remote: Counting objects: 100% (4803/4803), done.
remote: Compressing objects: 100% (2623/2623), done.
error: RPC failed; curl 56 GnuTLS recv error (-24): Decryption has failed.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

PROTOCOL: git
===================
Cloning into 'ALL-MODULES'...
remote: Enumerating objects: 4803, done.
remote: Counting objects: 100% (4803/4803), done.
remote: Compressing objects: 100% (2623/2623), done.
fatal: protocol error: bad line length character: j
fatal: early EOF
fatal: index-pack failed

PROTOCOL: ssh
===================
Cloning into 'ALL-MODULES'...
remote: Enumerating objects: 4803, done.
remote: Counting objects: 100% (4803/4803), done.
remote: Compressing objects: 100% (2623/2623), done.
remote: Total 139658 (delta 1903), reused 4593 (delta 1722), pack-reused 134855
Receiving objects: 100% (139658/139658), 198.49 MiB | 32.26 MiB/s, done.
Resolving deltas: 100% (87465/87465), done.
Checking out files: 100% (27870/27870), done.
%

Results: https and git fail, ssh succeeds.

Next, I tried using GitHub URL's rather than relying on hub-clone to construct them:

urls=(git@github.com:moritz/perl6-all-modules.git https://github.com/moritz/perl6-all-modules.git git://github.com/moritz/perl6-all-modules.git)
% for u in $urls; do
echo "\nURL: $u\n==================="
git clone $u ALL-MODULES && cd ALL-MODULES && git remote -v && cd -
rm -rf ALL-MODULES
done

URL: git@github.com:moritz/perl6-all-modules.git
===================
Cloning into 'ALL-MODULES'...
remote: Enumerating objects: 4803, done.
remote: Counting objects: 100% (4803/4803), done.
remote: Compressing objects: 100% (2623/2623), done.
remote: Total 139658 (delta 1903), reused 4593 (delta 1722), pack-reused 134855
Receiving objects: 100% (139658/139658), 198.49 MiB | 30.38 MiB/s, done.
Resolving deltas: 100% (87465/87465), done.
Checking out files: 100% (27870/27870), done.
origin  git@github.com:moritz/perl6-all-modules.git (fetch)
origin  git@github.com:moritz/perl6-all-modules.git (push)
/tmp

URL: https://github.com/moritz/perl6-all-modules.git
===================
Cloning into 'ALL-MODULES'...
remote: Enumerating objects: 4803, done.
remote: Counting objects: 100% (4803/4803), done.
remote: Compressing objects: 100% (2623/2623), done.
error: RPC failed; curl 56 GnuTLS recv error (-24): Decryption has failed.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

URL: git://github.com/moritz/perl6-all-modules.git
===================
Cloning into 'ALL-MODULES'...
remote: Enumerating objects: 4803, done.
remote: Counting objects: 100% (4803/4803), done.
remote: Compressing objects: 100% (2623/2623), done.
fatal: protocol error: bad line length character: ?
fatal: early EOF
fatal: index-pack failed

Results: https and git fail, ssh succeeds. Same as before.

So I finally attempted to use git-clone directly without going through hub:

% for u in $urls; do
echo "\nURL (bypassing hub): $u\n==================="
\git clone $u ALL-MODULES && cd ALL-MODULES && git remote -v && cd -
rm -rf ALL-MODULES
done

URL (bypassing hub): git@github.com:moritz/perl6-all-modules.git
===================
Cloning into 'ALL-MODULES'...
remote: Enumerating objects: 4803, done.
remote: Counting objects: 100% (4803/4803), done.
remote: Compressing objects: 100% (2623/2623), done.
remote: Total 139658 (delta 1903), reused 4593 (delta 1722), pack-reused 134855
Receiving objects: 100% (139658/139658), 198.49 MiB | 34.52 MiB/s, done.
Resolving deltas: 100% (87465/87465), done.
Checking out files: 100% (27870/27870), done.
origin  git@github.com:moritz/perl6-all-modules.git (fetch)
origin  git@github.com:moritz/perl6-all-modules.git (push)
/tmp

URL (bypassing hub): https://github.com/moritz/perl6-all-modules.git
===================
Cloning into 'ALL-MODULES'...
remote: Enumerating objects: 4803, done.
remote: Counting objects: 100% (4803/4803), done.
remote: Compressing objects: 100% (2623/2623), done.
remote: Total 139658 (delta 1903), reused 4593 (delta 1722), pack-reused 134855
Receiving objects: 100% (139658/139658), 198.49 MiB | 43.09 MiB/s, done.
Resolving deltas: 100% (87465/87465), done.
Checking out files: 100% (27870/27870), done.
origin  https://github.com/moritz/perl6-all-modules.git (fetch)
origin  https://github.com/moritz/perl6-all-modules.git (push)
/tmp

URL (bypassing hub): git://github.com/moritz/perl6-all-modules.git
===================
Cloning into 'ALL-MODULES'...
remote: Enumerating objects: 4803, done.
remote: Counting objects: 100% (4803/4803), done.
remote: Compressing objects: 100% (2623/2623), done.
error: inflate: data stream error (invalid stored block lengths)
fatal: pack has bad object at offset 4049732: inflate returned -3
fatal: index-pack failed

Results: only git fails, ssh AND https succeeds.

What? This is really weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment