[cvsspam-devel] Hack to get plain text diffs

Elan Ruusamäe glen at delfi.ee
Thu Sep 27 14:33:59 UTC 2007


On Friday 21 September 2007 16:27:29 Tom Knight wrote:
> Hi,
>
> I knocked together this quick hack to get cvsspam to send both a plain text
> and HTML diffs out as they switched to using cvsspam at work. I don't
> really know much ruby so I'm sure it could be done much better but it works
> for now. I saw that this was one of the things on the TODO list so thought
> I'd pass it on in case it's of any use.
>
> All the changes are in cvsspam.rb based on the 0.2.12 version, the
> rand_string function was borrowed from here (not 100% sure what the license
> is but looks like it's public domain):
>
> http://snippets.dzone.com/posts/show/491
>
> Anything I've added is GPL2.
>
> Hopefully it'll be of use, if not throw it away and do it properly, I don't
> really mind :)

nice (looks working)
but shouldn't you also trim html links from the header in case $cvswebURL (and other $*URL) are defined?

Commit in test/utf8 on MAIN
xxx +1 -4 <a href="https://cvs.localdomain/test/xxx?rev=1.2&amp;content-type=text/x-cvsweb-markup">1.2</a> -> <a href="https://cvs.localdomain/test/xxx?rev=1.3&amp;content-type=text/x-cvsweb-markup">1.3</a> 
- check textdiff
--------------------------------------------------------------------------------
test/utf8
xxx <a href="https://cvs.localdomain/test/xxx?rev=1.2&amp;content-type=text/x-cvsweb-markup">1.2</a> -> <a href="https://cvs.localdomain/test/xxx?rev=1.3&amp;content-type=text/x-cvsweb-markup">1.3</a>
diff -u -r1.2 -r1.3

> Tom

-- 
glen



More information about the cvsspam-devel mailing list