Home > Net >  Is there a way to improve git-diff output?
Is there a way to improve git-diff output?

Time:05-06

I have source text:

=head3 POST /throw/rock


Take a rock, throw it. Well done, you.


=head4 Input

=over

=item direction

Compass point or something.

=item speed

In km/h to annoy home counties people who still think in mp/h.

=back


=head4 Output

Which was changed by next text:

=head3 POST /throw/rock


=for doc-viewer input-from POST /drive/tank


Take a rock, throw it. Well done, you.


=head4 Output

The resulting diff is: enter image description here

Are there options in git that force it to not break patches. I expect result like so:

 =head3 POST /throw/rock
 
 
 =for doc-viewer input-from POST /drive/tank
-Take a rock, throw it. Well done, you.
-
-
-=head4 Input
 
-=over
-
-=item direction
 
-Compass point or something.
-
-=item speed
-
-In km/h to annoy home counties people who still think in mp/h.
-
-=back
 Take a rock, throw it. Well done, you.
 
 
 =head4 Output

CodePudding user response:

Use --patience or --histogram; they make this particular case even better, because they notice that there is one line that did not change:

@@ -1,22  1,10 @@
 =head3 POST /throw/rock


 =for doc-viewer input-from POST /drive/tank
 
 
 Take a rock, throw it. Well done, you.


-=head4 Input
-
-=over
-
-=item direction
-
-Compass point or something.
-
-=item speed
-
-In km/h to annoy home counties people who still think in mp/h.
-
-=back
-
-
 =head4 Output
  • Related