Thread (11 messages) flat view 11 messages, 3 authors, 2016-06-15

Re: [PATCH v6] safecrlf: Add mechanism to warn about irreversible crlf conversions

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:09

Possibly related (same subject, not in this thread)

Steffen Prohaska [off-list ref] writes:
CRLF conversion bears a slight chance of corrupting data.
...
thing to do, while for binary file it corrupts data.
The above 25-line or so are well written and deserve to be in
the end user documentation somewhere, I think, to explain why it
is a good idea to have these warnings to them..
This commit modifies git apply to fail even if safecrlf=warn,
because git apply writes its changes back to the work tree
immediately.  The user would not have a chance to backup the old
version of the file if only a warning was printed.
I do not get this logic at all.

The whole point of git-apply is to apply the patch.  If you say
--whitespace=fix and some contents (say one of the testsuite
files in our t/ directory) needed to keep trailing newline, you
obviously are left with a broken result, and you would recover
by checking it out from index or HEAD and reapply.  Why
shouldn't the same principle hold here?

I haven't looked at the code of this round yet, but I promise I
will.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help