hudson.plugins.git
Class GitAPI

java.lang.Object
  extended by org.jenkinsci.plugins.gitclient.CliGitAPIImpl
      extended by hudson.plugins.git.GitAPI
All Implemented Interfaces:
IGitAPI, GitClient

Deprecated.

public class GitAPI
extends CliGitAPIImpl
implements IGitAPI

Backward compatible class to match the one some plugins used to get from git-plugin. Extends CliGitAPIImpl to implement deprecated IGitAPI methods, but delegates supported methods to JGit implementation until Git.USE_CLI is set.

Author:
Nicolas De Loof

Field Summary
 
Fields inherited from interface org.jenkinsci.plugins.gitclient.GitClient
quietRemoteBranches, verbose
 
Constructor Summary
GitAPI(String gitExe, hudson.FilePath repository, hudson.model.TaskListener listener, hudson.EnvVars environment)
          Deprecated. 
GitAPI(String gitExe, hudson.FilePath repository, hudson.model.TaskListener listener, hudson.EnvVars environment, String reference)
          Deprecated. 
GitAPI(String gitExe, File repository, hudson.model.TaskListener listener, hudson.EnvVars environment)
          Deprecated. 
 
Method Summary
 void add(String filePattern)
          Deprecated.  
 void branch(String name)
          Deprecated.  
 void checkout(String ref)
          Deprecated. Checks out the specified commit/tag/branch into the workspace.
 void checkout(String ref, String branch)
          Deprecated. Creates a new branch that points to the specified ref.
 void clean()
          Deprecated. Fully revert working copy to a clean state, i.e. run both git-reset(1) --hard then git-clean(1) for working copy to match a fresh clone.
 void clone(org.eclipse.jgit.transport.RemoteConfig source)
          Deprecated. 
 void clone(org.eclipse.jgit.transport.RemoteConfig rc, boolean useShallowClone)
          Deprecated. 
 void commit(String message)
          Deprecated.  
 void commit(String message, org.eclipse.jgit.lib.PersonIdent author, org.eclipse.jgit.lib.PersonIdent committer)
          Deprecated.  
 void deleteBranch(String name)
          Deprecated. (force) delete a branch.
 void deleteTag(String tagName)
          Deprecated.  
 void fetch()
          Deprecated. 
 void fetch(org.eclipse.jgit.transport.RemoteConfig remoteRepository)
          Deprecated. 
 void fetch(String remoteName, org.eclipse.jgit.transport.RefSpec refspec)
          Deprecated. Fetch a remote repository.
 void fetch(String repository, String refspec)
          Deprecated. 
 String getAllLogEntries(String branch)
          Deprecated. 
 Set<Branch> getBranches()
          Deprecated.  
 List<Branch> getBranchesContaining(String revspec)
          Deprecated. 
 Set<Branch> getRemoteBranches()
          Deprecated.  
 String getRemoteUrl(String name)
          Deprecated. From a given repository, get a remote's URL
 org.eclipse.jgit.lib.Repository getRepository()
          Deprecated. Expose the JGit repository this GitClient is using.
 String getTagMessage(String tagName)
          Deprecated.  
 List<Tag> getTagsOnCommit(String revName)
          Deprecated. 
 boolean hasGitModules(String treeIsh)
          Deprecated. 
 boolean hasGitRepo()
          Deprecated.  
 void init()
          Deprecated.  
 boolean isCommitInRepo(org.eclipse.jgit.lib.ObjectId commit)
          Deprecated.  
 void merge(org.eclipse.jgit.lib.ObjectId rev)
          Deprecated. Merge any changes into the head.
 void merge(String refSpec)
          Deprecated. 
 org.eclipse.jgit.lib.ObjectId mergeBase(org.eclipse.jgit.lib.ObjectId id1, org.eclipse.jgit.lib.ObjectId id2)
          Deprecated. 
 void push(org.eclipse.jgit.transport.RemoteConfig repository, String refspec)
          Deprecated. 
 void push(String remoteName, String refspec)
          Deprecated.  
 void reset()
          Deprecated.  
 List<org.eclipse.jgit.lib.ObjectId> revListBranch(String branchId)
          Deprecated. 
 org.eclipse.jgit.lib.ObjectId revParse(String revName)
          Deprecated. Retrieve commit object that is direct child for revName revision reference.
 void setRemoteUrl(String name, String url)
          Deprecated. For a given repository, set a remote's URL
 void setupSubmoduleUrls(String remote, hudson.model.TaskListener listener)
          Deprecated. 
 List<String> showRevision(Revision r)
          Deprecated. 
 GitClient subGit(String subdir)
          Deprecated.  
 void tag(String tagName, String comment)
          Deprecated. Create (or update) a tag.
 boolean tagExists(String tagName)
          Deprecated.  
 
