public class RefDiff
extends java.lang.Object
| Constructor and Description |
|---|
RefDiff(LanguagePlugin parser)
Build a RefDiff instance with the specified language plugin.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
cloneGitRepository(java.io.File destinationFolder,
java.lang.String cloneUrl)
Clone a git repository in a local folder.
|
CstDiff |
computeDiffBetweenRevisions(org.eclipse.jgit.lib.Repository repo,
org.eclipse.jgit.revwalk.RevCommit revBefore,
org.eclipse.jgit.revwalk.RevCommit revAfter)
Low level method that computes the CST diff between two arbitrary revisions.
|
CstDiff |
computeDiffForCommit(java.io.File gitRepository,
java.lang.String commitSha1)
Compute a CST diff between a commit and its parent commit (previous revision).
|
void |
computeDiffForCommitHistory(java.io.File gitRepository,
int maxDepth,
java.util.function.BiConsumer<org.eclipse.jgit.revwalk.RevCommit,CstDiff> diffConsumer)
Compute the CST diff for each commit in the git repository, starting from HEAD.
|
void |
computeDiffForCommitHistory(java.io.File gitRepository,
java.lang.String startAt,
int maxDepth,
java.util.function.BiConsumer<org.eclipse.jgit.revwalk.RevCommit,CstDiff> diffConsumer)
Compute the CST diff for each commit in the git repository, starting from the specified commit.
|
public RefDiff(LanguagePlugin parser)
new RefDiff(new JsParser()).parser - A language parserpublic java.io.File cloneGitRepository(java.io.File destinationFolder,
java.lang.String cloneUrl)
destinationFolder - Folder in which the repository will be cloned.cloneUrl - The URL of the repository.public CstDiff computeDiffForCommit(java.io.File gitRepository, java.lang.String commitSha1)
gitRepository - The folder of the git repository (you should pass the .git folder if the repository is not on bare mode).commitSha1 - SHA1 (or git object reference) that identifies the commit.public void computeDiffForCommitHistory(java.io.File gitRepository,
int maxDepth,
java.util.function.BiConsumer<org.eclipse.jgit.revwalk.RevCommit,CstDiff> diffConsumer)
gitRepository - The folder of the git repository (you should pass the .git folder if the repository is not on bare mode).maxDepth - Number of commits that will be navigated backwards at maximum.diffConsumer - Consumer function that will be called for each computed CST diff.public void computeDiffForCommitHistory(java.io.File gitRepository,
java.lang.String startAt,
int maxDepth,
java.util.function.BiConsumer<org.eclipse.jgit.revwalk.RevCommit,CstDiff> diffConsumer)
gitRepository - The folder of the git repository (you should pass the .git folder if the repository is not on bare mode).startAt - git object reference of the starting commit.maxDepth - Number of commits that will be navigated backwards at maximum.diffConsumer - Consumer function that will be called for each computed CST diff.public CstDiff computeDiffBetweenRevisions(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.revwalk.RevCommit revBefore, org.eclipse.jgit.revwalk.RevCommit revAfter)
Repository and RevCommit.
For more details on jgit library, please refer to JGit documentation.repo - The jgit repository object.revBefore - The jgit commit object before the change.revAfter - The jgit commit object after the change.