From: Jeff King Date: Fri, 15 Jan 2016 20:27:29 GMT Subject: Re: [PATCH v4 11/21] revision: read --stdin with strbuf_getline() Message-ID: <20160115202729.GE11301@sigill.intra.peff.net> In-Reply-To: <1452815916-6447-12-git-send-email-gitster@pobox.com> On Thu, Jan 14, 2016 at 03:58:26PM -0800, Junio C Hamano wrote: > Reading with getwholeline() and manually stripping the terminating > '\n' would leave CR at the end of the line if the input comes from > a DOS editor. > > Constrasting this with the previous few changes, one may realize > that the way "log" family of commands read the paths with --stdin > looks inconsistent and sloppy. It does not allow us to C-quote a > textual input, and it does not accept NUL-terminated records. These > are unfortunately way too late to fix X-<. Unlike the previous patch, where we can reasonably expect somebody to quote a bare CR, this actually makes it impossible to ask about "foo\r". Well, maybe not impossible, if we strip only one CR (you could say "foo\r\r"), but certainly a behavior change. Given the general crappiness of this interface for files with bizarre characters, I think we are much more likely to be doing the user a favor by stripping CRLF than hurting them by breaking "foo\r". After all, "foo\n" remains impossible. -Peff