Thread (98 messages) flat view 98 messages, 5 authors, 2016-06-15

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

From: Jeff King <hidden>
Date: 2016-06-15 23:07:47

Possibly related (same subject, not in this thread)

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help