RFE: download patch between arbitrary revisions

Jason A. Donenfeld Jason at zx2c4.com
Mon Aug 12 21:05:18 CEST 2013


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

Sound good?


More information about the CGit mailing list