This robust-diff with cdiff.py can enumerate difference between files which are stored under specified directories.
The remarkable points are
- Robust file search
- Comment ignored diff with cdiff.py which can ignore C/C++ style comments.
Then you can enumerate the actual diff in case of file moved case and comment addition/removal, etc.
ruby robust-diff.rb --help
Usage: -s sourceDir -t destDir -o outputDir
-s, --srcDir= Specify srcDir (old)
-t, --dstDir= Specify dstDir (new)
-f, --filter= Specify filename filter regexp
-I, --ignoreRegExp= Specify ignore regexp for diff -I
-d, --useDiff Specify if you want to use normal diff command
-o, --output= Specify output path
-u, --useSourceNameForOutput Specify if you want to output with the source file basis
-m, --outputNotFoundFiles Specify if you want to output not found files
-j, --numOfThreads= Specify number of threads (default:10)
-v, --verbose Enable verbose
$ ruby robust-diff.rb -s ./test/old -t ./test/new -o result
$ ruby robust-diff.rb -s old -t new -f "\.patch$" -o result
Diff for file with ending with .patch
$ ruby robust-diff.rb -s ./test/old -t ./test/new -o result -m
$ ruby robust-diff.rb -s ./test/old -t ./test/new -o result --useDiff
python3 cdiff.py --help
usage: cdiff.py [-h] [-s] [-c] [args ...]
Parse command line options.
positional arguments:
args file1 file2
options:
-h, --help show this help message and exit
-s, --strip Ignore blank, etc.
-c, --ignoreComment Ignore comments //, /* */
$ python3 cdiff.py old/source.cpp new/source.cpp -c -s
Then diff with ignoring the comments and ignoring space, tab difference.