diff
usually produces rather clueless output. Here's a good example. If we start with this:
class World
def hello
puts "Hello, world"
end
def goodbye
puts "Goodbye, world"
end
end
Drop the second method and change the first:
class World
def hello
puts "Hello, #{self}"
end
end
diff -u
will be a total mess - suggesting two methods have been merged:
class World
def hello
- puts "Hello, world"
- end
- def goodbye
- puts "Goodbye, world"
+ puts "Hello, #{self}"
end
end
Instead of much more reasonable:
class World
def hello
- puts "Hello, world"
+ puts "Hello, #{self}"
end
- def goodbye
- puts "Goodbye, world"
- end
end
This is just a toy example, so diff
's output is still possible to understand - in practice it usually gets a lot worse.
Are there any alternatives to diff
that might be somewhat smarter?