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

Re: [PATCHv3] git apply: option to ignore whitespace differences

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:07

Giuseppe Bilotta [off-list ref] writes:
Actually, one thing that I've been thinking about doing is to adjust
the new lines to match the kind of whitespace change the context line
underwent. Example: if all the context lines had the change 4 spaces
-> tab, it would be nice to have the new lines undergo the same
change. However, this is going to be rather hard to implement.
Doing so will be actively wrong.

In the case of "whitespace=fix", it is justifiable to update ws broken
context lines while applying a ws corrected patch to a ws broken target,
and it also is justifiable not to update context lines while applying a ws
broken patch to a ws corrected target, because it is clear which one has
the correct whitespace layout (i.e. output of ws_fix_copy() by definition
is the correct outcome).  But in your example, it is not clear if the
layout using 4 spaces is correct or the one with a tab.  The tool should
refrain from guessing in such a case.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help