All of lore.kernel.org
 help / color / mirror / Atom feed
* Diff impromements: keep block whole
@ 2016-09-12  9:36 KES
  2016-09-12 10:38 ` Kevin Daudt
  0 siblings, 1 reply; 2+ messages in thread
From: KES @ 2016-09-12  9:36 UTC (permalink / raw)
  To: git

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;
 		}
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Diff impromements: keep block whole
  2016-09-12  9:36 Diff impromements: keep block whole KES
@ 2016-09-12 10:38 ` Kevin Daudt
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Daudt @ 2016-09-12 10:38 UTC (permalink / raw)
  To: KES; +Cc: git

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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-12 10:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12  9:36 Diff impromements: keep block whole KES
2016-09-12 10:38 ` Kevin Daudt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.