Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diff_format:text is not at all "similar to the Unix 'diff' command line utility" #619

Open
kqr opened this issue Sep 5, 2019 · 0 comments

Comments

@kqr
Copy link

kqr commented Sep 5, 2019

Having read the above description in the documentation I assumed I could use prettydiff as a plug-in replacement for the Unix diff in a separate program that expects diff output to look a certain way. This is not at all the case, as you can see in this example:

$ diff tmp/difftest1 tmp/difftest2
3,6c3
<     puts "Hello, world"
<   end
<   def goodbye
<     puts "Goodbye, world"
---
>     puts "Hello, #{self}"
$ prettydiff diff diff_format:text source:tmp/difftest1 diff:tmp/difftest2

Line: 3
    puts "Hello, world"
    puts "Hello, #{self}"

Line: 5
  def goodbye
    puts "Goodbye, world"
  end


Pretty Diff found 2 differences on 2 lines.

A program expecting the former will not even nearly be able to parse the latter, and it seems a bit misleading to say the two are "similar".

My suggestions for solutions are to either:

  • Remove the statement about similarity to Unix diff; or, ideally
  • Add a new diff_format:normal which actually does output something similar to the Unix diff "normal" format!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant