|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.plugins.git.GitAPI
public class GitAPI
| Constructor Summary | |
|---|---|
GitAPI(String gitExe,
hudson.FilePath workspace,
hudson.model.TaskListener listener,
hudson.EnvVars environment)
|
|
| Method Summary | |
|---|---|
void |
add(String filePattern)
|
void |
branch(String name)
|
void |
changelog(String revFrom,
String revTo,
OutputStream outputStream)
|
void |
checkout(String commitish)
Short for checkoutBranch(null, commitish) |
void |
checkoutBranch(String branch,
String commitish)
Checks out the specified commit/ref into the workspace. |
void |
clean()
|
void |
clone(org.spearce.jgit.transport.RemoteConfig remoteConfig)
Start from scratch and clone the whole repository. |
void |
commit(File f)
|
void |
deleteBranch(String name)
|
void |
deleteTag(String tagName)
|
String |
describe(String commitIsh)
|
void |
fetch()
|
void |
fetch(org.spearce.jgit.transport.RemoteConfig remoteRepository)
|
void |
fetch(String repository,
String 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. |
String |
getAllLogEntries(String branch)
|
List<Branch> |
getBranches()
|
List<Branch> |
getBranchesContaining(String revspec)
|
String |
getDefaultRemote()
Get the default remote. |
String |
getDefaultRemote(String _default_)
Get the default remote. |
hudson.EnvVars |
getEnvironment()
|
String |
getGitExe()
|
List<Branch> |
getRemoteBranches()
|
String |
getRemoteUrl(String name)
Get a remote's URL |
String |
getRemoteUrl(String name,
String GIT_DIR)
From a given repository, get a remote's URL |
List<IndexEntry> |
getSubmodules(String treeIsh)
|
String |
getSubmoduleUrl(String name)
Get submodule URL |
Set<String> |
getTagNames(String tagPattern)
|
List<org.spearce.jgit.lib.Tag> |
getTagsOnCommit(String revName)
|
boolean |
hasGitModules()
|
boolean |
hasGitModules(String treeIsh)
|
boolean |
hasGitRepo()
Returns true if the encapsulated directory has ".git" directory |
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(String sha1)
|
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(String revSpec)
Merge any changes into the head. |
org.spearce.jgit.lib.ObjectId |
mergeBase(org.spearce.jgit.lib.ObjectId id1,
org.spearce.jgit.lib.ObjectId id2)
|
void |
prune(org.spearce.jgit.transport.RemoteConfig repository)
|
void |
push(org.spearce.jgit.transport.RemoteConfig repository,
String refspec)
|
List<org.spearce.jgit.lib.ObjectId> |
revList(String... extraArgs)
|
List<org.spearce.jgit.lib.ObjectId> |
revListAll()
|
List<org.spearce.jgit.lib.ObjectId> |
revListBranch(String branchId)
|
org.spearce.jgit.lib.ObjectId |
revParse(String revName)
|
void |
setRemoteUrl(String name,
String url)
Set a remote's URL |
void |
setRemoteUrl(String name,
String url,
String GIT_DIR)
For a given repository, set a remote's URL |
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. |
void |
setupSubmoduleUrls(String remote,
hudson.model.TaskListener listener)
|
List<String> |
showRevision(Revision r)
Given a Revision, show it as if it were an entry from git whatchanged, so that it can be parsed by GitChangeLogParser. |
void |
submoduleClean(boolean recursive)
Cleans submodules |
void |
submoduleInit()
Init submodules. |
void |
submoduleSync()
Sync submodule URLs |
void |
submoduleUpdate(boolean recursive)
Update submodules. |
void |
tag(String tagName,
String comment)
|
boolean |
tagExists(String tagName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GitAPI(String gitExe,
hudson.FilePath workspace,
hudson.model.TaskListener listener,
hudson.EnvVars environment)
| Method Detail |
|---|
public String getGitExe()
getGitExe in interface IGitAPIpublic hudson.EnvVars getEnvironment()
getEnvironment in interface IGitAPI
public void init()
throws GitException
init in interface IGitAPIGitException
public boolean hasGitRepo()
throws GitException
IGitAPI
hasGitRepo in interface IGitAPIGitException
public boolean hasGitRepo(String GIT_DIR)
throws GitException
GitException
public boolean hasGitModules()
throws GitException
hasGitModules in interface IGitAPIGitException
public List<IndexEntry> getSubmodules(String treeIsh)
throws GitException
getSubmodules in interface IGitAPIGitException
public boolean hasGitModules(String treeIsh)
throws GitException
hasGitModules in interface IGitAPIGitException
public void fetch(String repository,
String refspec)
throws GitException
fetch in interface IGitAPIGitException
public void fetch()
throws GitException
fetch in interface IGitAPIGitException
public void clone(org.spearce.jgit.transport.RemoteConfig remoteConfig)
throws GitException
clone in interface IGitAPIremoteConfig - remote config
GitException - if deleting or cloning the workspace fails
public void clean()
throws GitException
clean in interface IGitAPIGitException
public org.spearce.jgit.lib.ObjectId revParse(String revName)
throws GitException
revParse in interface IGitAPIGitException
public String describe(String commitIsh)
throws GitException
describe in interface IGitAPIGitException
public void prune(org.spearce.jgit.transport.RemoteConfig repository)
throws GitException
prune in interface IGitAPIGitException
public void changelog(String revFrom,
String revTo,
OutputStream outputStream)
throws GitException
changelog in interface IGitAPIGitException
public List<String> showRevision(Revision r)
throws GitException
showRevision in interface IGitAPIr - The Revision object
GitException - if errors were encountered running git show.
public void merge(String revSpec)
throws GitException
merge in interface IGitAPIrevSpec - the revision
GitException - if the emrge fails
public void submoduleInit()
throws GitException
submoduleInit in interface IGitAPIGitException - if executing the Git command fails
public void submoduleSync()
throws GitException
submoduleSync in interface IGitAPIGitException
public void submoduleUpdate(boolean recursive)
throws GitException
submoduleUpdate in interface IGitAPIrecursive - if true, will recursively update submodules (requires git>=1.6.5)
GitException - if executing the Git command fails
public void submoduleClean(boolean recursive)
throws GitException
submoduleClean in interface IGitAPIrecursive - 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
getSubmoduleUrl in interface IGitAPIname - The name of the submodule
GitException - if executing the git command fails
public void setSubmoduleUrl(String name,
String url)
throws GitException
setSubmoduleUrl in interface IGitAPIname - 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
getRemoteUrl in interface IGitAPIname - The name of the remote (e.g. origin)
GitException - if executing the git command fails
public void setRemoteUrl(String name,
String url)
throws GitException
setRemoteUrl in interface IGitAPIname - 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
getRemoteUrl in interface IGitAPIname - The name of the remote (e.g. origin)GIT_DIR - The path to the repository (must be to .git dir)
GitException - if executing the git command fails
public void setRemoteUrl(String name,
String url,
String GIT_DIR)
throws GitException
setRemoteUrl in interface IGitAPIname - The name of the remote (e.g. origin)url - The new value of the remote's URLGIT_DIR - The path to the repository (must be to .git dir)
GitException - if executing the git command fails
public String getDefaultRemote(String _default_)
throws GitException
getDefaultRemote in interface IGitAPI_default_ - The default remote to use if more than one exists.
GitException - if executing the git command fails
public String getDefaultRemote()
throws GitException
GitException - if executing the git command fails
public boolean isBareRepository()
throws GitException
isBareRepository in interface IGitAPIGitException
public boolean isBareRepository(String GIT_DIR)
throws GitException
isBareRepository in interface IGitAPIGIT_DIR - The path to the repository (must be to .git dir).
GitException
public void fixSubmoduleUrls(String remote,
hudson.model.TaskListener listener)
throws GitException
fixSubmoduleUrls in interface IGitAPIlistener - The task listener.
GitException - if executing the git command fails
public void setupSubmoduleUrls(Revision rev,
hudson.model.TaskListener listener)
throws GitException
setupSubmoduleUrls in interface IGitAPIGitException
public void setupSubmoduleUrls(String remote,
hudson.model.TaskListener listener)
throws GitException
setupSubmoduleUrls in interface IGitAPIGitException
public void tag(String tagName,
String comment)
throws GitException
tag in interface IGitAPIGitException
public String launchCommand(hudson.util.ArgumentListBuilder args)
throws GitException
args -
GitException
public String launchCommand(String... args)
throws GitException
args -
GitException
public void push(org.spearce.jgit.transport.RemoteConfig repository,
String refspec)
throws GitException
push in interface IGitAPIGitException
public List<Branch> getBranches()
throws GitException
getBranches in interface IGitAPIGitException
public List<Branch> getRemoteBranches()
throws GitException,
IOException
getRemoteBranches in interface IGitAPIGitException
IOException
public List<Branch> getBranchesContaining(String revspec)
throws GitException
getBranchesContaining in interface IGitAPIGitException
public void checkout(String commitish)
throws GitException
IGitAPIcheckoutBranch(null, commitish)
checkout in interface IGitAPIGitException
public void checkoutBranch(String branch,
String commitish)
throws GitException
IGitAPI
checkoutBranch in interface IGitAPIbranch - If non-null, move/create the branch in this name at the specified commit-ish and check out that branch.
GitException
public boolean tagExists(String tagName)
throws GitException
tagExists in interface IGitAPIGitException
public void deleteBranch(String name)
throws GitException
deleteBranch in interface IGitAPIGitException
public void deleteTag(String tagName)
throws GitException
deleteTag in interface IGitAPIGitException
public List<IndexEntry> lsTree(String treeIsh)
throws GitException
lsTree in interface IGitAPIGitException
public List<org.spearce.jgit.lib.ObjectId> revListAll()
throws GitException
revListAll in interface IGitAPIGitException
public List<org.spearce.jgit.lib.ObjectId> revListBranch(String branchId)
throws GitException
revListBranch in interface IGitAPIGitException
public List<org.spearce.jgit.lib.ObjectId> revList(String... extraArgs)
throws GitException
GitExceptionpublic boolean isCommitInRepo(String sha1)
isCommitInRepo in interface IGitAPI
public void add(String filePattern)
throws GitException
add in interface IGitAPIGitException
public void branch(String name)
throws GitException
branch in interface IGitAPIGitException
public void commit(File f)
throws GitException
commit in interface IGitAPIGitException
public void fetch(org.spearce.jgit.transport.RemoteConfig remoteRepository)
throws GitException
fetch in interface IGitAPIGitException
public org.spearce.jgit.lib.ObjectId mergeBase(org.spearce.jgit.lib.ObjectId id1,
org.spearce.jgit.lib.ObjectId id2)
mergeBase in interface IGitAPIpublic String getAllLogEntries(String branch)
getAllLogEntries in interface IGitAPI
public List<org.spearce.jgit.lib.Tag> getTagsOnCommit(String revName)
throws GitException,
IOException
getTagsOnCommit in interface IGitAPIGitException
IOException
public Set<String> getTagNames(String tagPattern)
throws GitException
getTagNames in interface IGitAPIGitException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||