Package hudson.plugins.git
Interface IGitAPI
- All Superinterfaces:
GitClient
- All Known Implementing Classes:
CliGitAPIImpl
,GitAPI
,JGitAPIImpl
Deprecated.
methods here are deprecated until proven useful by a plugin
IGitAPI interface.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jenkinsci.plugins.gitclient.GitClient
GitClient.ConfigLevel
-
Field Summary
Fields inherited from interface org.jenkinsci.plugins.gitclient.GitClient
CREDENTIALS_MATCHER, quietRemoteBranches, verbose
-
Method Summary
Modifier and TypeMethodDescriptionvoid
changelog
(String revFrom, String revTo, OutputStream fos) Deprecated.changelog.void
checkoutBranch
(String branch, String commitish) Deprecated.Regardless of the current state of the workspace (whether there is some dirty files, etc) and the state of the repository (whether the branch of the specified name exists or not), when this method exits the following conditions hold: The branch of the specified name branch exists and points to the specified refHEAD
points to branch.void
clone
(org.eclipse.jgit.transport.RemoteConfig source) Deprecated.Clone repository from source to this repository.void
clone
(org.eclipse.jgit.transport.RemoteConfig rc, boolean useShallowClone) Deprecated.Clone repository fromRemoteConfig
rc to this repository.void
fetch()
Deprecated.Retrieve commits from default remote.void
Deprecated.Retrieve commits based on refspec from repository.void
fetch
(org.eclipse.jgit.transport.RemoteConfig remoteRepository) Deprecated.Retrieve commits from RemoteConfig.void
fixSubmoduleUrls
(String remote, TaskListener listener) Deprecated.fixSubmoduleUrls.getAllLogEntries
(String branch) Deprecated.getBranchesContaining
(String revspec) Deprecated.UseGitClient.getBranchesContaining(String, boolean)
instead.getDefaultRemote
(String _default_) Deprecated.Returns name of default remote.getRemoteUrl
(String name, String GIT_DIR) Deprecated.Returns URL of remote name in repository GIT_DIR.getSubmoduleUrl
(String name) Deprecated.Returns URL of the named submodule.getTagsOnCommit
(String revName) Deprecated.getTagsOnCommit.boolean
hasGitModules
(String treeIsh) Deprecated.Returns true if this repository has submodules.boolean
Deprecated.Returns true if this repository is bare.boolean
isBareRepository
(String GIT_DIR) Deprecated.Detect whether a repository at the given path is bare or not.Deprecated.UselsTree(String, boolean)
to be explicit about the recursion behaviour.Deprecated.lsTree.void
Deprecated.Merge commits from revspec into the current branch.org.eclipse.jgit.lib.ObjectId
mergeBase
(org.eclipse.jgit.lib.ObjectId sha1, org.eclipse.jgit.lib.ObjectId sha2) Deprecated.mergeBase.void
Deprecated.Push revspec to repository.void
reset()
Deprecated.Reset the contents of the working directory of this repository.void
reset
(boolean hard) Deprecated.Reset the contents of the working directory of this repository.List<org.eclipse.jgit.lib.ObjectId>
revListBranch
(String branchId) Deprecated.revListBranch.void
setRemoteUrl
(String name, String url, String GIT_DIR) Deprecated.Set remote repository name and URL.void
setSubmoduleUrl
(String name, String url) Deprecated.Sets URL of the named submodule.void
setupSubmoduleUrls
(String remote, TaskListener listener) Deprecated.Deprecated.showRevision.void
Deprecated.Synchronizes submodules' remote URL configuration setting to the value specified in .gitmodules.Methods inherited from interface org.jenkinsci.plugins.gitclient.GitClient
add, addCredentials, addDefaultCredentials, addNote, addRemoteUrl, addSubmodule, appendNote, branch, changelog, changelog, checkout, checkout, checkout, clean, clean, clearCredentials, clone, clone_, commit, commit, config, deleteBranch, deleteRef, deleteTag, describe, fetch, fetch, fetch, fetch_, getBranches, getBranchesContaining, getHeadRev, getHeadRev, getRefNames, getRemoteBranches, getRemoteReferences, getRemoteSymbolicReferences, getRemoteTagNames, getRemoteUrl, getRepository, getSubmodules, getTagMessage, getTagNames, getTags, getWorkTree, hasGitModules, hasGitRepo, hasGitRepo, init, init_, isCommitInRepo, maintenance, merge, merge, prune, push, push, push, rebase, ref, refExists, revList, revList_, revListAll, revParse, setAuthor, setAuthor, setCommitter, setCommitter, setCredentials, setProxy, setRemoteUrl, setupSubmoduleUrls, showRevision, showRevision, showRevision, subGit, submoduleClean, submoduleInit, submoduleUpdate, submoduleUpdate, submoduleUpdate, submoduleUpdate, submoduleUpdate, tag, tagExists, withRepository
-
Method Details
-
hasGitModules
Deprecated.Returns true if this repository has submodules.- Parameters:
treeIsh
- an ignored argument, kept for compatibility- Returns:
- true if this repository has submodules (git modules file)
- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.- See Also:
-
getRemoteUrl
Deprecated.Returns URL of remote name in repository GIT_DIR.- Parameters:
name
- name for the remote repository, for example, "origin"GIT_DIR
- directory containing git repository- Returns:
- URL of remote "name" in repository GIT_DIR.
- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
setRemoteUrl
void setRemoteUrl(String name, String url, String GIT_DIR) throws GitException, InterruptedException Deprecated.Set remote repository name and URL.- Parameters:
name
- name for the remote repository, for example, "origin"url
- URL for the remote repository, for example https://github.com/jenkinsci/git-client-plugin.gitGIT_DIR
- directory containing git repository- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
getDefaultRemote
Deprecated.Returns name of default remote.- Parameters:
_default_
- value to return if no remote is defined in this repository- Returns:
- name of default remote
- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
isBareRepository
Deprecated.Returns true if this repository is bare.- Returns:
- true if this repository is bare
- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
isBareRepository
Deprecated.Detect whether a repository at the given path is bare or not.- Parameters:
GIT_DIR
- The path to the repository (must be to .git dir).- Returns:
- true if this repository is bare
- Throws:
GitException
- on failureInterruptedException
- if interrupted
-
submoduleSync
Deprecated.Synchronizes submodules' remote URL configuration setting to the value specified in .gitmodules. Refer to git submodule sync documentation for more details.- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
getSubmoduleUrl
Deprecated.Returns URL of the named submodule.- Parameters:
name
- submodule name whose URL will be returned- Returns:
- URL of the named submodule
- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
setSubmoduleUrl
Deprecated.Sets URL of the named submodule.- Parameters:
name
- submodule name whose URL will be seturl
- URL for the named submodule- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
fixSubmoduleUrls
void fixSubmoduleUrls(String remote, TaskListener listener) throws GitException, InterruptedException Deprecated.fixSubmoduleUrls.- Parameters:
remote
- aString
object.listener
- aTaskListener
object.- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
setupSubmoduleUrls
void setupSubmoduleUrls(String remote, TaskListener listener) throws GitException, InterruptedException Deprecated.- Throws:
GitException
InterruptedException
-
fetch
Deprecated.Retrieve commits based on refspec from repository.- Parameters:
repository
- URL of the repository to be retrievedrefspec
- definition of mapping from remote refs to local refs- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
fetch
void fetch(org.eclipse.jgit.transport.RemoteConfig remoteRepository) throws GitException, InterruptedException Deprecated.Retrieve commits from RemoteConfig.- Parameters:
remoteRepository
- remote configuration from which refs will be retrieved- Throws:
InterruptedException
- if interrupted.GitException
-
fetch
Deprecated.Retrieve commits from default remote.- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
reset
Deprecated.Reset the contents of the working directory of this repository. Refer to git reset documentation.- Parameters:
hard
- reset as though "--hard" were passed to "git reset"- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
reset
Deprecated.Reset the contents of the working directory of this repository. Refer to git reset documentation.- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
push
void push(org.eclipse.jgit.transport.RemoteConfig repository, String revspec) throws GitException, InterruptedException Deprecated.Push revspec to repository.- Parameters:
repository
- git repository to receive commitsrevspec
- commits to be pushed- Throws:
GitException
- if underlying git operating failsInterruptedException
- if interrupted
-
merge
Deprecated.Merge commits from revspec into the current branch.- Parameters:
revSpec
- the revision specification to be merged (for example, origin/main)- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
clone
void clone(org.eclipse.jgit.transport.RemoteConfig source) throws GitException, InterruptedException Deprecated.Clone repository from source to this repository.- Parameters:
source
- remote repository to be cloned- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
clone
void clone(org.eclipse.jgit.transport.RemoteConfig rc, boolean useShallowClone) throws GitException, InterruptedException Deprecated.Clone repository fromRemoteConfig
rc to this repository.- Parameters:
rc
- the remote config for the remote repositoryuseShallowClone
- if true, use a shallow clone- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
getBranchesContaining
@Deprecated List<Branch> getBranchesContaining(String revspec) throws GitException, InterruptedException Deprecated.UseGitClient.getBranchesContaining(String, boolean)
instead. This method does work only with local branches on one implementation and with all the branches - in the otherFind all the branches that include the given commit.- Parameters:
revspec
- substring to be searched for branch name- Returns:
- list of branches containing revspec
- Throws:
GitException
- on failureInterruptedException
- if interrupted
-
lsTree
Deprecated.UselsTree(String, boolean)
to be explicit about the recursion behaviour.This method has been implemented as non-recursive historically, but often that is not what the caller wants.- Parameters:
treeIsh
- string representation of a treeIsh item- Returns:
- list of IndexEntry items starting at treeIsh
- Throws:
GitException
- on failureInterruptedException
- if interrupted
-
lsTree
List<IndexEntry> lsTree(String treeIsh, boolean recursive) throws GitException, InterruptedException Deprecated.lsTree.- Parameters:
treeIsh
- aString
object.recursive
- a boolean.- Returns:
- a
List
object. - Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
revListBranch
List<org.eclipse.jgit.lib.ObjectId> revListBranch(String branchId) throws GitException, InterruptedException Deprecated.revListBranch.- Parameters:
branchId
- aString
object.- Returns:
- a
List
object. - Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
getTagsOnCommit
Deprecated.getTagsOnCommit.- Parameters:
revName
- aString
object.- Returns:
- a
List
object. - Throws:
GitException
- if underlying git operation fails.IOException
- if any IO failureInterruptedException
- if interrupted.
-
changelog
void changelog(String revFrom, String revTo, OutputStream fos) throws GitException, InterruptedException Deprecated.changelog.- Specified by:
changelog
in interfaceGitClient
- Parameters:
revFrom
- aString
object.revTo
- aString
object.fos
- aOutputStream
object.- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
checkoutBranch
Deprecated.Regardless of the current state of the workspace (whether there is some dirty files, etc) and the state of the repository (whether the branch of the specified name exists or not), when this method exits the following conditions hold:- The branch of the specified name branch exists and points to the specified ref
HEAD
points to branch. In other words, the workspace is on the specified branch.- Both index and workspace are the same tree with ref. (no dirty files and no staged changes, although this method will not touch untracked files in the workspace.)
This method is preferred over the
GitClient.checkout(String, String)
family of methods, as this method is affected far less by the current state of the repository. Thecheckout
methods, in their attempt to emulate the "git checkout" command line behaviour, have too many side effects. In Jenkins, where you care a lot less about throwing away local changes and care a lot more about resetting the workspace into a known state, methods like this is more useful.For compatibility reasons, the order of the parameter is different from
GitClient.checkout(String, String)
.- Specified by:
checkoutBranch
in interfaceGitClient
- Parameters:
branch
- aString
object.commitish
- aString
object.- Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
mergeBase
org.eclipse.jgit.lib.ObjectId mergeBase(org.eclipse.jgit.lib.ObjectId sha1, org.eclipse.jgit.lib.ObjectId sha2) throws GitException, InterruptedException Deprecated.mergeBase.- Parameters:
sha1
- aObjectId
object.sha2
- aObjectId
object.- Returns:
- a
ObjectId
object. - Throws:
InterruptedException
- if interrupted.GitException
-
showRevision
Deprecated.showRevision.- Parameters:
r
- aRevision
object.- Returns:
- a
List
object. - Throws:
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.
-
getAllLogEntries
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Deprecated String getAllLogEntries(String branch) throws GitException, InterruptedException Deprecated.This method makes no sense, in that it lists all log entries across all refs and yet it takes a meaningless 'branch' parameter. Please do not use this.- Parameters:
branch
- aString
object.- Returns:
- a
String
object. - Throws:
InterruptedException
- if interrupted.GitException
-