|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jenkinsci.plugins.gitclient.CliGitAPIImpl
public class CliGitAPIImpl
Implementation class using command line CLI ran as external command.
For internal use only, dont use directly. See Git
| Field Summary |
|---|
| Fields inherited from interface org.jenkinsci.plugins.gitclient.GitClient |
|---|
verbose |
| Constructor Summary | |
|---|---|
protected |
CliGitAPIImpl(String gitExe,
File workspace,
hudson.model.TaskListener listener,
hudson.EnvVars environment)
|
| Method Summary | |
|---|---|
void |
add(String filePattern)
|
void |
addNote(String note,
String namespace)
|
void |
addSubmodule(String remoteURL,
String subdir)
Create a submodule in subdir child directory for remote repository |
void |
appendNote(String note,
String namespace)
|
void |
branch(String name)
|
void |
changelog(String revFrom,
String revTo,
OutputStream outputStream)
Adds the changelog entries for commits in the range revFrom..revTo. |
void |
checkout(String commit)
Checks out the specified commit/tag/branch into the workspace. |
void |
checkout(String ref,
String branch)
Checks out the specified commit/ref into the workspace, creating specified branch (equivalent to git checkout -b branch commit |
void |
clean()
|
void |
clone(String url,
String origin,
boolean useShallowClone,
String reference)
Clone a remote repository |
void |
commit(String message)
|
void |
deleteBranch(String name)
|
void |
deleteTag(String tagName)
|
String |
describe(String commitIsh)
|
void |
fetch()
|
void |
fetch(String remote,
org.eclipse.jgit.transport.RefSpec refspec)
|
void |
fixSubmoduleUrls(String remote,
hudson.model.TaskListener listener)
Fixes urls for submodule as stored in .git/config and $SUBMODULE/.git/config for when the remote repo is NOT a bare repository. |
Set<Branch> |
getBranches()
|
String |
getDefaultRemote()
Get the default remote. |
String |
getDefaultRemote(String _default_)
|
org.eclipse.jgit.lib.ObjectId |
getHeadRev(String remoteRepoUrl,
String branch)
|
Set<Branch> |
getRemoteBranches()
|
String |
getRemoteUrl(String name)
From a given repository, get a remote's URL |
String |
getRemoteUrl(String name,
String GIT_DIR)
|
org.eclipse.jgit.lib.Repository |
getRepository()
|
List<IndexEntry> |
getSubmodules(String treeIsh)
|
String |
getSubmoduleUrl(String name)
Get submodule URL |
String |
getTagMessage(String tagName)
|
Set<String> |
getTagNames(String tagPattern)
|
boolean |
hasGitModules()
Returns true if the repository has Git submodules. |
boolean |
hasGitRepo()
|
boolean |
hasGitRepo(String GIT_DIR)
|
void |
init()
|
boolean |
isBareRepository()
Detect whether a repository is bare or not. |
boolean |
isBareRepository(String GIT_DIR)
Detect whether a repository at the given path is bare or not. |
boolean |
isCommitInRepo(org.eclipse.jgit.lib.ObjectId commit)
|
String |
launchCommand(hudson.util.ArgumentListBuilder args)
Launch command using the workspace as working directory |
String |
launchCommand(String... args)
Launch command using the workspace as working directory |
List<IndexEntry> |
lsTree(String treeIsh)
|
void |
merge(org.eclipse.jgit.lib.ObjectId rev)
Merge any changes into the head. |
void |
prune(org.eclipse.jgit.transport.RemoteConfig repository)
|
void |
push(String remoteName,
String refspec)
|
void |
reset(boolean hard)
|
List<org.eclipse.jgit.lib.ObjectId> |
revList(String ref)
|
List<org.eclipse.jgit.lib.ObjectId> |
revListAll()
|
org.eclipse.jgit.lib.ObjectId |
revParse(String revName)
|
void |
setRemoteUrl(String name,
String url)
For a given repository, set a remote's URL |
void |
setRemoteUrl(String name,
String url,
String GIT_DIR)
|
void |
setSubmoduleUrl(String name,
String url)
Set submodule 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(org.eclipse.jgit.lib.ObjectId r)
|
List<String> |
showRevision(org.eclipse.jgit.lib.ObjectId from,
org.eclipse.jgit.lib.ObjectId to)
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)
|
void |
submoduleClean(boolean recursive)
Cleans submodules |
void |
submoduleInit()
|
void |
submoduleReset(boolean recursive,
boolean hard)
Reset submodules |
void |
submoduleSync()
Sync submodule URLs |
void |
submoduleUpdate(boolean recursive)
Update submodules. |
void |
tag(String tagName,
String comment)
|
boolean |
tagExists(String tagName)
|
org.eclipse.jgit.lib.ObjectId |
validateRevision(String revName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected CliGitAPIImpl(String gitExe,
File workspace,
hudson.model.TaskListener listener,
hudson.EnvVars environment)
| Method Detail |
|---|
public GitClient subGit(String subdir)
subGit in interface GitClient
public void init()
throws GitException
init in interface GitClientGitException
public boolean hasGitRepo()
throws GitException
hasGitRepo in interface GitClientGitException
public boolean hasGitRepo(String GIT_DIR)
throws GitException
GitException
public boolean hasGitModules()
throws GitException
GitClient
hasGitModules in interface GitClientGitException
public List<IndexEntry> getSubmodules(String treeIsh)
throws GitException
getSubmodules in interface GitClientGitException
public void fetch(String remote,
org.eclipse.jgit.transport.RefSpec refspec)
throws GitException
fetch in interface GitClientGitException
public void fetch()
throws GitException
GitException
public void reset(boolean hard)
throws GitException
GitException
public void clone(String url,
String origin,
boolean useShallowClone,
String reference)
throws GitException
GitClient
clone in interface GitClienturl - 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
public void clean()
throws GitException
clean in interface GitClientGitException
public org.eclipse.jgit.lib.ObjectId revParse(String revName)
throws GitException
revParse in interface GitClientGitException
public org.eclipse.jgit.lib.ObjectId validateRevision(String revName)
throws GitException
GitException
public String describe(String commitIsh)
throws GitException
GitException
public void prune(org.eclipse.jgit.transport.RemoteConfig repository)
throws GitException
prune in interface GitClientGitException
public void changelog(String revFrom,
String revTo,
OutputStream outputStream)
throws GitException
GitClient
changelog in interface GitClientGitException
public List<String> showRevision(org.eclipse.jgit.lib.ObjectId r)
throws GitException
showRevision in interface GitClientGitException
public List<String> showRevision(org.eclipse.jgit.lib.ObjectId from,
org.eclipse.jgit.lib.ObjectId to)
throws GitException
GitClientChanges are computed on the [from..to] range.
showRevision in interface GitClientGitException
public void merge(org.eclipse.jgit.lib.ObjectId rev)
throws GitException
merge in interface GitClientrev - the revision
GitException - if the emrge fails
public void submoduleInit()
throws GitException
GitException
public void addSubmodule(String remoteURL,
String subdir)
throws GitException
GitClient
addSubmodule in interface GitClientGitException
public void submoduleSync()
throws GitException
GitException
public void submoduleUpdate(boolean recursive)
throws GitException
submoduleUpdate in interface GitClientrecursive - if true, will recursively update submodules (requires git>=1.6.5)
GitException - if executing the Git command fails
public void submoduleReset(boolean recursive,
boolean hard)
throws GitException
recursive - if true, will recursively reset submodules (requres git>=1.6.5)
GitException - if executing the git command fails
public void submoduleClean(boolean recursive)
throws GitException
submoduleClean in interface GitClientrecursive - if true, will recursively clean submodules (requres git>=1.6.5)
GitException - if executing the git command fails
public String getSubmoduleUrl(String name)
throws GitException
name - The name of the submodule
GitException - if executing the git command fails
public void setSubmoduleUrl(String name,
String url)
throws GitException
name - The name of the submoduleurl - The new value of the submodule's URL
GitException - if executing the git command fails
public String getRemoteUrl(String name)
throws GitException
GitClient
getRemoteUrl in interface GitClientname - The name of the remote (e.g. origin)
GitException - if executing the git command fails
public void setRemoteUrl(String name,
String url)
throws GitException
GitClient
setRemoteUrl in interface GitClientname - The name of the remote (e.g. origin)url - The new value of the remote's URL
GitException - if executing the git command fails
public String getRemoteUrl(String name,
String GIT_DIR)
throws GitException
GitException
public void setRemoteUrl(String name,
String url,
String GIT_DIR)
throws GitException
GitException
public String getDefaultRemote(String _default_)
throws GitException
GitException
public String getDefaultRemote()
throws GitException
GitException - if executing the git command fails
public boolean isBareRepository()
throws GitException
GitException
public boolean isBareRepository(String GIT_DIR)
throws GitException
GIT_DIR - The path to the repository (must be to .git dir).
GitException
public void fixSubmoduleUrls(String remote,
hudson.model.TaskListener listener)
throws GitException
listener - The task listener.
GitException - if executing the git command fails
public void setupSubmoduleUrls(Revision rev,
hudson.model.TaskListener listener)
throws GitException
setupSubmoduleUrls in interface GitClientGitException
public void tag(String tagName,
String comment)
throws GitException
tag in interface GitClientGitException
public void appendNote(String note,
String namespace)
throws GitException
appendNote in interface GitClientGitException
public void addNote(String note,
String namespace)
throws GitException
addNote in interface GitClientGitException
public String launchCommand(hudson.util.ArgumentListBuilder args)
throws GitException
args -
GitException
public String launchCommand(String... args)
throws GitException
args -
GitException
public void push(String remoteName,
String refspec)
throws GitException
push in interface GitClientGitException
public Set<Branch> getBranches()
throws GitException
getBranches in interface GitClientGitException
public Set<Branch> getRemoteBranches()
throws GitException
getRemoteBranches in interface GitClientGitException
public void checkout(String commit)
throws GitException
GitClient
checkout in interface GitClientcommit - A git object references expression
GitException
public void checkout(String ref,
String branch)
throws GitException
GitClient
checkout in interface GitClientref - A git object references expressionbranch - name of the branch to create from reference
GitException
public boolean tagExists(String tagName)
throws GitException
tagExists in interface GitClientGitException
public void deleteBranch(String name)
throws GitException
deleteBranch in interface GitClientGitException
public void deleteTag(String tagName)
throws GitException
deleteTag in interface GitClientGitException
public List<IndexEntry> lsTree(String treeIsh)
throws GitException
GitException
public List<org.eclipse.jgit.lib.ObjectId> revListAll()
throws GitException
revListAll in interface GitClientGitException
public List<org.eclipse.jgit.lib.ObjectId> revList(String ref)
throws GitException
revList in interface GitClientGitExceptionpublic boolean isCommitInRepo(org.eclipse.jgit.lib.ObjectId commit)
isCommitInRepo in interface GitClient
public void add(String filePattern)
throws GitException
add in interface GitClientGitException
public void branch(String name)
throws GitException
branch in interface GitClientGitException
public void commit(String message)
throws GitException
commit in interface GitClientGitException
public org.eclipse.jgit.lib.Repository getRepository()
throws GitException
getRepository in interface GitClientGitException
public Set<String> getTagNames(String tagPattern)
throws GitException
getTagNames in interface GitClientGitException
public String getTagMessage(String tagName)
throws GitException
getTagMessage in interface GitClientGitException
public org.eclipse.jgit.lib.ObjectId getHeadRev(String remoteRepoUrl,
String branch)
throws GitException
getHeadRev in interface GitClientGitException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||