Top Fields Constructors Methods
org.jabref.logic.git

public Class SlrGitHandler

extends GitHandler
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, java.nio.charset.StandardCharsets, java.nio.file.Files, .Path, java.util.HashMap, .List, .Map, .Optional, .StringJoiner, org.jabref.logic.crawler.StudyRepository, org.eclipse.jgit.api.Git, org.eclipse.jgit.api.errors.GitAPIException, org.eclipse.jgit.diff.DiffEntry, org.eclipse.jgit.diff.DiffFormatter, org.eclipse.jgit.lib.ObjectId, org.eclipse.jgit.lib.ObjectReader, org.eclipse.jgit.lib.Ref, org.eclipse.jgit.lib.Repository, org.eclipse.jgit.treewalk.CanonicalTreeParser

Field Summary

Inherited from org.jabref.logic.git.GitHandler:
credentialsProvidergitPasswordgitUsernameLOGGERrepositoryPathrepositoryPathAsFile

Constructor Summary

AccessConstructor and Description
public
SlrGitHandler(Path
The root of the initialized git repository
repositoryPath
)

Initialize the handler for the given repository

Method Summary

Modifier and TypeMethod and Description
public void
pack-priv void
applyPatch(Map<Path, String> patch)

Applies for each file (specified as keys), the calculated patch (specified as the value) The patch is inserted between the encoding and the contents of the bib files.

pack-priv String

Returns:

Returns the patch (diff) between the head of the sourceBranch and its previous commit HEAD^1
calculatePatchOfNewSearchResults
(String
The name of the branch that is the target of the calculation
sourceBranch
)

Calculates the diff between the HEAD and the previous commit of the sourceBranch.

pack-priv Map<Path, String>

Returns:

Returns a map where each file has its path as a key and the string contains the hunk of new results
parsePatchForAddedEntries
(String
the patch (diff) as a string
patch
)

Applies the provided patch on the current branch Ignores any changes made to the study definition file.

Inherited from org.jabref.logic.git.GitHandler:
checkoutBranchcreateCommitOnCurrentBranchgetCurrentlyCheckedOutBranchgetRefForBranchisGitRepositorymergeBranchespullOnCurrentBranchpushCommitsToRemoteRepositorysetupGitIgnore

Constructor Detail

SlrGitHandlerback to summary
public SlrGitHandler(Path repositoryPath)

Initialize the handler for the given repository

Parameters
repositoryPath:Path

The root of the initialized git repository

Method Detail

appendLatestSearchResultsOntoCurrentBranchback to summary
public void appendLatestSearchResultsOntoCurrentBranch(String patchMessage, String searchBranchName) throws IOException, org.eclipse.jgit.api.errors.GitAPIException
applyPatchback to summary
pack-priv void applyPatch(Map<Path, String> patch)

Applies for each file (specified as keys), the calculated patch (specified as the value) The patch is inserted between the encoding and the contents of the bib files.

calculatePatchOfNewSearchResultsback to summary
pack-priv String calculatePatchOfNewSearchResults(String sourceBranch) throws IOException, org.eclipse.jgit.api.errors.GitAPIException

Calculates the diff between the HEAD and the previous commit of the sourceBranch.

Parameters
sourceBranch:String

The name of the branch that is the target of the calculation

Returns:String

Returns the patch (diff) between the head of the sourceBranch and its previous commit HEAD^1

parsePatchForAddedEntriesback to summary
pack-priv Map<Path, String> parsePatchForAddedEntries(String patch) throws IOException, org.eclipse.jgit.api.errors.GitAPIException

Applies the provided patch on the current branch Ignores any changes made to the study definition file. The reason for this is that the study definition file cannot be patched the same way as the bib files, as the order of fields in the yml file matters.

Parameters
patch:String

the patch (diff) as a string

Returns:Map<Path, String>

Returns a map where each file has its path as a key and the string contains the hunk of new results