Guitar
Public Member Functions | Public Attributes | Private Member Functions | List of all members
GitRunner Class Reference

#include <GitRunner.h>

Public Member Functions

 GitRunner ()=default
 
 GitRunner (std::shared_ptr< Git > const &git)
 
 GitRunner (GitRunner const &that)
 
 GitRunner (GitRunner &&that)
 
void operator= (GitRunner const &that)
 
 operator bool () const
 
GitRunner dup () const
 
GitObjectCachegetObjCache ()
 
void clearCommandCache ()
 
void clearObjectCache ()
 
bool isValidWorkingCopy (const std::string &dir) const
 
bool isValidWorkingCopy () const
 
void setWorkingRepositoryDir (const std::string &repo, const std::string &sshkey)
 
void setSubmodulePath (const std::string &submodpath)
 
std::string workingDir () const
 
const std::string & sshKey () const
 
void setSshKey (const std::string &sshkey)
 
std::string getMessage (const std::string &id)
 
std::string errorMessage (std::optional< GitResult > const &var) const
 
bool remove (const std::string &path)
 
GitHash rev_parse (const std::string &name, bool use_cache=true)
 
void setRemoteURL (const GitRemote &remote)
 
void addRemoteURL (const GitRemote &remote)
 
void removeRemote (const std::string &name)
 
std::vector< std::string > getRemotes ()
 
std::string version ()
 
bool init ()
 
std::vector< GitTagtags ()
 
bool tag (const std::string &name, GitHash const &id={})
 
bool delete_tag (const std::string &name, bool remote)
 
void resetFile (const std::string &path)
 
void resetAllFiles ()
 
void removeFile (const std::string &path, bool rm_real_file)
 
GitUser getUser (GitSource purpose)
 
void setUser (GitUser const &user, bool global)
 
std::string getDefaultBranch ()
 
void setDefaultBranch (const std::string &branchname)
 
void unsetDefaultBranch ()
 
DateTime repositoryLastModifiedTime ()
 
std::string status ()
 
bool commit (std::string const &text, bool sign, AbstractPtyProcess *pty)
 
bool commit_amend_m (const std::string &text, bool sign, AbstractPtyProcess *pty)
 
bool revert (const GitHash &id)
 
bool push_tags (AbstractPtyProcess *pty=nullptr)
 
void remote_v (std::vector< GitRemote > *out)
 
void createBranch (const std::string &name)
 
void checkoutBranch (const std::string &name)
 
void mergeBranch (const std::string &name, GitMergeFastForward ff, bool squash)
 
bool deleteBranch (const std::string &name)
 
bool checkout (std::string const &branch_name, std::string const &id={})
 
bool checkout_detach (std::string const &id)
 
void rebaseBranch (const std::string &name)
 
bool rebase_continue ()
 
bool rebase_quit ()
 
bool rebase_abort ()
 
GitCommitItemList log_all (GitHash const &id, int maxcount)
 
GitCommitItemList log_file (const std::string &path, int maxcount)
 
std::vector< GitHashrev_list_all (GitHash const &id, int maxcount)
 
std::optional< GitCommitItemlog_signature (GitHash const &id)
 
GitCommitItemList log (int maxcount)
 
std::optional< GitCommitItemqueryCommitItem (const GitHash &id)
 
std::string rev_parse_show_toplevel ()
 
bool stash ()
 
bool stash_apply ()
 
bool stash_drop ()
 
std::vector< GitSubmoduleItemsubmodules ()
 
bool submodule_add (const GitCloneData &data, bool force, AbstractPtyProcess *pty)
 
bool submodule_update (const GitSubmoduleUpdateData &data, AbstractPtyProcess *pty)
 
std::string queryEntireCommitMessage (const GitHash &id)
 
std::vector< GitDiffRawdiff_raw (GitHash const &old_id, GitHash const &new_id)
 
std::string diff (const std::string &old_id, const std::string &new_id, const GitDiffOption &opt)
 
