Re: Feature request: Improve diff algorithm
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Jan 24, 2018, 18:06 UTC
- Message-ID
- <CA+P7+xrVavoJkPmR17sbUS4zTH4ZioHJLgaKBvXg45UN1popxg@mail.gmail.com>
- In-Reply-To
- <12531516812201@web36o.yandex.ru>
On Wed, Jan 24, 2018 at 8:43 AM, KES <kes-kes@yandex.ru> wrote:
Show 32 quoted lines
> Here is another place where diff can be improved: > @@ -141,8 +140,9 @@ My_runops(pTHX) > // Do not trace variables in DB:: module > if( SvOK( inDB ) ) continue; > > - sv_inc_nomg( inDB ); > > + // save_item( inDB ); > + sv_inc_nomg( inDB ); > dSP; SINFO; SAVETMPS; > > // printf( "SWITCH\n" ); > > > This would be better it the patch looks like: > ( this patch is manually created just to light the idea. It may contain errors) > @@ -140,6 +140,7 @@ My_runops(pTHX) > // Do not trace variables in DB:: module > if( SvOK( inDB ) ) continue; > > + > + // save_item( inDB ); > sv_inc_nomg( inDB ); > - > dSP; SINFO; SAVETMPS; > > As we can see, here the `sv_inc_nomg( inDB );` line is unchanged and `// save_item( inDB );` is added. > Here we just add/remove empty lines and patch looks more better. > > I think (and this is my assumption), the the diff algorithm should take into account the string length. > This is more better to add/remove more short lines >
Hi,
Can you check if this is already handled by --indent-heuristic option of diff? I think it might help this one already.
Thanks, Jake