RFE: download patch between arbitrary revisions

Lukas Fleischer cgit at cryptocrack.de
Wed Aug 14 10:56:36 CEST 2013


On Mon, Aug 12, 2013 at 01:05:18PM -0600, Jason A. Donenfeld wrote:
> This is a wonderful idea.
> 
> The sequence of patches provides a somewhat ridiculous way of
> reassembling a git repository from cgit without using the proper http
> clone endpoints; I wonder how long it will be before somebody winds up
> (ab)using this for this purpose. A max-patches-per-request could
> really help to prevent the DoS. On the otherhand, aren't there are a
> few other endpoints that can cause similar DoS? If so, maybe we ought
> to save max-patches-per-request for another commit that handles other
> DoS cases too, and perhaps if we're lucky then be able to consolidate
> them into one configuration setting at that point --
> max-operations-per-request.
> 
> Anyway, go ahead and implement it --
> 
>     * /patch/ will support id2 param and return format-patch --stdout id1..id2
>     * /diff/ will be unchanged
>     * /diff/?raw=1 will spit out the raw output

I implemented it as /rawdiff/ for now since /diff/?raw=1 turned out to
be a bit more involved to implement. Up to now, the decision on whether
to include the HTML layout (including the header, navigation bar) or not
is solely based on the command ("patch", "diff", ...) that is used.

I can try to change this if you feel strongly about it.

> 
> Sound good?


More information about the CGit mailing list