[PATCHv3 0/9] Push limits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here's the next iteration of what started out as a simple patch to let
the server refuse pushes that exceeded a configurable limit on the
#objects in a pack.

The current patch series allows limiting pushes by
 - size of pack
 - #objects in pack
 - #commits in pack

The limits are controlled by corresponding (new) config variables:
 - receive.packSizeLimit
 - receive.objectCountLimit
 - receive.commitCountLimit

Setting one or more of these config variables causes receive-pack to
advertise the corresponding (new) capabilities:
 - limit-pack-size=<num>
 - limit-object-count=<num>
 - limit-commit-count=<num>

These capabilities are parsed by the send-pack client, which pass them
on to pack-objects, using the corresponding (mostly new) pack-objects
options:
 --max-pack-size=<num>      (extended to be usable in this context)
 --max-object-count=<num>   (new)
 --max-commit-count=<num>   (new)

When one or more of those options are given together with --stdout to
pack-objects, pack-objects will check the generated pack against those
limits, and abort the pack generation if any limit is exceeded.

In addition, the server will also verify the object count limit,
if enabled, and abort the push if the pack exceeds the limit.
Currently, the server cannot easily check the other two limits without
changing the pack format (left as an exercise to the reader... ;-]),
so exceeding the pack size limit or the commit count limit will not be
caught by the server.


Finally, a quick run-through of the patches:

 - #1 is a very minor fix to the pack protocol docs.

 - #2 attempts to retrieve and display the remote status, even when
   pack-objects fail. This patch touches the same code as the recent
   send-pack deadlock fixes, so I'd like Peff or JSixt to review them.

 - #3 - #5 teaches pack-objects some new options to impose the above
   limits on the generated pack.

 - #6 contains some general preparation for the "limit-*" capabilities.

 - #7 - #9 adds the new limits to receive-pack, send-pack, and the
   corresponding protocol capabilites.


Have fun! :)

...Johan


Johan Herland (9):
  Update technical docs to reflect side-band-64k capability in receive-pack
  send-pack: Attempt to retrieve remote status even if pack-objects fails
  pack-objects: Allow --max-pack-size to be used together with --stdout
  pack-objects: Teach new option --max-object-count, similar to --max-pack-size
  pack-objects: Teach new option --max-commit-count, limiting #commits in pack
  receive-pack: Prepare for addition of the new 'limit-*' family of capabilities
  send-pack/receive-pack: Allow server to refuse pushes with too many objects
  send-pack/receive-pack: Allow server to refuse pushing too large packs
  send-pack/receive-pack: Allow server to refuse pushes with too many commits

 Documentation/config.txt                          |   35 ++++
 Documentation/git-pack-objects.txt                |   20 +++
 Documentation/git-repack.txt                      |    6 +
 Documentation/technical/pack-protocol.txt         |    5 +-
 Documentation/technical/protocol-capabilities.txt |   30 +++-
 builtin/pack-objects.c                            |   53 +++++-
 builtin/receive-pack.c                            |   45 +++++-
 builtin/send-pack.c                               |   44 ++++--
 cache.h                                           |    2 +-
 connect.c                                         |    7 +-
 git-repack.sh                                     |   27 ++--
 send-pack.h                                       |    3 +
 t/t5300-pack-object.sh                            |  121 +++++++++++++
 t/t5400-send-pack.sh                              |  191 +++++++++++++++++++++
 14 files changed, 543 insertions(+), 46 deletions(-)

-- 
1.7.5.rc1.3.g4d7b

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]