std::string diff_file (const std::string &old_path, const std::string &new_path, const GitDiffOption &opt)
 
std::string diff_to_file (const std::string &old_id, const std::string &path, const GitDiffOption &opt)
 
std::vector< std::string > diff_name_only_head ()
 
std::string diff_full_index_head_file (const std::string &file)
 
std::vector< GitFileStatusstatus_s_u (std::string *out=nullptr)
 
std::optional< std::vector< char > > cat_file_ (const GitHash &id)
 
GitObject catFile (const GitHash &id, bool use_cache=true)
 
bool clone (GitCloneData const &data, AbstractPtyProcess *pty)
 
void add_A ()
 
bool unstage_all ()
 
void stage (const std::string &path)
 
bool stage (const std::vector< std::string > &paths, AbstractPtyProcess *pty)
 
void unstage (const std::string &path)
 
void unstage (const std::vector< std::string > &paths)
 
bool pull (AbstractPtyProcess *pty=nullptr)
 
bool fetch (AbstractPtyProcess *pty=nullptr, bool prune=false)
 
bool reset_head1 ()
 
bool reset_hard ()
 
bool clean_df ()
 
bool push_u (bool set_upstream, std::string const &remote, std::string const &branch, bool force, AbstractPtyProcess *pty)
 
std::string objectType (const GitHash &id)
 
bool rm_cached (const std::string &file)
 
void cherrypick (const std::string &name)
 
std::string getCherryPicking () const
 
std::vector< GitBranchbranches ()
 
std::string signingKey (GitSource purpose)
 
bool setSigningKey (std::string const &id, bool global)
 
GitSignPolicy signPolicy (GitSource source)
 
bool setSignPolicy (GitSource source, GitSignPolicy policy)
 
bool configGpgProgram (const std::string &path, bool global)
 
std::optional< std::vector< GitReflogItem > > reflog (int maxcount=100)
 
std::vector< char > blame (const std::string &path)
 
std::optional< std::vector< GitFileItem > > ls (const std::string &path)
 
std::optional< std::vector< char > > readfile (const std::string &path)
 

Public Attributes

std::shared_ptr< Gitgit
 

Private Member Functions

Gitgitptr ()
 
Git const * gitptr () const
 

Constructor & Destructor Documentation

◆ GitRunner() [1/4]

GitRunner::GitRunner ( )
default

◆ GitRunner() [2/4]

GitRunner::GitRunner ( std::shared_ptr< Git > const &  git)

◆ GitRunner() [3/4]

GitRunner::GitRunner ( GitRunner const &  that)

◆ GitRunner() [4/4]

GitRunner::GitRunner ( GitRunner &&  that)

Member Function Documentation

◆ add_A()

void GitRunner::add_A ( )
Here is the call graph for this function:

◆ addRemoteURL()

void GitRunner::addRemoteURL ( const GitRemote remote)
Here is the call graph for this function:

◆ blame()

std::vector< char > GitRunner::blame ( const std::string &  path)
Here is the call graph for this function:

◆ branches()

std::vector< GitBranch > GitRunner::branches ( )
Here is the call graph for this function:

◆ cat_file_()

std::optional< std::vector< char > > GitRunner::cat_file_ ( const GitHash id)
Here is the call graph for this function:

◆ catFile()

GitObject GitRunner::catFile ( const GitHash id,
bool  use_cache = true 
)
Here is the call graph for this function:

◆ checkout()

bool GitRunner::checkout ( std::string const &  branch_name,
std::string const &  id = {} 
)
Here is the call graph for this function:

◆ checkout_detach()

bool GitRunner::checkout_detach ( std::string const &  id)
Here is the call graph for this function:

◆ checkoutBranch()

void GitRunner::checkoutBranch ( const std::string &  name)
Here is the call graph for this function:

◆ cherrypick()

void GitRunner::cherrypick ( const std::string &  name)
Here is the call graph for this function:

◆ clean_df()

bool GitRunner::clean_df ( )
Here is the call graph for this function:

◆ clearCommandCache()

