gitweb: add patch view
commit9872cd6f6c40803db9e784b6287db72e0cb6b5c3
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 18 Dec 2008 07:13:16 +0000 (18 08:13 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 21 Dec 2008 09:11:22 +0000 (21 01:11 -0800)
tree7235d33e3b1473b91d07853a781da8ba09550a7c
parent2dd620286e84e4e76226a3511af6d14755b8c809
gitweb: add patch view

The output of commitdiff_plain is not intended for git-am:
 * when given a range of commits, commitdiff_plain publishes a single
   patch with the message from the first commit, instead of a patchset
 * the hand-built email format replicates the commit summary both as
   email subject and as first line of the email itself, resulting in
   a duplication if the output is used with git-am.

We thus create a new view that can be fed to git-am directly, allowing
patch exchange via gitweb. The new view exposes the output of git
format-patch directly, limiting it to a single patch in the case of a
single commit.

A configurable upper limit defaulting to 16 is imposed on the number of
commits which will be included in a patchset, to prevent DoS attacks on
the server. Setting the limit to 0 will disable the patch view, setting
it to a negative number will remove the limit.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl