threads / discuss / 42866

proposal: allow git clone for http-hosted bundles

Subject: proposal: allow git clone for http-hosted bundles

## tl;dr

4 messages between Jul 17, 2016 and Jul 17, 2016.

replies: 3people: 4as markdown or json

mappu· Jul 17, 2016, 04:41 UTC · lore
Hi list,

Right now it's possible to git clone a repository over http, and git clone a bundle from the local filesystem, but it's not possible to git clone a bundle hosted on http.

Would it be possible to allow this in the future? Hopefully it's only a minor refactor in `builtin/clone.c`.

Regards
mappu

(Back story: I'm stuck with a git frontend that only ever calls `git clone ${target}` - that's Golang's `go get` - but bundles are a bit better fit for my request patterns than raw repositories).

Jeff King· Jul 17, 2016, 06:45 UTC · re: mappu · lore

Re: proposal: allow git clone for http-hosted bundles

On Sun, Jul 17, 2016 at 04:41:54PM +1200, mappu wrote:
Show 6 quoted lines
> Right now it's possible to git clone a repository over http, and git clone a
> bundle from the local filesystem, but it's not possible to git clone a
> bundle hosted on http.
> 
> Would it be possible to allow this in the future? Hopefully it's only a
> minor refactor in `builtin/clone.c`.
It's a bit more than a minor refactor. Long ago, I submitted
  http://thread.gmane.org/gmane.comp.version-control.git/185196

The tricky thing is having the http code handle the case that we get a bundle when accessing the repository.

I think I got stalled in a "perfect is the enemy of the good" situation. I wanted to clean up the patches to avoid spooling the bundle to disk (because it means we temporarily required 2x disk space). But in retrospect, it would be fine to start there, and if somebody wants to take on resumable index-pack, that can be a separate topic.

So I never ended up getting back to it. And somehow almost 5 years have passed yikes.

If anybody is interested in working on it, they can start from those patches, or from the jk/bundle-fetch-wip branch at https://github.com/peff/git. The latter has been continually rebased on master for the past 5 years, _but_ in a fairly blind manner. I resolve conflicts, but anything with "-wip" in the title is not part of my regular build. So it has not been compiled nor had its tests run in all that time. Caveat emptor.

> (Back story: I'm stuck with a git frontend that only ever calls `git clone
> ${target}` - that's Golang's `go get` - but bundles are a bit better fit for
> my request patterns than raw repositories).

You might do better to stick a shim script in your $PATH to just intercept the calls to git. Hacky, but it would probably solve your problem with a minimal amount of code.

-Peff
Junio C Hamano· Jul 17, 2016, 19:06 UTC · re: Jeff King · lore

Re: proposal: allow git clone for http-hosted bundles

Jeff King <peff@peff.net> writes:
> You might do better to stick a shim script in your $PATH to just
> intercept the calls to git. Hacky, but it would probably solve your
> problem with a minimal amount of code.

I recently learned about http://repo.or.cz/git.git/bundles which is a very nicely done set of instructions ;-)

Johannes Schindelin· Jul 17, 2016, 07:15 UTC · re: mappu · lore

Re: proposal: allow git clone for http-hosted bundles

Ho mappu,
On Sun, 17 Jul 2016, mappu wrote:
Show 6 quoted lines
> Right now it's possible to git clone a repository over http, and git
> clone a bundle from the local filesystem, but it's not possible to git
> clone a bundle hosted on http.
> 
> Would it be possible to allow this in the future? Hopefully it's only a
> minor refactor in `builtin/clone.c`.

Why don't you just give it a whirl? That would answer the question pretty quickly...

Ciao, Johannes

← back to recent threads