void GitRunner::clearCommandCache ( )
Here is the call graph for this function:

◆ clearObjectCache()

void GitRunner::clearObjectCache ( )
Here is the call graph for this function:

◆ clone()

bool GitRunner::clone ( GitCloneData const &  data,
AbstractPtyProcess pty 
)
Here is the call graph for this function:

◆ commit()

bool GitRunner::commit ( std::string const &  text,
bool  sign,
AbstractPtyProcess pty 
)
Here is the call graph for this function:

◆ commit_amend_m()

bool GitRunner::commit_amend_m ( const std::string &  text,
bool  sign,
AbstractPtyProcess pty 
)
Here is the call graph for this function:

◆ configGpgProgram()

bool GitRunner::configGpgProgram ( const std::string &  path,
bool  global 
)
Here is the call graph for this function:

◆ createBranch()

void GitRunner::createBranch ( const std::string &  name)
Here is the call graph for this function:

◆ delete_tag()

bool GitRunner::delete_tag ( const std::string &  name,
bool  remote 
)
Here is the call graph for this function:

◆ deleteBranch()

bool GitRunner::deleteBranch ( const std::string &  name)
Here is the call graph for this function:

◆ diff()

std::string GitRunner::diff ( const std::string &  old_id,
const std::string &  new_id,
const GitDiffOption opt 
)
Here is the call graph for this function:

◆ diff_file()

std::string GitRunner::diff_file ( const std::string &  old_path,
const std::string &  new_path,
const GitDiffOption opt 
)
Here is the call graph for this function:

◆ diff_full_index_head_file()

std::string GitRunner::diff_full_index_head_file ( const std::string &  file)
Here is the call graph for this function:

◆ diff_name_only_head()

std::vector< std::string > GitRunner::diff_name_only_head ( )
Here is the call graph for this function:

◆ diff_raw()

std::vector< GitDiffRaw > GitRunner::diff_raw ( GitHash const &  old_id,
GitHash const &  new_id 
)
Here is the call graph for this function:

◆ diff_to_file()

std::string GitRunner::diff_to_file ( const std::string &  old_id,
const std::string &  path,
const GitDiffOption opt 
)
Here is the call graph for this function:

◆ dup()

GitRunner GitRunner::dup ( ) const
Here is the call graph for this function:

◆ errorMessage()

std::string GitRunner::errorMessage ( std::optional< GitResult > const &  var) const
Here is the call graph for this function:

◆ fetch()

bool GitRunner::fetch ( AbstractPtyProcess pty = nullptr,
bool  prune = false 
)
Here is the call graph for this function:

◆ getCherryPicking()

std::string GitRunner::getCherryPicking ( ) const
Here is the call graph for this function:

◆ getDefaultBranch()

std::string GitRunner::getDefaultBranch ( )
Here is the call graph for this function:

◆ getMessage()

std::string GitRunner::getMessage ( const std::string &  id)
Here is the call graph for this function:

◆ getObjCache()

GitObjectCache * GitRunner::getObjCache ( )
Here is the call graph for this function:

◆ getRemotes()

std::vector< std::string > GitRunner::getRemotes ( )
Here is the call graph for this function:

◆ getUser()

GitUser GitRunner::getUser ( GitSource  purpose)
Here is the call graph for this function:

◆ gitptr() [1/2]

Git* GitRunner::gitptr ( )
inlineprivate

◆ gitptr() [2/2]

Git const* GitRunner::gitptr ( ) const
inlineprivate

◆ init()

bool GitRunner::init ( )
Here is the call graph for this function:

◆ isValidWorkingCopy() [1/2]

bool GitRunner::isValidWorkingCopy ( ) const
Here is the call graph for this function:

◆ isValidWorkingCopy() [2/2]

bool GitRunner::isValidWorkingCopy ( const std::string &  dir) const
Here is the call graph for this function:

◆ log()

GitCommitItemList GitRunner::log ( int  maxcount)
Here is the call graph for this function:

◆ log_all()

