Re: [PATCH 5/7] diff.c: add a blocks mode for moved code detection
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Apr 24, 2018, 22:59 UTC
- Message-ID
- <20180424155948.e37a0d12fdf0e2fdafde153d@google.com>
- In-Reply-To
- <CAGZ79ka9Tdk=ijbw6Hyxs9OsBMK9O69_3_cY8oX2j=wRc_F5-g@mail.gmail.com>
On Tue, 24 Apr 2018 15:37:51 -0700 Stefan Beller <sbeller@google.com> wrote:
> These can be combined independently, so would > you expect the user to expect two options for them? > For example "--color-moved=zebra" could be split > into "--skip-small --alternate-blocks"
Yes, this is a good explanation. Reusing your terms below, --skip-small controls the algorithm, and --alternate-blocks controls the presentation layer.
Show 12 quoted lines
> So instead of building blocks we rather want to split into algorithms > and presentation layer? > > The presentation layer would be things like: > * use a different color for moved things > * alternate colors for adjacent blocks > * paint border of a block (dimmed zebra) > > The algorithm side would be > * detect moves > * detect moves as blocks > * skip small heuristic
Yes.
This was just brainstorming, though - this might not be the direction we want to take in this patch. (The right solution might just be to always use blocks - thereby simplifying the algorithm aspect.)