Class UserDefinedDiffTool

java.lang.Object
org.eclipse.jgit.internal.diffmergetool.UserDefinedDiffTool
All Implemented Interfaces:
ExternalDiffTool
Direct Known Subclasses:
PreDefinedDiffTool

public class UserDefinedDiffTool extends Object implements ExternalDiffTool
The user-defined diff tool.
  • Field Details

    • name

      private final String name
      the diff tool name
    • path

      private String path
      the diff tool path
    • cmd

      private final String cmd
      the diff tool command
  • Constructor Details

    • UserDefinedDiffTool

      public UserDefinedDiffTool(String name, String path, String cmd)
      Creates the diff tool
      Parameters:
      name - the name
      path - the path
      cmd - the command
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface ExternalDiffTool
      Returns:
      the diff tool name
    • getPath

      public String getPath()
      The path of the diff tool.

      The path to a pre-defined external diff tool can be overridden by specifying difftool.<tool>.path in a configuration file.

      For a user defined diff tool (that does not override a pre-defined diff tool), the path is ignored when invoking the tool.

      Specified by:
      getPath in interface ExternalDiffTool
      Returns:
      the diff tool path
      See Also:
    • getCommand

      public String getCommand()
      The command of the diff tool.

      A pre-defined external diff tool can be overridden using the tools name in a configuration file. The overwritten tool is then a user defined tool and the command of the diff tool is specified with difftool.<tool>.cmd. This command must work without prepending the value of getPath() and can sometimes include tool parameters.

      Specified by:
      getCommand in interface ExternalDiffTool
      Returns:
      the diff tool command
      See Also:
    • setPath

      public void setPath(String path)
      Overrides the path for the given tool. Equivalent to setting difftool.<tool>.path.
      Parameters:
      path - the new diff tool path
      See Also: