Skip to content
Jean-Rémy Falleri edited this page Feb 5, 2022 · 5 revisions

In this page you will find the list and documentation of all GumTree commands.

Overriding properties

GumTree use some system properties. Their values can be overridden by using an option flag directly on the top-level gumtree command, as such:

gumtree -C PROPERTY VALUE

Diff commands

Here are the commands related to diffing source code files.

WebDiff

Usage

gumtree webdiff PATH1 PATH2

Description

webdiff starts a web server that displaying a diff between two files or two folders.

Arguments

  • PATH1 the source path, either a file or a folder.
  • PATH2 the destination path, either a file or a folder (must be the same kind as PATH1).

Options

  • --port PORT change the server port (default 4567).
  • -g TREE_GENERATOR_ID to force GumTree to use a specific tree generator.
  • -m MATCHER_ID to force GumTree to use a specific matcher.
  • -M PROPERTY VALUE add a matcher property, available: bu_minsim, bu_minsize, st_minprio, st_priocalc, cd_labsim, cd_maxleaves, cd_structsim1, cd_structsim2, xy_minsim.
  • -x COMMAND use an external command to produce a XML compatible GumTree AST. The command must be of the form COMMAND $FILE where $FILE will be automatically replaced by the file to parse.

SwingDiff

Usage

gumtree swingdiff PATH1 PATH2

Description

swingdiff displays the diff between two files using the Swing java UI toolkit.

Arguments

  • PATH1 the source path, either a file or a folder.
  • PATH2 the destination path, either a file or a folder (must be the same kind as PATH1).

Options

  • -g TREE_GENERATOR_ID to force GumTree to use a specific tree generator.
  • -m MATCHER_ID to force GumTree to use a specific matcher.
  • -M PROPERTY VALUE add a matcher property, available: bu_minsim, bu_minsize, st_minprio, st_priocalc, cd_labsim, cd_maxleaves, cd_structsim1, cd_structsim2, xy_minsim.
  • -x COMMAND use an external command to produce a XML compatible GumTree AST. The command must be of the form COMMAND $FILE where $FILE will be automatically replaced by the file to parse.

TextDiff

Usage

gumtree textdiff PATH1 PATH2

Description

textdiff outputs the diff between two files in a textual format.

Arguments

  • PATH1 the source path, must be a file.
  • PATH2 the destination path, must be a file.

Options

  • -f FORMAT change the format (default TEXT), available TEXT, XML, JSON.
  • o FILE change the output file (default stdout).
  • -g TREE_GENERATOR_ID to force GumTree to use a specific tree generator.
  • -m MATCHER_ID to force GumTree to use a specific matcher.
  • -M PROPERTY VALUE add a matcher property, available: bu_minsim, bu_minsize, st_minprio, st_priocalc, cd_labsim, cd_maxleaves, cd_structsim1, cd_structsim2, xy_minsim.
  • -x COMMAND use an external command to produce a XML compatible GumTree AST. The command must be of the form COMMAND $FILE where $FILE will be automatically replaced by the file to parse.

DotDiff

Usage

gumtree dotdiff PATH1 PATH2

Description

dotdiff outputs the diff between two files in GraphViz's dot format, that can then be transformed using the dot command to SVG, PDF, ... See graphviz.

Arguments

  • PATH1 the source path, must be a file.
  • PATH2 the destination path, must be a file.

Options

  • -g TREE_GENERATOR_ID to force GumTree to use a specific tree generator.
  • -m MATCHER_ID to force GumTree to use a specific matcher.
  • -M PROPERTY VALUE add a matcher property, available: bu_minsim, bu_minsize, st_minprio, st_priocalc, cd_labsim, cd_maxleaves, cd_structsim1, cd_structsim2, xy_minsim.
  • -x COMMAND use an external command to produce a XML compatible GumTree AST. The command must be of the form COMMAND $FILE where $FILE will be automatically replaced by the file to parse.

Utility commands

List

Usage

gumtree list ELEMENTS

Description

list displays a list of GumTree's matchers, tree generators, properties and clients (commands).

Arguments

  • ELEMENTS either MATCHERS, GENERATORS, PROPERTIES or CLIENTS.

Parse

Usage

gumtree parse PATH

Description

parse outputs the AST corresponding to a given file.

Arguments

  • PATH the file path.

Options

  • -g TREE_GENERATOR_ID to force GumTree to use a specific tree generator.
  • -x COMMAND use an external command to produce a XML compatible GumTree AST. The command must be of the form COMMAND $FILE where $FILE will be automatically replaced by the file to parse.