public interface GitClient
Since 1.1, this interface is remotable, meaning it can be referenced from a remote closure call.
Modifier and Type | Field and Description |
---|---|
static com.cloudbees.plugins.credentials.CredentialsMatcher |
CREDENTIALS_MATCHER
The supported credential types.
|
static boolean |
quietRemoteBranches
Constant
quietRemoteBranches=Boolean.getBoolean(GitClient.class.getName() + ".quietRemoteBranches") |
static boolean |
verbose
Constant
verbose=Boolean.getBoolean(IGitAPI.class.getName() + ".verbose") |
Modifier and Type | Method and Description |
---|---|
void |
add(String filePattern)
add.
|
void |
addCredentials(String url,
com.cloudbees.plugins.credentials.common.StandardCredentials credentials)
Adds credentials to be used against a specific url.
|
void |
addDefaultCredentials(com.cloudbees.plugins.credentials.common.StandardCredentials credentials)
Adds credentials to be used when there are not url specific credentials defined.
|
void |
addNote(String note,
String namespace)
Adds a new git-note on the current HEAD commit.
|
void |
addRemoteUrl(String name,
String url)
addRemoteUrl.
|
void |
addSubmodule(String remoteURL,
String subdir)
Create a submodule in subdir child directory for remote repository
|
void |
appendNote(String note,
String namespace)
Appends to an existing git-note on the current HEAD commit.
|
void |
branch(String name)
branch.
|
ChangelogCommand |
changelog()
Returns a
ChangelogCommand to build up the git-log invocation. |
void |
changelog(String revFrom,
String revTo,
OutputStream os)
Deprecated.
|
void |
changelog(String revFrom,
String revTo,
Writer os)
Adds the changelog entries for commits in the range revFrom..revTo.
|
CheckoutCommand |
checkout()
checkout.
|
void |
checkout(String ref)
Deprecated.
use
checkout() and CheckoutCommand |
void |
checkout(String ref,
String branch)
Deprecated.
use
checkout() and CheckoutCommand |
void |
checkoutBranch(String branch,
String ref)
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. |
void |
clean()
Fully revert working copy to a clean state, i.e.
|
void |
clean(boolean cleanSubmodule)
Fully revert working copy to a clean state, i.e.
|
void |
clearCredentials()
Remove all credentials from the client.
|
CloneCommand |
clone_()
Returns a
CloneCommand to build up the git-log invocation. |
void |
clone(String url,
String origin,
boolean useShallowClone,
String reference)
Clone a remote repository
|
void |
commit(String message)
commit.
|
void |
commit(String message,
PersonIdent author,
PersonIdent committer)
Deprecated.
as of 1.1
Use
setAuthor(String, String) and setCommitter(String, String)
then call commit(String) |
void |
deleteBranch(String name)
(force) delete a branch.
|
void |
deleteRef(String refName)
Deletes a ref.
|
void |
deleteTag(String tagName)
deleteTag.
|
String |
describe(String commitIsh)
Equivalent of "git-describe --tags".
|
FetchCommand |
fetch_()
fetch_.
|
void |
fetch(String remoteName,
RefSpec... refspec)
Deprecated.
use
fetch_() and configure a FetchCommand |
void |
fetch(String remoteName,
RefSpec refspec)
Deprecated.
use
fetch_() and configure a FetchCommand |
void |
fetch(URIish url,
List<RefSpec> refspecs)
Deprecated.
use
fetch_() and configure a FetchCommand |
Set<Branch> |
getBranches()
getBranches.
|
List<Branch> |
getBranchesContaining(String revspec,
boolean allBranches)
Find all the branches that include the given commit.
|
Map<String,ObjectId> |
getHeadRev(String url)
getHeadRev.
|
ObjectId |
getHeadRev(String remoteRepoUrl,
String branch)
getHeadRev.
|
Set<String> |
getRefNames(String refPrefix)
List refs with the given prefix.
|
Set<Branch> |
getRemoteBranches()
getRemoteBranches.
|
Map<String,ObjectId> |
getRemoteReferences(String remoteRepoUrl,
String pattern,
boolean headsOnly,
boolean tagsOnly)
List references in a remote repository.
|
Map<String,String> |
getRemoteSymbolicReferences(String remoteRepoUrl,
String pattern)
List symbolic references in a remote repository.
|
Set<String> |
getRemoteTagNames(String tagPattern)
getRemoteTagNames.
|
String |
getRemoteUrl(String name)
From a given repository, get a remote's URL
|
Repository |
getRepository()
Deprecated.
as of 1.1
This method was deprecated to make
GitClient remotable. When called on
a proxy object, this method throws NotSerializableException .
Use withRepository(RepositoryCallback) to pass in the closure instead.
This prevents the repository leak (JENKINS-12188), too. |
List<IndexEntry> |
getSubmodules(String treeIsh)
Finds all the submodule references in this repository at the specified tree.
|
String |
getTagMessage(String tagName)
getTagMessage.
|
Set<String> |
getTagNames(String tagPattern)
getTagNames.
|
Set<GitObject> |
getTags()
Return name and object ID of all tags in current repository.
|
hudson.FilePath |
getWorkTree()
The working tree of this repository.
|
boolean |
hasGitModules()
Returns true if the repository has Git submodules.
|
boolean |
hasGitRepo()
hasGitRepo.
|
InitCommand |
init_()
init_.
|
void |
init()
init.
|
boolean |
isCommitInRepo(ObjectId commit)
isCommitInRepo.
|
MergeCommand |
merge()
merge.
|
void |
merge(ObjectId rev)
Deprecated.
use
merge() and configure a MergeCommand |
void |
prune(RemoteConfig repository)
Prune stale remote tracking branches with "git remote prune" on the specified remote.
|
PushCommand |
push()
push.
|
void |
push(String remoteName,
String refspec)
Deprecated.
use
push() and configure a PushCommand |
void |
push(URIish url,
String refspec)
Deprecated.
use
push() and configure a PushCommand |
RebaseCommand |
rebase()
rebase.
|
void |
ref(String refName)
Create (or update) a ref.
|
boolean |
refExists(String refName)
Check if a ref exists.
|
RevListCommand |
revList_()
revList_.
|
List<ObjectId> |
revList(String ref)
revList.
|
List<ObjectId> |
revListAll()
revListAll.
|
ObjectId |
revParse(String revName)
Retrieve commit object that is direct child for
revName revision reference. |
void |
setAuthor(PersonIdent p)
setAuthor.
|
void |
setAuthor(String name,
String email)
Sets the identity of the author for future commits and merge operations.
|
void |
setCommitter(PersonIdent p)
setCommitter.
|
void |
setCommitter(String name,
String email)
Sets the identity of the committer for future commits and merge operations.
|
void |
setCredentials(com.cloudbees.plugins.credentials.common.StandardUsernameCredentials cred)
setCredentials.
|
void |
setProxy(hudson.ProxyConfiguration proxy)
setProxy.
|
void |
setRemoteUrl(String name,
String url)
For a given repository, set a remote's URL
|
void |
setupSubmoduleUrls(Revision rev,
hudson.model.TaskListener listener)
Set up submodule URLs so that they correspond to the remote pertaining to
the revision that has been checked out.
|
List<String> |
showRevision(ObjectId r)
Given a Revision, show it as if it were an entry from git whatchanged, so that it
can be parsed by GitChangeLogParser.
|
List<String> |
showRevision(ObjectId from,
ObjectId to)
Given a Revision, show it as if it were an entry from git whatchanged, so that it
can be parsed by GitChangeLogParser.
|
List<String> |
showRevision(ObjectId from,
ObjectId to,
Boolean useRawOutput)
Given a Revision, show it as if it were an entry from git whatchanged, so that it
can be parsed by GitChangeLogParser.
|
GitClient |
subGit(String subdir)
subGit.
|
void |
submoduleClean(boolean recursive)
submoduleClean.
|
void |
submoduleInit()
submoduleInit.
|
SubmoduleUpdateCommand |
submoduleUpdate()
submoduleUpdate.
|
void |
submoduleUpdate(boolean recursive)
Deprecated.
|
void |
submoduleUpdate(boolean recursive,
boolean remoteTracking)
Deprecated.
|
void |
submoduleUpdate(boolean recursive,
boolean remoteTracking,
String reference)
Deprecated.
|
void |
submoduleUpdate(boolean recursive,
String reference)
Deprecated.
|
void |
tag(String tagName,
String comment)
Create (or update) a tag.
|
boolean |
tagExists(String tagName)
tagExists.
|
<T> T |
withRepository(RepositoryCallback<T> callable)
Runs the computation that requires local access to
Repository . |
static final boolean verbose
verbose=Boolean.getBoolean(IGitAPI.class.getName() + ".verbose")
static final boolean quietRemoteBranches
quietRemoteBranches=Boolean.getBoolean(GitClient.class.getName() + ".quietRemoteBranches")
static final com.cloudbees.plugins.credentials.CredentialsMatcher CREDENTIALS_MATCHER
void clearCredentials()
void addCredentials(String url, com.cloudbees.plugins.credentials.common.StandardCredentials credentials)
url
- the url for the credentials to be used against.credentials
- the credentials to use.void addDefaultCredentials(com.cloudbees.plugins.credentials.common.StandardCredentials credentials)
credentials
- the credentials to use.addCredentials(String, com.cloudbees.plugins.credentials.common.StandardCredentials)
void setAuthor(String name, String email) throws GitException
name
- a String
object.email
- a String
object.GitException
- if underlying git operation fails.void setAuthor(PersonIdent p) throws GitException
p
- a PersonIdent
object.GitException
- if underlying git operation fails.void setCommitter(String name, String email) throws GitException
name
- a String
object.email
- a String
object.GitException
- if underlying git operation fails.void setCommitter(PersonIdent p) throws GitException
p
- a PersonIdent
object.GitException
- if underlying git operation fails.@Deprecated Repository getRepository() throws GitException
GitClient
remotable. When called on
a proxy object, this method throws NotSerializableException
.
Use withRepository(RepositoryCallback)
to pass in the closure instead.
This prevents the repository leak (JENKINS-12188), too.Repository.close()
, to avoid JENKINS-12188.Repository
object.GitException
- if underlying git operation fails.<T> T withRepository(RepositoryCallback<T> callable) throws IOException, InterruptedException
Repository
.T
- type for the repository callbackcallable
- the repository callback used as closure to instanceIOException
- in case of IO errorInterruptedException
- if interruptedhudson.FilePath getWorkTree()
FilePath
object.void init() throws GitException, InterruptedException
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void add(String filePattern) throws GitException, InterruptedException
filePattern
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void commit(String message) throws GitException, InterruptedException
message
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.@Deprecated void commit(String message, PersonIdent author, PersonIdent committer) throws GitException, InterruptedException
setAuthor(String, String)
and setCommitter(String, String)
then call commit(String)
message
- a String
object.author
- a PersonIdent
object.committer
- a PersonIdent
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.boolean hasGitRepo() throws GitException, InterruptedException
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.boolean isCommitInRepo(ObjectId commit) throws GitException, InterruptedException
commit
- a ObjectId
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.String getRemoteUrl(String name) throws GitException, InterruptedException
name
- The name of the remote (e.g. origin)String
object.GitException
- if executing the git command failsInterruptedException
- if interrupted.void setRemoteUrl(String name, String url) throws GitException, InterruptedException
name
- The name of the remote (e.g. origin)url
- The new value of the remote's URLGitException
- if executing the git command failsInterruptedException
- if interrupted.void addRemoteUrl(String name, String url) throws GitException, InterruptedException
name
- a String
object.url
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.@Deprecated void checkout(String ref) throws GitException, InterruptedException
checkout()
and CheckoutCommand
git checkout branch
.)ref
- A git object references expression (either a sha1, tag or branch)GitException
- if underlying git operation fails.InterruptedException
- if interrupted.@Deprecated void checkout(String ref, String branch) throws GitException, InterruptedException
checkout()
and CheckoutCommand
ref
- A git object references expression. For backward compatibility, null
will checkout current HEADbranch
- name of the branch to create from referenceGitException
- if underlying git operation fails.InterruptedException
- if interrupted.CheckoutCommand checkout()
CheckoutCommand
object.void checkoutBranch(@CheckForNull String branch, String ref) throws GitException, InterruptedException
HEAD
points to branch. In other words, the workspace is on the specified branch.
This method is preferred over the checkout(String, String)
family of methods, as
this method is affected far less by the current state of the repository. The checkout
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 checkout(String, String)
.
branch
- a String
object.ref
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void clone(String url, String origin, boolean useShallowClone, String reference) throws GitException, InterruptedException
url
- URL for remote repository to cloneorigin
- upstream track name, defaults to origin
by conventionuseShallowClone
- option to create a shallow clone, that has some restriction but will make clone operationreference
- (optional) reference to a local clone for faster clone operations (reduce network and local storage costs)GitException
- if underlying git operation fails.InterruptedException
- if interrupted.CloneCommand clone_()
CloneCommand
to build up the git-log invocation.CloneCommand
object.@Deprecated void fetch(URIish url, List<RefSpec> refspecs) throws GitException, InterruptedException
fetch_()
and configure a FetchCommand
remote.remoteName.url
has been set.url
- a URIish
object.refspecs
- a List
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.@Deprecated void fetch(String remoteName, RefSpec... refspec) throws GitException, InterruptedException
fetch_()
and configure a FetchCommand
remoteName
- a String
object.refspec
- a RefSpec
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.@Deprecated void fetch(String remoteName, RefSpec refspec) throws GitException, InterruptedException
fetch_()
and configure a FetchCommand
remoteName
- a String
object.refspec
- a RefSpec
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.FetchCommand fetch_()
FetchCommand
object.@Deprecated void push(String remoteName, String refspec) throws GitException, InterruptedException
push()
and configure a PushCommand
remoteName
- a String
object.refspec
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.@Deprecated void push(URIish url, String refspec) throws GitException, InterruptedException
push()
and configure a PushCommand
url
- a URIish
object.refspec
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.PushCommand push()
PushCommand
object.@Deprecated void merge(ObjectId rev) throws GitException, InterruptedException
merge()
and configure a MergeCommand
rev
- a ObjectId
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.MergeCommand merge()
MergeCommand
object.RebaseCommand rebase()
RebaseCommand
object.InitCommand init_()
InitCommand
object.void prune(RemoteConfig repository) throws GitException, InterruptedException
repository
- a RemoteConfig
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void clean() throws GitException, InterruptedException
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void clean(boolean cleanSubmodule) throws GitException, InterruptedException
cleanSubmodule
- flag to add extra -fGitException
- if underlying git operation fails.InterruptedException
- if interrupted.void branch(String name) throws GitException, InterruptedException
name
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void deleteBranch(String name) throws GitException, InterruptedException
name
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.Set<Branch> getBranches() throws GitException, InterruptedException
Set
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.Set<Branch> getRemoteBranches() throws GitException, InterruptedException
Set
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void tag(String tagName, String comment) throws GitException, InterruptedException
git tag --force
)tagName
- a String
object.comment
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.boolean tagExists(String tagName) throws GitException, InterruptedException
tagName
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.String getTagMessage(String tagName) throws GitException, InterruptedException
tagName
- a String
object.String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void deleteTag(String tagName) throws GitException, InterruptedException
tagName
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.Set<String> getTagNames(String tagPattern) throws GitException, InterruptedException
tagPattern
- a String
object.Set
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.Set<String> getRemoteTagNames(String tagPattern) throws GitException, InterruptedException
tagPattern
- a String
object.Set
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void ref(String refName) throws GitException, InterruptedException
git update-ref ... HEAD
).refName
- the full name of the ref (e.g. "refs/myref"). Spaces will be replaced with underscores.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.boolean refExists(String refName) throws GitException, InterruptedException
git show-ref
to zero.refName
- the full name of the ref (e.g. "refs/myref"). Spaces will be replaced with underscores.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void deleteRef(String refName) throws GitException, InterruptedException
git update-ref -d
.refName
- the full name of the ref (e.g. "refs/myref"). Spaces will be replaced with underscores.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.Set<String> getRefNames(String refPrefix) throws GitException, InterruptedException
git for-each-ref --format="%(refname)"
.refPrefix
- the literal prefix any ref returned will have. The empty string implies all.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.Map<String,ObjectId> getHeadRev(String url) throws GitException, InterruptedException
url
- a String
object.Map
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.ObjectId getHeadRev(String remoteRepoUrl, String branch) throws GitException, InterruptedException
remoteRepoUrl
- a String
object.branch
- a String
object.ObjectId
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.Map<String,ObjectId> getRemoteReferences(String remoteRepoUrl, String pattern, boolean headsOnly, boolean tagsOnly) throws GitException, InterruptedException
git ls-remote [--heads] [--tags] <repository> [<refs>]
.remoteRepoUrl
- Remote repository URL.pattern
- Only references matching the given pattern are displayed.headsOnly
- Limit to only refs/heads.tagsOnly
- Limit to only refs/tags.
headsOnly and tagsOnly are not mutually exclusive;
when both are true, references stored in refs/heads and refs/tags are displayed.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.Map<String,String> getRemoteSymbolicReferences(String remoteRepoUrl, String pattern) throws GitException, InterruptedException
git ls-remote --symref <repository>
[<refs>]
. Note: the response may be empty for multiple reasonsremoteRepoUrl
- Remote repository URL.pattern
- Only references matching the given pattern are displayed.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.ObjectId revParse(String revName) throws GitException, InterruptedException
revName
revision reference.revName
- a commit sha1 or tag/branch refnameObjectId
object.GitException
- when no such commit / revName is found in repository.InterruptedException
- if interrupted.RevListCommand revList_()
RevListCommand
object.List<ObjectId> revListAll() throws GitException, InterruptedException
List
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.List<ObjectId> revList(String ref) throws GitException, InterruptedException
ref
- a String
object.List
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.GitClient subGit(String subdir)
subdir
- a String
object.boolean hasGitModules() throws GitException, InterruptedException
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.List<IndexEntry> getSubmodules(String treeIsh) throws GitException, InterruptedException
treeIsh
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void addSubmodule(String remoteURL, String subdir) throws GitException, InterruptedException
remoteURL
- a String
object.subdir
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.@Deprecated void submoduleUpdate(boolean recursive) throws GitException, InterruptedException
submoduleUpdate()
and SubmoduleUpdateCommand
git submodule update --recursive
.)recursive
- a boolean.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.@Deprecated void submoduleUpdate(boolean recursive, String reference) throws GitException, InterruptedException
submoduleUpdate()
and SubmoduleUpdateCommand
git submodule update --recursive --reference 'reference'
.)recursive
- a boolean.reference
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.@Deprecated void submoduleUpdate(boolean recursive, boolean remoteTracking) throws GitException, InterruptedException
submoduleUpdate()
and SubmoduleUpdateCommand
git submodule update --recursive --remote
.)recursive
- a boolean.remoteTracking
- a boolean.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.@Deprecated void submoduleUpdate(boolean recursive, boolean remoteTracking, String reference) throws GitException, InterruptedException
submoduleUpdate()
and SubmoduleUpdateCommand
git submodule update --recursive --remote --reference 'reference'
.)recursive
- a boolean.remoteTracking
- a boolean.reference
- a String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.SubmoduleUpdateCommand submoduleUpdate()
SubmoduleUpdateCommand
object.void submoduleClean(boolean recursive) throws GitException, InterruptedException
recursive
- a boolean.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void submoduleInit() throws GitException, InterruptedException
GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void setupSubmoduleUrls(Revision rev, hudson.model.TaskListener listener) throws GitException, InterruptedException
rev
- a Revision
object.listener
- a TaskListener
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.@Deprecated void changelog(String revFrom, String revTo, OutputStream os) throws GitException, InterruptedException
changelog(String, String, Writer)
revFrom
- a String
object.revTo
- a String
object.os
- a OutputStream
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void changelog(String revFrom, String revTo, Writer os) throws GitException, InterruptedException
changelog()
with appropriate parameters.revFrom
- a String
object.revTo
- a String
object.os
- a Writer
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.ChangelogCommand changelog()
ChangelogCommand
to build up the git-log invocation.ChangelogCommand
object.void appendNote(String note, String namespace) throws GitException, InterruptedException
addNote(String, String)
note
- Content of the note.namespace
- If unqualified, interpreted as "refs/notes/NAMESPACE" just like cgit.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void addNote(String note, String namespace) throws GitException, InterruptedException
note
- Content of the note.namespace
- If unqualified, interpreted as "refs/notes/NAMESPACE" just like cgit.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.List<String> showRevision(ObjectId r) throws GitException, InterruptedException
Changes are computed on the [from..to] range. If from
is null, this prints
just one commit that to
represents.
For merge commit, this method reports one diff per each parent. This makes this method
behave differently from changelog()
.
r
- a ObjectId
object.raw
format.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.List<String> showRevision(ObjectId from, ObjectId to) throws GitException, InterruptedException
Changes are computed on the [from..to] range. If from
is null, this prints
just one commit that to
represents.
For merge commit, this method reports one diff per each parent. This makes this method
behave differently from changelog()
.
from
- a ObjectId
object.to
- a ObjectId
object.raw
format.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.List<String> showRevision(ObjectId from, ObjectId to, Boolean useRawOutput) throws GitException, InterruptedException
If useRawOutput is true, the '--raw' option will include commit file information to be passed to the GitChangeLogParser.
Changes are computed on the [from..to] range. If from
is null, this prints
just one commit that to
represents.
For merge commit, this method reports one diff per each parent. This makes this method
behave differently from changelog()
.
from
- a ObjectId
object.to
- a ObjectId
object.useRawOutput
- a {java.lang.Boolean} object.raw
format.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.String describe(String commitIsh) throws GitException, InterruptedException
commitIsh
- a String
object.String
object.GitException
- if underlying git operation fails.InterruptedException
- if interrupted.void setCredentials(com.cloudbees.plugins.credentials.common.StandardUsernameCredentials cred)
cred
- a StandardUsernameCredentials
object.void setProxy(hudson.ProxyConfiguration proxy)
proxy
- a ProxyConfiguration
object.List<Branch> getBranchesContaining(String revspec, boolean allBranches) throws GitException, InterruptedException
revspec
- commit id to query forallBranches
- whether remote branches should be also queried (true
) or not (false
)GitException
- on Git exceptionsInterruptedException
- on thread interruptionSet<GitObject> getTags() throws GitException, InterruptedException
GitException
- on Git exceptionsInterruptedException
- on thread interruptionCopyright © 2013–2020. All rights reserved.