Package org.eclipse.jgit.api
Class DiffCommand
Show changes between commits, commit and working tree, etc.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private int
private String
private ProgressMonitor
private AbstractTreeIterator
private AbstractTreeIterator
private OutputStream
private TreeFilter
private boolean
private String
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall()
private DiffFormatter
setCached
(boolean cached) Whether to view the changes staged for the next commitsetContextLines
(int contextLines) Set number of context lines instead of the usual three.setDestinationPrefix
(String destinationPrefix) Set the given destination prefix instead of "b/".setNewTree
(AbstractTreeIterator newTree) Set new treesetOldTree
(AbstractTreeIterator oldTree) Set old treeSet output streamsetPathFilter
(TreeFilter pathFilter) Set path filtersetProgressMonitor
(ProgressMonitor monitor) The progress monitor associated with the diff operation.setShowNameAndStatusOnly
(boolean showNameAndStatusOnly) Set whether to return only names and status of changed filessetSourcePrefix
(String sourcePrefix) Set the given source prefix instead of "a/".Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
-
Field Details
-
oldTree
-
newTree
-
cached
private boolean cached -
pathFilter
-
showNameAndStatusOnly
private boolean showNameAndStatusOnly -
out
-
contextLines
private int contextLines -
sourcePrefix
-
destinationPrefix
-
monitor
-
-
Constructor Details
-
DiffCommand
Constructor for DiffCommand- Parameters:
repo
- aRepository
object.
-
-
Method Details
-
getDiffFormatter
-
call
Execute the command
Executes the
Diff
command with all the options and parameters collected by the setter methods (e.g.setCached(boolean)
of this class. Each instance of this class should only be used for one invocation of the command. Don't call this method twice on an instance.- Specified by:
call
in interfaceCallable<List<DiffEntry>>
- Specified by:
call
in classGitCommand<List<DiffEntry>>
- Throws:
GitAPIException
-
setCached
Whether to view the changes staged for the next commit- Parameters:
cached
- whether to view the changes staged for the next commit- Returns:
- this instance
-
setPathFilter
Set path filter- Parameters:
pathFilter
- parameter, used to limit the diff to the named path- Returns:
- this instance
-
setOldTree
Set old tree- Parameters:
oldTree
- the previous state- Returns:
- this instance
-
setNewTree
Set new tree- Parameters:
newTree
- the updated state- Returns:
- this instance
-
setShowNameAndStatusOnly
Set whether to return only names and status of changed files- Parameters:
showNameAndStatusOnly
- whether to return only names and status of changed files- Returns:
- this instance
-
setOutputStream
Set output stream- Parameters:
out
- the stream to write line data- Returns:
- this instance
-
setContextLines
Set number of context lines instead of the usual three.- Parameters:
contextLines
- the number of context lines- Returns:
- this instance
-
setSourcePrefix
Set the given source prefix instead of "a/".- Parameters:
sourcePrefix
- the prefix- Returns:
- this instance
-
setDestinationPrefix
Set the given destination prefix instead of "b/".- Parameters:
destinationPrefix
- the prefix- Returns:
- this instance
-
setProgressMonitor
The progress monitor associated with the diff operation. By default, this is set toNullProgressMonitor
- Parameters:
monitor
- a progress monitor- Returns:
- this instance
- See Also:
-