]> git.ipfire.org Git - thirdparty/git.git/commit
upload-pack.c: allow banning certain object filter(s)
authorTaylor Blau <me@ttaylorr.com>
Mon, 3 Aug 2020 18:00:10 +0000 (14:00 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 4 Aug 2020 01:03:41 +0000 (18:03 -0700)
commit6dd3456a8ccbad6a0a6a31bc7192025617114243
tree70b9474df7cc7ced3c2bdd5cc214949f58bfb785
parentb9ea214795b89e0455bbe92fab5d30d1f3a4cc6d
upload-pack.c: allow banning certain object filter(s)

Git clients may ask the server for a partial set of objects, where the
set of objects being requested is refined by one or more object filters.
Server administrators can configure 'git upload-pack' to allow or ban
these filters by setting the 'uploadpack.allowFilter' variable to
'true' or 'false', respectively.

However, administrators using bitmaps may wish to allow certain kinds of
object filters, but ban others. Specifically, they may wish to allow
object filters that can be optimized by the use of bitmaps, while
rejecting other object filters which aren't and represent a perceived
performance degradation (as well as an increased load factor on the
server).

Allow configuring 'git upload-pack' to support object filters on a
case-by-case basis by introducing two new configuration variables:

  - 'uploadpackfilter.allow'
  - 'uploadpackfilter.<kind>.allow'

where '<kind>' may be one of 'blobNone', 'blobLimit', 'tree', and so on.

Setting the second configuration variable for any valid value of
'<kind>' explicitly allows or disallows restricting that kind of object
filter.

If a client requests the object filter <kind> and the respective
configuration value is not set, 'git upload-pack' will default to the
value of 'uploadpackfilter.allow', which itself defaults to 'true' to
maintain backwards compatibility. Note that this differs from
'uploadpack.allowfilter', which controls whether or not the 'filter'
capability is advertised.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/uploadpack.txt
t/t5616-partial-clone.sh
upload-pack.c