GitCommitItemList GitRunner::log_all ( GitHash const &  id,
int  maxcount 
)
Here is the call graph for this function:

◆ log_file()

GitCommitItemList GitRunner::log_file ( const std::string &  path,
int  maxcount 
)
Here is the call graph for this function:

◆ log_signature()

std::optional< GitCommitItem > GitRunner::log_signature ( GitHash const &  id)
Here is the call graph for this function:

◆ ls()

std::optional< std::vector< GitFileItem > > GitRunner::ls ( const std::string &  path)
Here is the call graph for this function:

◆ mergeBranch()

void GitRunner::mergeBranch ( const std::string &  name,
GitMergeFastForward  ff,
bool  squash 
)
Here is the call graph for this function:

◆ objectType()

std::string GitRunner::objectType ( const GitHash id)
Here is the call graph for this function:

◆ operator bool()

GitRunner::operator bool ( ) const
explicit
Here is the call graph for this function:

◆ operator=()

void GitRunner::operator= ( GitRunner const &  that)

◆ pull()

bool GitRunner::pull ( AbstractPtyProcess pty = nullptr)
Here is the call graph for this function:

◆ push_tags()

bool GitRunner::push_tags ( AbstractPtyProcess pty = nullptr)
Here is the call graph for this function:

◆ push_u()

bool GitRunner::push_u ( bool  set_upstream,
std::string const &  remote,
std::string const &  branch,
bool  force,
AbstractPtyProcess pty 
)
Here is the call graph for this function:

◆ queryCommitItem()

std::optional< GitCommitItem > GitRunner::queryCommitItem ( const GitHash id)
Here is the call graph for this function:

◆ queryEntireCommitMessage()

std::string GitRunner::queryEntireCommitMessage ( const GitHash id)
Here is the call graph for this function:

◆ readfile()

std::optional< std::vector< char > > GitRunner::readfile ( const std::string &  path)
Here is the call graph for this function:

◆ rebase_abort()

bool GitRunner::rebase_abort ( )
Here is the call graph for this function:

◆ rebase_continue()

bool GitRunner::rebase_continue ( )
Here is the call graph for this function:

◆ rebase_quit()

bool GitRunner::rebase_quit ( )
Here is the call graph for this function:

◆ rebaseBranch()

void GitRunner::rebaseBranch ( const std::string &  name)
Here is the call graph for this function:

◆ reflog()

std::optional< std::vector< GitReflogItem > > GitRunner::reflog ( int  maxcount = 100)
Here is the call graph for this function:

◆ remote_v()

void GitRunner::remote_v ( std::vector< GitRemote > *  out)
Here is the call graph for this function:

◆ remove()

bool GitRunner::remove ( const std::string &  path)
Here is the call graph for this function:

◆ removeFile()

void GitRunner::removeFile ( const std::string &  path,
bool  rm_real_file 
)
Here is the call graph for this function:

◆ removeRemote()

void GitRunner::removeRemote ( const std::string &  name)
Here is the call graph for this function:

◆ repositoryLastModifiedTime()

DateTime GitRunner::repositoryLastModifiedTime ( )
Here is the call graph for this function:

◆ reset_hard()

bool GitRunner::reset_hard ( )
Here is the call graph for this function:

◆ reset_head1()

bool GitRunner::reset_head1 ( )
Here is the call graph for this function:

◆ resetAllFiles()

void GitRunner::resetAllFiles ( )
Here is the call graph for this function:

◆ resetFile()

void GitRunner::resetFile ( const std::string &  path)
Here is the call graph for this function:

◆ rev_list_all()

std::vector< GitHash > GitRunner::rev_list_all ( GitHash const &  id,
int  maxcount 
)
Here is the call graph for this function:

◆ rev_parse()

GitHash GitRunner::rev_parse ( const std::string &  name,
bool  use_cache = true 
)
Here is the call graph for this function:

◆ rev_parse_show_toplevel()

std::string GitRunner::rev_parse_show_toplevel ( )
Here is the call graph for this function:

