Re: [PATCHv3] git apply: option to ignore whitespace differences
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 29, 2009, 07:09 UTC
- Message-ID
- <7vab2oynhm.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <cb7bb73a0907282333g26efd1d8y7d913fba8a426aa5@mail.gmail.com>
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
Show 5 quoted lines
> 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.