-
Notifications
You must be signed in to change notification settings - Fork 184
Description
Nice points by @Symbolk
Why we diff? Because we want to understand the changes, so the format should serve for change comprehension. In fact, someone has modified Gumtree output format but getting a distingushed paper~ (See FudanSELab/CLDIFF)
I customized Gumtree for personal use, for meaningful diff summary, including:
Action Name Parent Node Type: Target Node Type Target Node Content Before Action Line Range & Column Range Before Action Target Node Content After Action (if exists) Line Range & Column Range After Action (if exists)For example:
Move CompilationUnit::ImportDeclaration import com.beust.jcommander.Parameter; 12, 273 import com.beust.jcommander.Parameter; 1, 0So, basically you can read it as a phrase: "Move ImportDeclaration 'import com.beust.jcommander.Parameter;' in CompilationUnit from (12, 273) to (1, 0)".
I'd like to, but one major concern here.
As we know, Gumtree parses multple languages with various backends (parser), but for each of the supported languages, the definition of AST Node Type and the way to get ranges is different. Since I only use Gumtree to diff Java, so I only implement the Java version.
To generalize the output format, some refactoring must be done.
BTW, I made a pr earlier to fix a bug (#110 ), but it seems @jrfaller did not merge it.