From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCHv3] git apply: option to ignore whitespace differences
Date: Wed, 29 Jul 2009 10:20:44 +0200 [thread overview]
Message-ID: <cb7bb73a0907290120x72d0ae99p7cfdd2b88264a24a@mail.gmail.com> (raw)
In-Reply-To: <7vab2oynhm.fsf@alter.siamese.dyndns.org>
On Wed, Jul 29, 2009 at 9:09 AM, Junio C Hamano<gitster@pobox.com> wrote:
> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 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.
I was thinking more about consistency than 'correctness' in this
case, actually. Typical scenario would be: patch is created for a file
using a given whitespace convention (e.g. 4 spaces). File is updated
to match the rest of the project (tabs). Patch would now introduce the
wrong whitespace convention for the new lines.
Of course, whitespace can (and should) be fixed a posteriori, but when
doing a rebase this can get quite annoying. So some kind of automatic
way to do it would be nice. But I don't think I'd get around to such a
feature any time soon. (Also, the merge case has a higher priority.)
--
Giuseppe "Oblomov" Bilotta
next prev parent reply other threads:[~2009-07-29 8:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-28 21:00 [PATCHv3] git apply: option to ignore whitespace differences Giuseppe Bilotta
2009-07-28 21:29 ` Junio C Hamano
2009-07-29 6:33 ` Giuseppe Bilotta
2009-07-29 7:09 ` Junio C Hamano
2009-07-29 8:20 ` Giuseppe Bilotta [this message]
2009-07-29 8:39 ` Junio C Hamano
2009-07-29 9:05 ` Giuseppe Bilotta
2009-07-29 8:40 ` Nanako Shiraishi
2009-07-29 9:09 ` Giuseppe Bilotta
2009-07-31 0:27 ` Felipe Contreras
2009-07-31 0:48 ` Junio C Hamano
2009-07-31 15:38 ` Felipe Contreras
2009-07-31 16:16 ` Giuseppe Bilotta
2009-07-31 17:17 ` Junio C Hamano
2009-07-31 19:22 ` Giuseppe Bilotta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cb7bb73a0907290120x72d0ae99p7cfdd2b88264a24a@mail.gmail.com \
--to=giuseppe.bilotta@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).