{"thread":{"id":"44060","subject":"Diff impromements: keep block whole","startedAt":"2016-09-12T09:43:48Z","lastAt":"2016-09-12T10:38:58Z","messageCount":2,"participants":["KES","Kevin Daudt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"301696","messageId":"1190311473672986@web29o.yandex.ru","threadId":"44060","inReplyTo":null,"subject":"Diff impromements: keep block whole","fromName":"KES","fromEmail":"kes-kes@yandex.ru","sentAt":"2016-09-12T09:36:26Z","receivedAt":"2016-09-12T09:43:48Z","isPatch":false,"sender":{"key":"kes-kes@yandex.ru","avatar":null},"body":"Does it be more meaning full which change was done when diff will be displayed as:\n@@ -1278,6 +1311,16 @@ sub process {\n \t\tif( ref $result eq 'HASH' ) {\n \t\t\t$code =  $result->{ code };\n \t\t\t@args =  DB::eval( $result->{ expr } );\n \n \t\t\tredo PROCESS;\n\t\t}\n+\t\telsif( ref $result eq 'ARRAY' ) {\n+\t\t\t$code =  shift @$result;\n+\t\t\t@args =  ();\n+\t\t\tfor my $expr ( @$result ) {\n+\t\t\t\tpush @args, [ DB::eval( $expr ) ];\n+\t\t\t}\n+\n+ \t\t\tredo PROCESS;\n+ \t\t}\n \n\ninstead of:\n\n@@ -1278,6 +1311,16 @@ sub process {\n \t\tif( ref $result eq 'HASH' ) {\n \t\t\t$code =  $result->{ code };\n \t\t\t@args =  DB::eval( $result->{ expr } );\n+\n+\t\t\tredo PROCESS;\n+\t\t}\n+\t\telsif( ref $result eq 'ARRAY' ) {\n+\t\t\t$code =  shift @$result;\n+\t\t\t@args =  ();\n+\t\t\tfor my $expr ( @$result ) {\n+\t\t\t\tpush @args, [ DB::eval( $expr ) ];\n+\t\t\t}\n+\n \t\t\tredo PROCESS;\n \t\t}\n \n"},{"id":"301698","messageId":"20160912103850.GA31326@ikke.info","threadId":"44060","inReplyTo":"1190311473672986@web29o.yandex.ru","subject":"Re: Diff impromements: keep block whole","fromName":"Kevin Daudt","fromEmail":"me@ikke.info","sentAt":"2016-09-12T10:38:50Z","receivedAt":"2016-09-12T10:38:58Z","isPatch":false,"sender":{"key":"me@ikke.info","avatar":"https://avatars.githubusercontent.com/u/135698?v=4"},"body":"On Mon, Sep 12, 2016 at 12:36:26PM +0300, KES wrote:\n> Does it be more meaning full which change was done when diff will be displayed as:\n> @@ -1278,6 +1311,16 @@ sub process {\n>  \t\tif( ref $result eq 'HASH' ) {\n>  \t\t\t$code =  $result->{ code };\n>  \t\t\t@args =  DB::eval( $result->{ expr } );\n>  \n>  \t\t\tredo PROCESS;\n> \t\t}\n> +\t\telsif( ref $result eq 'ARRAY' ) {\n> +\t\t\t$code =  shift @$result;\n> +\t\t\t@args =  ();\n> +\t\t\tfor my $expr ( @$result ) {\n> +\t\t\t\tpush @args, [ DB::eval( $expr ) ];\n> +\t\t\t}\n> +\n> + \t\t\tredo PROCESS;\n> + \t\t}\n>  \n> \n> instead of:\n> \n> @@ -1278,6 +1311,16 @@ sub process {\n>  \t\tif( ref $result eq 'HASH' ) {\n>  \t\t\t$code =  $result->{ code };\n>  \t\t\t@args =  DB::eval( $result->{ expr } );\n> +\n> +\t\t\tredo PROCESS;\n> +\t\t}\n> +\t\telsif( ref $result eq 'ARRAY' ) {\n> +\t\t\t$code =  shift @$result;\n> +\t\t\t@args =  ();\n> +\t\t\tfor my $expr ( @$result ) {\n> +\t\t\t\tpush @args, [ DB::eval( $expr ) ];\n> +\t\t\t}\n> +\n>  \t\t\tredo PROCESS;\n>  \t\t}\n>  \n\nYes, it would definately be more meaningfull, but for an algorithm it's\nnot that clear cut. Michael Hagerty is currently working on a patch\nseries[1] to give git some heuristics to get better diffs, but is hard\nto get right.\n\nYou can already enable this by adding --compaction-heuristic to the diff\ncommand, but this can also give odd results in other cases, so it's not\nenabled by default.\n\nKevin.\n\n\n[1]:https://public-inbox.org/git/cover.1473068229.git.mhagger@alum.mit.edu/\n"}]}