[RFC/PATCH] pkt-line: allow writing of LARGE_PACKET_MAX buffers

2014-12-09 Thread Jeff King
When we send out pkt-lines with refnames, we use a static 1000-byte buffer. This means that the maximum size of a ref over the git protocol is around 950 bytes (the exact size depends on the protocol line being written, but figure on a sha1 plus some boilerplate). This is enough for any sane

Re: [RFC/PATCH] pkt-line: allow writing of LARGE_PACKET_MAX buffers

2014-12-09 Thread Jeff King
On Tue, Dec 09, 2014 at 12:49:58PM -0500, Jeff King wrote: Another option would be to use a static strbuf. Then we're only wasting heap, and even then only as much as we need (we'd still manually cap it at LARGE_PACKET_MAX since that's what the protocol dictates). This would also make

Re: [RFC/PATCH] pkt-line: allow writing of LARGE_PACKET_MAX buffers

2014-12-09 Thread Johannes Sixt
Am 09.12.2014 um 18:49 schrieb Jeff King: +test_expect_success 'create repo with absurdly long refname' ' + ref240=$_z40/$_z40/$_z40/$_z40/$_z40/$_z40 + ref1440=$ref240/$ref240/$ref240/$ref240/$ref240/$ref240 + git init long + ( + cd long +

Re: [RFC/PATCH] pkt-line: allow writing of LARGE_PACKET_MAX buffers

2014-12-09 Thread Jeff King
On Tue, Dec 09, 2014 at 08:58:26PM +0100, Johannes Sixt wrote: Am 09.12.2014 um 18:49 schrieb Jeff King: +test_expect_success 'create repo with absurdly long refname' ' + ref240=$_z40/$_z40/$_z40/$_z40/$_z40/$_z40 + ref1440=$ref240/$ref240/$ref240/$ref240/$ref240/$ref240 + git

Re: [RFC/PATCH] pkt-line: allow writing of LARGE_PACKET_MAX buffers

2014-12-09 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Tue, Dec 09, 2014 at 12:49:58PM -0500, Jeff King wrote: Another option would be to use a static strbuf. Then we're only wasting heap, and even then only as much as we need (we'd still manually cap it at LARGE_PACKET_MAX since that's what the protocol

Re: [RFC/PATCH] pkt-line: allow writing of LARGE_PACKET_MAX buffers

2014-12-09 Thread Michael Blume
On Tue, Dec 9, 2014 at 2:41 PM, Junio C Hamano gits...@pobox.com wrote: Jeff King p...@peff.net writes: On Tue, Dec 09, 2014 at 12:49:58PM -0500, Jeff King wrote: Another option would be to use a static strbuf. Then we're only wasting heap, and even then only as much as we need (we'd still