Re: Diffing reStructuredText documents that only differ by formatting

"Martin Blais" <[email protected]>
Newsgroups gmane.comp.python.documentation
Message-ID <[email protected]>
On Mon, 2 Mar 2009 17:33:46 +0000 (UTC), "Jeffrey C. Jacobs" <[email protected]> said:
> I am wondering if there is a way to diff 2 versions of a reStructuredText
> document that differ only by line breaks within paragraphs such that
> those
> differences do not trigger a diff entry.  In other words, I wonder if
> there is a
> tool out there where:
> 
> this is one
> reStructuredText
> paragraph
> 
> Is considered equivalent to:
> 
> this is one reStructuredText paragraph
> 
> Does anyone have any ideas how this can be accomplished, especially with
> respect
> to VCS differences, e.g. svn?

If the differences are only whitespace, xxdiff has an option to keep those gray in the GUI.

tangerine:~/p/xxdiff/src$ xxdiff --list-resource | grep Hunk
Accel.ToggleIgnorePerHunkWhitespace: ""
IgnorePerHunkWhitespace: False
tangerine:~/p/xxdiff/src$ 

Otherwise you can write a 40 lines Python script to parse GNU diff output and filter out those changes from the diff hunks.
_______________________________________________
Doc-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/doc-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.