Diff of Text

Ben Finney ben+python at benfinney.id.au
Sat Jun 5 21:42:00 EDT 2010


GZ <zyzhu2000 at gmail.com> writes:

> Let me think of a better way to express what I mean by a "smaller
> diff." After I diff the two strings, I will have something like this:
>
>   AAA
> - BBB
> + CCC
> + DDD
> - EEE
>
> It means the first line does not change, the second line is replaced
> by the third line, the forth line is new, and the fifth line is
> deleted.

Are you drawing a distinction between:

  * “line FOO is replaced by line BAR”
  * “line FOO is deleted, line BAR is added”

Your wording seems to make that distinction, but I don't see how it's
useful or meaningful in a discussion about diff. Are they not exactly
the same?

-- 
 \     “Injustice is relatively easy to bear; what stings is justice.” |
  `\                                                 —Henry L. Mencken |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list