send-pack: take refspecs over stdin
commit26be19ba8d8d2e7e3e288b395e7156d5b7af5140
authorJeff King <peff@peff.net>
Thu, 21 Aug 2014 12:21:20 +0000 (21 08:21 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Aug 2014 19:58:02 +0000 (26 12:58 -0700)
treef025f721c298e2770de4419200a85758671b153b
parent4109c28e055dba27d73cefb956bea5e611f66ec0
send-pack: take refspecs over stdin

Pushing a large number of refs works over most transports,
because we implement send-pack as an internal function.
However, it can sometimes fail when pushing over http,
because we have to spawn "git send-pack --stateless-rpc" to
do the heavy lifting, and we pass each refspec on the
command line. This can cause us to overflow the OS limits on
the size of the command line for a large push.

We can solve this by giving send-pack a --stdin option and
using it from remote-curl.  We already dealt with this on
the fetch-pack side in 078b895 (fetch-pack: new --stdin
option to read refs from stdin, 2012-04-02). The stdin
option (and in particular, its use of packet-lines for
stateless-rpc input) is modeled after that solution.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-send-pack.txt
builtin/send-pack.c
remote-curl.c
t/t5408-send-pack-stdin.sh [new file with mode: 0755]
t/t5541-http-push-smart.sh