On 16 Feb 2008 03:02:55 -0800, yeti wrote:
>
> Hi,
>
> I want to find the SLOC that changed between two versions of a file.
> For this I'm using cvs diff.
> But the problem is that diff shows even those differences which are
> actually comments. I want to ignore comments ("C and C++" style
> comments).
>
> Are there any commands/scripts which I can use ??
>
> regards
>
> Rohin
>
Hello Rohin,
GNU diff has the option -I RE (i.e., ignore regular expression), but I don't
know if your version of cvs diff will pass through your option.
You might have to resort to
cvs update -r <version1> -p filename > filename~<version1>~
cvs update -r <version2> -p filename > filename~<version2>~
diff -I '^ *//' filename~{<version1>,<version2>}~
But that regexp handles only C++ comments. I don't know of a way to
recognize /* ... [text containing newlines] ... */. Possibly another
diff utility has that options (xxdiff, tkdiff?).
Ted
--
dodecatheon at gmail dot com
Frango ut patefaciam -- I break so that I may reveal