Basic git clone over gemini:// working

1. Dave Huseby (dave (a) westside.vegas)

Howdy,

I got bored over the weekend and wrote a simple Git remote helper for the 
gemini protocol. I published it on github for now: 
https://github.com/dhuseby/git-remote-gemini.git  Once you have it built 
and installed in your PATH somewhere, you'll then be able to clone it from 
the its actual location here: gemini://vi.rs/git-remote-gemini.git

I did a short terminal capture of me cloning a repo over gemini: 
https://asciinema.org/a/y2QxPEbgHsiGh4Go1AuHTLT0D

To make this work, I had to hack up Pollux to respond to simple queries 
and run the appropriate Git commands on the server. The details are in the 
README.gemini file in the repo.

Cheers!
Dave

Link to individual message.

2. solderpunk (solderpunk (a) SDF.ORG)

Holy heck!  That is impressive and exciting.  I know essentially nothing
about git internals.  To what extent does doing this rely on features of
Gemini which have no equivalent in Gopher?  Or is this actually much
simpler than I'm imagining it?

Cheers,
Solderpunk

On Mon, May 11, 2020 at 06:32:45PM -0700, Dave Huseby wrote:
> Howdy,
> 
> I got bored over the weekend and wrote a simple Git remote helper for 
the gemini protocol. I published it on github for now: 
https://github.com/dhuseby/git-remote-gemini.git  Once you have it built 
and installed in your PATH somewhere, you'll then be able to clone it from 
the its actual location here: gemini://vi.rs/git-remote-gemini.git
> 
> I did a short terminal capture of me cloning a repo over gemini: 
https://asciinema.org/a/y2QxPEbgHsiGh4Go1AuHTLT0D
> 
> To make this work, I had to hack up Pollux to respond to simple queries 
and run the appropriate Git commands on the server. The details are in the 
README.gemini file in the repo.
> 
> Cheers!
> Dave

Link to individual message.

3. Dave Huseby (dwh (a) vi.rs)

So it does rely on the query parameters feature of Gemini urls but I 
supposed a gopher equivalent would be to encode the git command parameters 
as parts of the path just like how the document type is sometimes encoded 
as part of the url path.

Git is actually pretty modular and is easily adapted to new transport 
protocols. You just have to implement a "remote helper" binary that 
follows Git's pipe-fork API for remotes. It's documented in the Git 
documentation and there's article written about implementing them.

I wrote the absolutely bare minimum remote helper. And since Gemini is a 
read-only protocol, `git push` will never work. This is just useful for 
publishing git repos on Gemini sites. The server side could easily be 
added to the Gemini servers that support CGI scripts.

Cheers!
Dave

On Tue, May 12, 2020, at 11:13 AM, solderpunk wrote:
> Holy heck!  That is impressive and exciting.  I know essentially nothing
> about git internals.  To what extent does doing this rely on features of
> Gemini which have no equivalent in Gopher?  Or is this actually much
> simpler than I'm imagining it?
> 
> Cheers,
> Solderpunk
> 
> On Mon, May 11, 2020 at 06:32:45PM -0700, Dave Huseby wrote:
> > Howdy,
> > 
> > I got bored over the weekend and wrote a simple Git remote helper for 
the gemini protocol. I published it on github for now: 
https://github.com/dhuseby/git-remote-gemini.git  Once you have it built 
and installed in your PATH somewhere, you'll then be able to clone it from 
the its actual location here: gemini://vi.rs/git-remote-gemini.git
> > 
> > I did a short terminal capture of me cloning a repo over gemini: 
https://asciinema.org/a/y2QxPEbgHsiGh4Go1AuHTLT0D
> > 
> > To make this work, I had to hack up Pollux to respond to simple 
queries and run the appropriate Git commands on the server. The details 
are in the README.gemini file in the repo.
> > 
> > Cheers!
> > Dave
>

Link to individual message.

---

Previous Thread: An observation about client certificates

Next Thread: New gemini server fully spanish