From: Junio C Hamano Date: Wed, 29 Jul 2009 07:09:09 GMT Subject: Re: [PATCHv3] git apply: option to ignore whitespace differences Message-ID: <7vab2oynhm.fsf@alter.siamese.dyndns.org> In-Reply-To: Giuseppe Bilotta 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.