From: Jeff King Date: Wed, 21 Mar 2012 20:17:23 GMT Subject: Re: Clone fails on a repo with too many heads/tags Message-ID: <20120321201722.GA15021@sigill.intra.peff.net> In-Reply-To: <4F6A33C5.2080909@gmx.net> On Wed, Mar 21, 2012 at 09:02:13PM +0100, Ivan Todoroski wrote: > >Something in me feels slightly uncomfortable with that, just because > >simple newline-delimited formats make it easy for people to hack on the > >tool and feed input from unexpected sources. > > I understand what you mean. How about this: > > If both --stdin and --stateless-rpc are specified to fetch-pack, it > will use pkt-line to read the refs from stdin before handing off > stdin to get_remote_heads(). > > However, if only --stdin is specified, it will read refs from stdin > in a script-friendly newline delimited format, one ref per line. This > is okay because when --stateless-rpc is not specified > get_remote_heads() reads from an fd different from stdin so there is > no issue with residual buffers in this case. > > This way you preserve scriptability for any other callers who don't > use --stateless-rpc. > > How does this sound? I think that sounds quite reasonable, and shouldn't be more than a few extra lines to implement. -Peff