Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add git+https support. #350

Merged
merged 1 commit into from
Apr 14, 2015
Merged

Add git+https support. #350

merged 1 commit into from
Apr 14, 2015

Conversation

jszakmeister
Copy link
Contributor

No description provided.

@jszakmeister
Copy link
Contributor Author

FWIW, I modeled this after what was done in hg_https.lua. I hope it's the right approach.

@mpeterv
Copy link
Contributor

mpeterv commented Apr 14, 2015

LGTM, although the new file must be added to the list in Makefile.setup.inc

@hishamhm by the way, why --depth=1 is not used when fetching git+http://? 1 2

@ignacio
Copy link
Contributor

ignacio commented Apr 14, 2015

@mpeterv because it depends on the git server. See this page on protocols. The old "dumb" protocol does not support the depth flag.

$ git --version
git version 1.9.5.msysgit.0
$ git clone --depth=1 http://luajit.org/git/luajit-2.0.git luajit-2.0
Cloning into 'luajit-2.0'...
fatal: dumb http transport does not support --depth

However, some git servers implement a "smart" http protocol. Github, for instance, supports the --depth flag with no problems.

$ git clone --depth=1 http://github.com/keplerproject/luarocks.git luarocks
Cloning into 'luarocks'...
remote: Counting objects: 193, done.
remote: Compressing objects: 100% (169/169), done.
remote: Total 193 (delta 16), reused 123 (delta 11), pack-reused 0
Receiving objects: 100% (193/193), 3.29 MiB | 158.00 KiB/s, done.
Resolving deltas: 100% (16/16), done.
Checking connectivity... done.

I found a way to determine whether the server is dumb or smart but it is quite convoluted.

So if we were to support this flag over these transports, maybe we could have a whitelist of known git services that support the --depth flag but I don't know if it is worth the hassle. /cc @hishamhm

(additionally, I found these notes on the Git HTTP transport documentation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants