[darcs-devel] [issue1773] smart CGI script for fast darcs get/pull over HTTP

Reinier Lamers bugs at darcs.net
Sun Mar 21 10:50:43 UTC 2010


Reinier Lamers <tux_rocker at reinier.de> added the comment:

Op zondag 21 maart 2010 08:04 schreef Eric Kow:
> Petr: I didn't understand everything in the conversation (during the
> 2010-03 sprint Friday lunch).  Do you think you could jot down a few
> more details on how we'd like the design for this to work?  I dimly
> recall some debate about how to arrange things so that it's all very
> easy to debug, eg. with curl/wget

I suggested making this a web service, and make it a (simple, low-level) end-
user web interface and a darcs get/put/pull/push protocol at the same time.  
That is, when you request http://darcs.net/reposervice with an 'Accept: 
application/x-darcs-repo' header, you get the binary blob that darcs needs; if 
you request the same URL with 'Accept: text/html', you get a human-readable 
index web page about the repo.

Petr said that this would be hard to debug with wget (because wget would just 
give you HTML). I said that curl and wget have flags to set headers such as 
'Accept'.

However, building such a multipurpose web service seems to be against the Unix 
philosophy of building small tools that do one thing well. But making a simple 
web service (or "protocol over HTTP", if that's more appropriate), even 
without the human-readable interface, has the advantage that you get error 
reporting and proxying and such HTTP features for free. 

Besides, "CGI script" sounds like 1995. Wouldn't it be a better idea to use 
some Haskell web server package, or fcgi, to make stuff even faster?

Reinier

----------
nosy: +tux_rocker

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1773>
__________________________________


More information about the darcs-devel mailing list