Class ProjectGitController

java.lang.Object
ca.phon.app.project.git.ProjectGitController

public class ProjectGitController extends Object
  • Constructor Details

    • ProjectGitController

      public ProjectGitController(Project project)
  • Method Details

    • closeRepository

      public void closeRepository()
    • getProject

      public Project getProject()
    • getRepositoryFolder

      public File getRepositoryFolder()
      Get the folder for the git repository.
      Returns:
      folder for git repository
    • hasGitFolder

      public boolean hasGitFolder()
      Is the project under git control
      Returns:
      true if the .git folder exists, false otherwise
    • init

      public org.eclipse.jgit.api.Git init() throws IOException, IllegalStateException, org.eclipse.jgit.api.errors.GitAPIException
      Setup a new git repository for the project.
      Returns:
      the new git instance
      Throws:
      org.eclipse.jgit.api.errors.GitAPIException
      IllegalStateException
      IOException
    • setupDefaultGitIgnore

      public void setupDefaultGitIgnore() throws IOException
      Throws:
      IOException
    • open

      public org.eclipse.jgit.api.Git open() throws IOException
      Open existing repository for project
      Returns:
      git instance
      Throws:
      IOException
    • isOpen

      public boolean isOpen()
    • status

      public org.eclipse.jgit.api.Status status() throws org.eclipse.jgit.errors.NoWorkTreeException, org.eclipse.jgit.api.errors.GitAPIException
      Get status of repository.
      Returns:
      repository status
      Throws:
      org.eclipse.jgit.api.errors.GitAPIException
      org.eclipse.jgit.errors.NoWorkTreeException
    • status

      public org.eclipse.jgit.api.Status status(String path) throws org.eclipse.jgit.errors.NoWorkTreeException, org.eclipse.jgit.api.errors.GitAPIException
      Throws:
      org.eclipse.jgit.errors.NoWorkTreeException
      org.eclipse.jgit.api.errors.GitAPIException
    • statis

      public org.eclipse.jgit.api.Status statis(String... paths) throws org.eclipse.jgit.errors.NoWorkTreeException, org.eclipse.jgit.api.errors.GitAPIException
      Throws:
      org.eclipse.jgit.errors.NoWorkTreeException
      org.eclipse.jgit.api.errors.GitAPIException
    • printStatus

      public void printStatus(Writer writer) throws IOException, org.eclipse.jgit.api.errors.GitAPIException
      Throws:
      IOException
      org.eclipse.jgit.api.errors.GitAPIException
    • addToIndex

      public org.eclipse.jgit.dircache.DirCache addToIndex(String filepattern) throws org.eclipse.jgit.api.errors.NoFilepatternException, org.eclipse.jgit.api.errors.GitAPIException
      Add files to current index.
      Parameters:
      filepattern -
      Throws:
      org.eclipse.jgit.api.errors.GitAPIException
      org.eclipse.jgit.api.errors.NoFilepatternException
    • commit

      public org.eclipse.jgit.revwalk.RevCommit commit(String message) throws org.eclipse.jgit.api.errors.NoHeadException, org.eclipse.jgit.api.errors.NoMessageException, org.eclipse.jgit.api.errors.UnmergedPathsException, org.eclipse.jgit.api.errors.ConcurrentRefUpdateException, org.eclipse.jgit.api.errors.WrongRepositoryStateException, org.eclipse.jgit.api.errors.AbortedByHookException, org.eclipse.jgit.api.errors.GitAPIException
      Commit changes to repository.
      Parameters:
      message -
      Throws:
      org.eclipse.jgit.api.errors.GitAPIException
      org.eclipse.jgit.api.errors.AbortedByHookException
      org.eclipse.jgit.api.errors.WrongRepositoryStateException
      org.eclipse.jgit.api.errors.ConcurrentRefUpdateException
      org.eclipse.jgit.api.errors.UnmergedPathsException
      org.eclipse.jgit.api.errors.NoMessageException
      org.eclipse.jgit.api.errors.NoHeadException
    • commitAllChanges

      public org.eclipse.jgit.revwalk.RevCommit commitAllChanges(String message) throws org.eclipse.jgit.api.errors.NoHeadException, org.eclipse.jgit.api.errors.NoMessageException, org.eclipse.jgit.api.errors.UnmergedPathsException, org.eclipse.jgit.api.errors.ConcurrentRefUpdateException, org.eclipse.jgit.api.errors.WrongRepositoryStateException, org.eclipse.jgit.api.errors.AbortedByHookException, org.eclipse.jgit.api.errors.GitAPIException
      Commit all changes to repository.
      Parameters:
      message -
      Returns:
      commit revision
      Throws:
      org.eclipse.jgit.api.errors.NoHeadException
      org.eclipse.jgit.api.errors.NoMessageException
      org.eclipse.jgit.api.errors.UnmergedPathsException
      org.eclipse.jgit.api.errors.ConcurrentRefUpdateException
      org.eclipse.jgit.api.errors.WrongRepositoryStateException
      org.eclipse.jgit.api.errors.AbortedByHookException
      org.eclipse.jgit.api.errors.GitAPIException
    • pull

      public org.eclipse.jgit.api.PullResult pull() throws org.eclipse.jgit.api.errors.WrongRepositoryStateException, org.eclipse.jgit.api.errors.InvalidConfigurationException, org.eclipse.jgit.api.errors.DetachedHeadException, org.eclipse.jgit.api.errors.InvalidRemoteException, org.eclipse.jgit.api.errors.CanceledException, org.eclipse.jgit.api.errors.RefNotFoundException, org.eclipse.jgit.api.errors.RefNotAdvertisedException, org.eclipse.jgit.api.errors.NoHeadException, org.eclipse.jgit.api.errors.TransportException, org.eclipse.jgit.api.errors.GitAPIException
      Pull from repository. This is the same as calling 'git pull' without args.
      Returns:
      pull result
      Throws:
      org.eclipse.jgit.api.errors.GitAPIException
      org.eclipse.jgit.api.errors.TransportException
      org.eclipse.jgit.api.errors.NoHeadException
      org.eclipse.jgit.api.errors.RefNotAdvertisedException
      org.eclipse.jgit.api.errors.RefNotFoundException
      org.eclipse.jgit.api.errors.CanceledException
      org.eclipse.jgit.api.errors.InvalidRemoteException
      org.eclipse.jgit.api.errors.DetachedHeadException
      org.eclipse.jgit.api.errors.InvalidConfigurationException
      org.eclipse.jgit.api.errors.WrongRepositoryStateException
    • pull

      public org.eclipse.jgit.api.PullResult pull(org.eclipse.jgit.lib.ProgressMonitor monitor) throws org.eclipse.jgit.api.errors.WrongRepositoryStateException, org.eclipse.jgit.api.errors.InvalidConfigurationException, org.eclipse.jgit.api.errors.DetachedHeadException, org.eclipse.jgit.api.errors.InvalidRemoteException, org.eclipse.jgit.api.errors.CanceledException, org.eclipse.jgit.api.errors.RefNotFoundException, org.eclipse.jgit.api.errors.RefNotAdvertisedException, org.eclipse.jgit.api.errors.NoHeadException, org.eclipse.jgit.api.errors.TransportException, org.eclipse.jgit.api.errors.GitAPIException
      Pull from repository. This is the same as calling 'git pull' without args.
      Parameters:
      monitor -
      Returns:
      pull result
      Throws:
      org.eclipse.jgit.api.errors.GitAPIException
      org.eclipse.jgit.api.errors.TransportException
      org.eclipse.jgit.api.errors.NoHeadException
      org.eclipse.jgit.api.errors.RefNotAdvertisedException
      org.eclipse.jgit.api.errors.RefNotFoundException
      org.eclipse.jgit.api.errors.CanceledException
      org.eclipse.jgit.api.errors.InvalidRemoteException
      org.eclipse.jgit.api.errors.DetachedHeadException
      org.eclipse.jgit.api.errors.InvalidConfigurationException
      org.eclipse.jgit.api.errors.WrongRepositoryStateException
    • pull

      public org.eclipse.jgit.api.PullResult pull(String remote, String branch, org.eclipse.jgit.lib.ProgressMonitor monitor) throws org.eclipse.jgit.api.errors.WrongRepositoryStateException, org.eclipse.jgit.api.errors.InvalidConfigurationException, org.eclipse.jgit.api.errors.DetachedHeadException, org.eclipse.jgit.api.errors.InvalidRemoteException, org.eclipse.jgit.api.errors.CanceledException, org.eclipse.jgit.api.errors.RefNotFoundException, org.eclipse.jgit.api.errors.RefNotAdvertisedException, org.eclipse.jgit.api.errors.NoHeadException, org.eclipse.jgit.api.errors.TransportException, org.eclipse.jgit.api.errors.GitAPIException
      Pull from repository
      Parameters:
      remote -
      branch -
      monitor -
      Throws:
      org.eclipse.jgit.api.errors.GitAPIException
      org.eclipse.jgit.api.errors.TransportException
      org.eclipse.jgit.api.errors.NoHeadException
      org.eclipse.jgit.api.errors.RefNotAdvertisedException
      org.eclipse.jgit.api.errors.RefNotFoundException
      org.eclipse.jgit.api.errors.CanceledException
      org.eclipse.jgit.api.errors.InvalidRemoteException
      org.eclipse.jgit.api.errors.DetachedHeadException
      org.eclipse.jgit.api.errors.InvalidConfigurationException
      org.eclipse.jgit.api.errors.WrongRepositoryStateException
    • push

      public Iterable<org.eclipse.jgit.transport.PushResult> push(String remote, org.eclipse.jgit.lib.ProgressMonitor monitor) throws org.eclipse.jgit.api.errors.InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException, org.eclipse.jgit.api.errors.GitAPIException
      Push changes
      Parameters:
      remote -
      mointor -
      Throws:
      org.eclipse.jgit.api.errors.GitAPIException
      org.eclipse.jgit.api.errors.TransportException
      org.eclipse.jgit.api.errors.InvalidRemoteException
    • push

      public Iterable<org.eclipse.jgit.transport.PushResult> push(org.eclipse.jgit.lib.ProgressMonitor monitor) throws org.eclipse.jgit.api.errors.InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException, org.eclipse.jgit.api.errors.GitAPIException
      Throws:
      org.eclipse.jgit.api.errors.InvalidRemoteException
      org.eclipse.jgit.api.errors.TransportException
      org.eclipse.jgit.api.errors.GitAPIException