Methods inherited from class org.jenkinsci.plugins.gitclient.CliGitAPIImpl
addNote, addSubmodule, appendNote, changelog, checkoutBranch, clone, describe, fixSubmoduleUrls, getDefaultRemote, getDefaultRemote, getHeadRev, getRemoteUrl, getSubmodules, getSubmoduleUrl, getTagNames, hasGitModules, hasGitRepo, isBareRepository, isBareRepository, launchCommand, launchCommand, lsTree, prune, reset, revList, revListAll, setRemoteUrl, setSubmoduleUrl, setupSubmoduleUrls, showRevision, showRevision, submoduleClean, submoduleInit, submoduleReset, submoduleSync, submoduleUpdate, validateRevision
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.plugins.git.IGitAPI
changelog, checkoutBranch, describe, fixSubmoduleUrls, getDefaultRemote, getRemoteUrl, getSubmoduleUrl, isBareRepository, isBareRepository, lsTree, reset, setRemoteUrl, setSubmoduleUrl, submoduleInit, submoduleSync
 
Methods inherited from interface org.jenkinsci.plugins.gitclient.GitClient
addNote, addSubmodule, appendNote, clone, getHeadRev, getSubmodules, getTagNames, hasGitModules, prune, revList, revListAll, setupSubmoduleUrls, showRevision, showRevision, submoduleClean, submoduleUpdate
 

Constructor Detail

GitAPI

@Deprecated
public GitAPI(String gitExe,
                         hudson.FilePath repository,
                         hudson.model.TaskListener listener,
                         hudson.EnvVars environment)
Deprecated. 


GitAPI

@Deprecated
public GitAPI(String gitExe,
                         hudson.FilePath repository,
                         hudson.model.TaskListener listener,
                         hudson.EnvVars environment,
                         String reference)
Deprecated. 


GitAPI

@Deprecated
public GitAPI(String gitExe,
                         File repository,
                         hudson.model.TaskListener listener,
                         hudson.EnvVars environment)
Deprecated. 

Method Detail

add

public void add(String filePattern)
         throws GitException
Deprecated. 
Specified by:
add in interface GitClient
Overrides:
add in class CliGitAPIImpl
Throws:
GitException

getRemoteUrl

public String getRemoteUrl(String name)
                    throws GitException
Deprecated. 
Description copied from interface: GitClient
From a given repository, get a remote's URL

Specified by:
getRemoteUrl in interface GitClient
Overrides:
getRemoteUrl in class CliGitAPIImpl
Parameters:
name - The name of the remote (e.g. origin)
Throws:
GitException - if executing the git command fails

push

public void push(String remoteName,
                 String refspec)
          throws GitException
Deprecated. 
Specified by:
push in interface GitClient
Overrides:
push in class CliGitAPIImpl
Throws:
GitException

getTagMessage

public String getTagMessage(String tagName)
                     throws GitException
Deprecated. 
Specified by:
getTagMessage in interface GitClient
Overrides:
getTagMessage in class CliGitAPIImpl
Throws:
GitException

subGit

public GitClient subGit(String subdir)
Deprecated. 
Specified by:
subGit in interface GitClient
Overrides:
subGit in class CliGitAPIImpl
Returns:
a IGitAPI implementation to manage git submodule repository

setRemoteUrl

public void setRemoteUrl(String name,
                         String url)
                  throws GitException
Deprecated. 
Description copied from interface: GitClient
For a given repository, set a remote's URL

Specified by:
setRemoteUrl in interface GitClient
Overrides:
setRemoteUrl in class CliGitAPIImpl
Parameters:
name - The name of the remote (e.g. origin)
url - The new value of the remote's URL
Throws:
GitException - if executing the git command fails

getBranches

public Set<Branch> getBranches()
                        throws GitException
Deprecated. 
Specified by:
getBranches in interface GitClient
Overrides:
getBranches in class CliGitAPIImpl
Throws:
GitException

getRemoteBranches

public Set<Branch> getRemoteBranches()
                              throws GitException
