johnmehr / gitup

A minimalist, dependency-free FreeBSD program to clone/pull Git repositories.
BSD 2-Clause "Simplified" License
51 stars 9 forks source link

Implement the clone/pull command format that git.freebsd.org understands #11

Closed johnmehr closed 3 years ago

johnmehr commented 3 years ago

The version of the git server that git.freebsd.org uses doesn't appear to honor command=fetch style requests and the alternate want style needs to be implemented.

lwhsu commented 3 years ago

git.freebsd.org is uring git 2.29.2, what's the minimal git version required?

johnmehr commented 3 years ago

I did some research over the weekend and it looks like it's a protocol issue -- git.freebsd.org doesn't appear to be configured to use version 2 of Git’s wire protocol. When I send:

GET /doc.git/info/refs?service=git-upload-pack HTTP/1.1 Host: git.freebsd.org User-Agent: git/2.28 Git-Protocol: version=2

it doesn't include version=2 in its capability advertisement response and rejects the version 2 command syntax.

If git.freebsd.org could be configured to accept the v2 protocol, that would be fantastic. If it can't, I'll work on adding v1 support.

Thank you!

lwhsu commented 3 years ago

I've done some modification in staging server, can you check if https://git-dev.freebsd.org/doc.git works?

johnmehr commented 3 years ago

Looks good! Thank you!

GET /doc.git/info/refs?service=git-upload-pack HTTP/1.1 Host: git-dev.freebsd.org User-Agent: git/2.28 Git-Protocol: version=2

==> bytes sent: 129 ==> bytes read:421 bytes_expected:0 total_bytes_read:421

000eversion 2 0015agent=git/2.29.2 000cls-refs 0012fetch=shallow 0012server-option 0017object-format=sha1 0000

lwhsu commented 3 years ago

https://git.freebsd.org supports git protocol v2 now.

CyberCr33p commented 3 years ago

I download releng/12.2 from git.freebsd.org successfully.

johnmehr commented 3 years ago

I just changed the default host in gitup.conf to git.freebsd.org. Thank you!