Re: [RFC PATCH 0/7] Moved code detection: ignore space on uniform indentation
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Apr 3, 2018, 00:03 UTC
- Message-ID
- <CA+P7+xpDfKSvQZ+YktsSSBPTc3JXzc9dR36tohLctfDf04iaOg@mail.gmail.com>
- In-Reply-To
- <20180402164742.11d4c5507d6ee737c9935d73@google.com>
On Mon, Apr 2, 2018 at 4:47 PM, Jonathan Tan <jonathantanmy@google.com> wrote:
Show 22 quoted lines
> On Mon, 2 Apr 2018 15:48:47 -0700
> Stefan Beller <sbeller@google.com> wrote:
>
>> This is a re-attempt of [1], which allows the moved code detection to
>> ignore blanks in various modes.
>>
>> patches 1-5 are refactoring, patch 6 adds all existing white space options
>> of regular diff to the move detection. (I am unsure about this patch,
>> as I presume we want to keep the option space at a minimum if possible).
>
> My preference is to not do this until a need has been demonstrated, but
> this sounds like it could be useful one day. I'll review the patches
> from the viewpoint that we do want this feature.
>
>> The fun is in the last patch, which allows white space sensitive
>> languages to trust the move detection, too. Each block that is marked as
>> moved will have the same delta in {in-, de-}dentation.
>> I would think this mode might be a reasonable default eventually.
>
> This sounds like a good idea. "Trust" is probably too strong a word, but
> I can see this being useful even in non-whitespace-sensitive languages
> with nested blocks (like C).The ability to detect moved code despite whitespace changes would be good, even while showing diffs with the whitespace intact.
We may not need *all* the options available, but allowing the internal settings to enable this but have the user-visible controls be limited should be totally fine.
Thanks, Jake