Deprecated. 
Specified by:
getRemoteBranches in interface GitClient
Overrides:
getRemoteBranches in class CliGitAPIImpl
Throws:
GitException

init

public void init()
          throws GitException
Deprecated. 
Specified by:
init in interface GitClient
Overrides:
init in class CliGitAPIImpl
Throws:
GitException

deleteBranch

public void deleteBranch(String name)
                  throws GitException
Deprecated. 
Description copied from interface: GitClient
(force) delete a branch.

Specified by:
deleteBranch in interface GitClient
Overrides:
deleteBranch in class CliGitAPIImpl
Throws:
GitException

checkout

public void checkout(String ref,
                     String branch)
              throws GitException
Deprecated. 
Description copied from interface: GitClient
Creates a new branch that points to the specified ref. (equivalent to git checkout -b branch commit) This will fail if the branch already exists.

Specified by:
checkout in interface GitClient
Overrides:
checkout in class CliGitAPIImpl
Parameters:
ref - A git object references expression. For backward compatibility, null will checkout current HEAD
branch - name of the branch to create from reference
Throws:
GitException

hasGitRepo

public boolean hasGitRepo()
                   throws GitException
Deprecated. 
Specified by:
hasGitRepo in interface GitClient
Overrides:
hasGitRepo in class CliGitAPIImpl
Throws:
GitException

isCommitInRepo

public boolean isCommitInRepo(org.eclipse.jgit.lib.ObjectId commit)
                       throws GitException
Deprecated. 
Specified by:
isCommitInRepo in interface GitClient
Overrides:
isCommitInRepo in class CliGitAPIImpl
Throws:
GitException

commit

public void commit(String message)
            throws GitException
Deprecated. 
Specified by:
commit in interface GitClient
Overrides:
commit in class CliGitAPIImpl
Throws:
GitException

commit

public void commit(String message,
                   org.eclipse.jgit.lib.PersonIdent author,
                   org.eclipse.jgit.lib.PersonIdent committer)
            throws GitException
Deprecated. 
Specified by:
commit in interface GitClient
Overrides:
commit in class CliGitAPIImpl
Throws:
GitException

checkout

public void checkout(String ref)
              throws GitException
Deprecated. 
Description copied from interface: GitClient
Checks out the specified commit/tag/branch into the workspace. (equivalent of git checkout branch.)

Specified by:
checkout in interface GitClient
Overrides:
checkout in class CliGitAPIImpl
Parameters:
ref - A git object references expression (either a sha1, tag or branch)
Throws:
GitException

deleteTag

public void deleteTag(String tagName)
               throws GitException
Deprecated. 
Specified by:
deleteTag in interface GitClient
Overrides:
deleteTag in class CliGitAPIImpl
Throws:
GitException

getRepository

public org.eclipse.jgit.lib.Repository getRepository()
                                              throws GitException
Deprecated. 
Description copied from interface: GitClient
Expose the JGit repository this GitClient is using. Don't forget to call Repository.close(), to avoid JENKINS-12188.

Specified by:
getRepository in interface GitClient
Overrides:
getRepository in class CliGitAPIImpl
Throws:
GitException

tag

public void tag(String tagName,
                String comment)
         throws GitException
Deprecated. 
Description copied from interface: GitClient
Create (or update) a tag. If tag already exist it gets updated (equivalent to git tag --force)

Specified by:
tag in interface GitClient
Overrides:
tag in class CliGitAPIImpl
Throws:
GitException

fetch

public void fetch(String remoteName,
                  org.eclipse.jgit.transport.RefSpec refspec)
           throws GitException
Deprecated. 
Description copied from interface: GitClient
Fetch a remote repository. Assumes remote.remoteName.url has been set.

Specified by:
fetch in interface GitClient
Overrides:
fetch in class CliGitAPIImpl
Throws:
GitException

merge

public void merge(org.eclipse.jgit.lib.ObjectId rev)
           throws GitException
Deprecated. 
Description copied from class: CliGitAPIImpl
Merge any changes into the head.

Specified by:
merge in interface GitClient
Overrides:
merge in class CliGitAPIImpl
Parameters:
rev - the revision
Throws:
GitException - if the emrge fails

tagExists

public boolean tagExists(String tagName)
                  throws GitException
Deprecated. 
Specified by:
tagExists in interface GitClient
Overrides:
tagExists in class CliGitAPIImpl
Throws:
GitException

