Re: [PATCH v4 11/21] revision: read --stdin with strbuf_getline()

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

 



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
--
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]