Are all patches created equal?
Are all patches created equal?
Posted Jul 24, 2011 19:41 UTC (Sun) by jnareb (subscriber, #46500)In reply to: Are all patches created equal? by civodul
Parent article: Are all patches created equal?
Instead of unidiff line counts, some form of semantic patch would provide more insight on the actual amount of changes.Are there any tools, preferably open source, that can turn unidiff patch + preimage into some form of semantic patch (like e.g. Coccinelle)?
For instance, whitespace changes, function moves, renames, etc. would count as little since they don't change the AST.
Without this I don't see how it would be any better than manual analysis...
Posted Jul 24, 2011 20:48 UTC (Sun)
by civodul (guest, #58311)
[Link]
Obviously a C parser is needed to turn source code into a canonical form (roughly, its AST). It may be possible to write a plug-in to abuse GCC to that end (see GCC-XML). Then some sort of tree diff on alpha-renamed ASTs would do it. However, I don't know what algorithms exist to compute the differences between two trees.
Are all patches created equal?