clean

public void clean()
           throws GitException
Deprecated. 
Description copied from interface: GitClient
Fully revert working copy to a clean state, i.e. run both git-reset(1) --hard then git-clean(1) for working copy to match a fresh clone.

Specified by:
clean in interface GitClient
Overrides:
clean in class CliGitAPIImpl
Throws:
GitException

revParse

public org.eclipse.jgit.lib.ObjectId revParse(String revName)
                                       throws GitException
Deprecated. 
Description copied from interface: GitClient
Retrieve commit object that is direct child for revName revision reference.

Specified by:
revParse in interface GitClient
Overrides:
revParse in class CliGitAPIImpl
Parameters:
revName - a commit sha1 or tag/branch refname
Throws:
GitException - when no such commit / revName is found in repository.

branch

public void branch(String name)
            throws GitException
Deprecated. 
Specified by:
branch in interface GitClient
Overrides:
branch in class CliGitAPIImpl
Throws:
GitException

merge

@Deprecated
public void merge(String refSpec)
           throws GitException
Deprecated. 

Specified by:
merge in interface IGitAPI
Throws:
GitException

hasGitModules

@Deprecated
public boolean hasGitModules(String treeIsh)
                      throws GitException
Deprecated. 

Specified by:
hasGitModules in interface IGitAPI
Throws:
GitException

setupSubmoduleUrls

@Deprecated
public void setupSubmoduleUrls(String remote,
                                          hudson.model.TaskListener listener)
                        throws GitException
Deprecated. 

Specified by:
setupSubmoduleUrls in interface IGitAPI
Throws:
GitException

fetch

@Deprecated
public void fetch(String repository,
                             String refspec)
           throws GitException
Deprecated. 

Specified by:
fetch in interface IGitAPI
Throws:
GitException

fetch

@Deprecated
public void fetch(org.eclipse.jgit.transport.RemoteConfig remoteRepository)
Deprecated. 

Specified by:
fetch in interface IGitAPI

fetch

@Deprecated
public void fetch()
           throws GitException
Deprecated. 

Specified by:
fetch in interface IGitAPI
Overrides:
fetch in class CliGitAPIImpl
Throws:
GitException

reset

public void reset()
           throws GitException
Deprecated. 
Specified by:
reset in interface IGitAPI
Throws:
GitException

push

@Deprecated
public void push(org.eclipse.jgit.transport.RemoteConfig repository,
                            String refspec)
          throws GitException
Deprecated. 

Specified by:
push in interface IGitAPI
Throws:
GitException

clone

@Deprecated
public void clone(org.eclipse.jgit.transport.RemoteConfig source)
           throws GitException
Deprecated. 

Specified by:
clone in interface IGitAPI
Throws:
GitException

clone

@Deprecated
public void clone(org.eclipse.jgit.transport.RemoteConfig rc,
                             boolean useShallowClone)
           throws GitException
Deprecated. 

Specified by:
clone in interface IGitAPI
Throws:
GitException

getBranchesContaining

@Deprecated
public List<Branch> getBranchesContaining(String revspec)
                                   throws GitException
Deprecated. 

Specified by:
getBranchesContaining in interface IGitAPI
Throws:
GitException

revListBranch

@Deprecated
public List<org.eclipse.jgit.lib.ObjectId> revListBranch(String branchId)
                                                  throws GitException
Deprecated. 

Specified by:
revListBranch in interface IGitAPI
Throws:
GitException

showRevision

@Deprecated
public List<String> showRevision(Revision r)
                          throws GitException
Deprecated. 

Specified by:
showRevision in interface IGitAPI
Throws:
GitException

getTagsOnCommit

@Deprecated
public List<Tag> getTagsOnCommit(String revName)
                          throws GitException,
                                 IOException
Deprecated. 

Specified by:
getTagsOnCommit in interface IGitAPI
Throws:
GitException
IOException

mergeBase

@Deprecated
public org.eclipse.jgit.lib.ObjectId mergeBase(org.eclipse.jgit.lib.ObjectId id1,
                                                          org.eclipse.jgit.lib.ObjectId id2)
Deprecated. 

Specified by:
mergeBase in interface IGitAPI

getAllLogEntries

@Deprecated
public String getAllLogEntries(String branch)
Deprecated. 

Specified by:
getAllLogEntries in interface IGitAPI


Copyright © 2004-2013. All Rights Reserved.