◆ revert()

bool GitRunner::revert ( const GitHash id)
Here is the call graph for this function:

◆ rm_cached()

bool GitRunner::rm_cached ( const std::string &  file)
Here is the call graph for this function:

◆ setDefaultBranch()

void GitRunner::setDefaultBranch ( const std::string &  branchname)
Here is the call graph for this function:

◆ setRemoteURL()

void GitRunner::setRemoteURL ( const GitRemote remote)
Here is the call graph for this function:

◆ setSigningKey()

bool GitRunner::setSigningKey ( std::string const &  id,
bool  global 
)
Here is the call graph for this function:

◆ setSignPolicy()

bool GitRunner::setSignPolicy ( GitSource  source,
GitSignPolicy  policy 
)
Here is the call graph for this function:

◆ setSshKey()

void GitRunner::setSshKey ( const std::string &  sshkey)
Here is the call graph for this function:

◆ setSubmodulePath()

void GitRunner::setSubmodulePath ( const std::string &  submodpath)
Here is the call graph for this function:

◆ setUser()

void GitRunner::setUser ( GitUser const &  user,
bool  global 
)
Here is the call graph for this function:

◆ setWorkingRepositoryDir()

void GitRunner::setWorkingRepositoryDir ( const std::string &  repo,
const std::string &  sshkey 
)
Here is the call graph for this function:

◆ signingKey()

std::string GitRunner::signingKey ( GitSource  purpose)
Here is the call graph for this function:

◆ signPolicy()

GitSignPolicy GitRunner::signPolicy ( GitSource  source)
Here is the call graph for this function:

◆ sshKey()

const std::string & GitRunner::sshKey ( ) const
Here is the call graph for this function:

◆ stage() [1/2]

void GitRunner::stage ( const std::string &  path)
Here is the call graph for this function:

◆ stage() [2/2]

bool GitRunner::stage ( const std::vector< std::string > &  paths,
AbstractPtyProcess pty 
)
Here is the call graph for this function:

◆ stash()

bool GitRunner::stash ( )
Here is the call graph for this function:

◆ stash_apply()

bool GitRunner::stash_apply ( )
Here is the call graph for this function:

◆ stash_drop()

bool GitRunner::stash_drop ( )
Here is the call graph for this function:

◆ status()

std::string GitRunner::status ( )
Here is the call graph for this function:

◆ status_s_u()

std::vector< GitFileStatus > GitRunner::status_s_u ( std::string *  out = nullptr)
Here is the call graph for this function:

◆ submodule_add()

bool GitRunner::submodule_add ( const GitCloneData data,
bool  force,
AbstractPtyProcess pty 
)
Here is the call graph for this function:

◆ submodule_update()

bool GitRunner::submodule_update ( const GitSubmoduleUpdateData data,
AbstractPtyProcess pty 
)
Here is the call graph for this function:

◆ submodules()

std::vector< GitSubmoduleItem > GitRunner::submodules ( )
Here is the call graph for this function:

◆ tag()

bool GitRunner::tag ( const std::string &  name,
GitHash const &  id = {} 
)
Here is the call graph for this function:

◆ tags()

std::vector< GitTag > GitRunner::tags ( )
Here is the call graph for this function:

◆ unsetDefaultBranch()

void GitRunner::unsetDefaultBranch ( )
Here is the call graph for this function:

◆ unstage() [1/2]

void GitRunner::unstage ( const std::string &  path)
Here is the call graph for this function:

◆ unstage() [2/2]

void GitRunner::unstage ( const std::vector< std::string > &  paths)
Here is the call graph for this function:

◆ unstage_all()

bool GitRunner::unstage_all ( )
Here is the call graph for this function:

◆ version()

std::string GitRunner::version ( )
Here is the call graph for this function:

◆ workingDir()

std::string GitRunner::workingDir ( ) const
Here is the call graph for this function:

Member Data Documentation

◆ git

std::shared_ptr<Git> GitRunner::git

The documentation for this class was generated from the following files: