--
For infos about GitSharp visit http://www.eqqon.com/index.php/GitSharp
To join this group visit http://groups.google.com/group/gitsharp
So to clarify this further, GitSharp has some "transport" code where I
could insert my own transport?
After starting to work on this I've got a few more questions:
1. I see that the TransportHttp supports Fetch but not Push. Why is
that?
2. For a WCF endpoint I will need a server situation -- something like
git-daemon. Is there any kind of TSR/daemon mode for GitSharp? Do any
of the other protocols host a server endpoint?
3. Is the TransportHttp endpoint just pointing to a WebDav type of
server or is there actually some server listening on the far end?
The servlet stuff is a lot of magic goop, but really its pretty simple
in the end. C# needs a web service thing that can handle 4 URLS:
GET ...repository.../info/refs?service=git-upload-pack
GET ...repository.../info/refs?service=git-receive-pack
POST ...repository.../git-upload-pack
POST ...repository.../git-receive-pack
The first 2 need to generate a response that looks like the initial
advertisement portion of the UploadPack and ReceivePack classes. In
JGit we literally just exported that method as public in the API and
then had the servlet goop create the class and run the method, dumping
its results onto the stream back to the client. Pretty simple.
The second 2 need to take the POST body in and pass that to the
UploadPack or ReceivePack class, and take their output and return it
to the client. In JGit these are pretty simple classes, 10 lines or
something to find the repository for "...repository...", create the
class, and tie the POST body as the input stream and the response
output stream as the output stream.
There are a few gotchas, you need to implement gzip decoding of the
POST body if the Content-Encoding: gzip header is sent by the client.
You also need to send a special header line in the GET /info/refs
responses before the actual advertisement data, but that's about it.
Most of the servlet goop in JGit is to support the older dumb HTTP in
parallel to the new smart HTTP. I'm not sure this was actually worth
doing. Smart HTTP has been shipping in Git for over a year now. Almost
everyone's Git client speaks it, and if they don't, they are usually
OK with upgrading.
>> 3. Is the TransportHttp endpoint just pointing to a WebDav type of
>> server or is there actually some server listening on the far end?
>
> I am not aware of any server impl. I am sorry for not being of much help.
JGit's TransportHttp client only supports the newer smart HTTP
protocol for Git, which requires a Git-aware server software on the
server end to correctly format the GET /info/refs advertisement, and
correctly handle the POST /git-receive-pack containing the push
arguments and object data.
We never implemented the dumb HTTP protocol that uses WebDAV. We
probably never will, its horrible as a protocol for Git over HTTP.
--
Shawn.