From: Kevin Daudt <me@ikke.info>
To: KES <kes-kes@yandex.ru>
Cc: git <git@vger.kernel.org>
Subject: Re: Diff impromements: keep block whole
Date: Mon, 12 Sep 2016 12:38:50 +0200 [thread overview]
Message-ID: <20160912103850.GA31326@ikke.info> (raw)
In-Reply-To: <1190311473672986@web29o.yandex.ru>
On Mon, Sep 12, 2016 at 12:36:26PM +0300, KES wrote:
> Does it be more meaning full which change was done when diff will be displayed as:
> @@ -1278,6 +1311,16 @@ sub process {
> if( ref $result eq 'HASH' ) {
> $code = $result->{ code };
> @args = DB::eval( $result->{ expr } );
>
> redo PROCESS;
> }
> + elsif( ref $result eq 'ARRAY' ) {
> + $code = shift @$result;
> + @args = ();
> + for my $expr ( @$result ) {
> + push @args, [ DB::eval( $expr ) ];
> + }
> +
> + redo PROCESS;
> + }
>
>
> instead of:
>
> @@ -1278,6 +1311,16 @@ sub process {
> if( ref $result eq 'HASH' ) {
> $code = $result->{ code };
> @args = DB::eval( $result->{ expr } );
> +
> + redo PROCESS;
> + }
> + elsif( ref $result eq 'ARRAY' ) {
> + $code = shift @$result;
> + @args = ();
> + for my $expr ( @$result ) {
> + push @args, [ DB::eval( $expr ) ];
> + }
> +
> redo PROCESS;
> }
>
Yes, it would definately be more meaningfull, but for an algorithm it's
not that clear cut. Michael Hagerty is currently working on a patch
series[1] to give git some heuristics to get better diffs, but is hard
to get right.
You can already enable this by adding --compaction-heuristic to the diff
command, but this can also give odd results in other cases, so it's not
enabled by default.
Kevin.
[1]:https://public-inbox.org/git/cover.1473068229.git.mhagger@alum.mit.edu/
prev parent reply other threads:[~2016-09-12 10:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-12 9:36 Diff impromements: keep block whole KES
2016-09-12 10:38 ` Kevin Daudt [this message]
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=20160912103850.GA31326@ikke.info \
--to=me@ikke.info \
--cc=git@vger.kernel.org \
--cc=kes-kes@yandex.ru \
/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).