KiCad PCB EDA Suite
Loading...
Searching...
No Matches
GIT_BACKEND Class Referenceabstract

#include <git_backend.h>

Inheritance diagram for GIT_BACKEND:
LIBGIT_BACKEND

Public Member Functions

virtual ~GIT_BACKEND ()=default
 
virtual void Init ()=0
 
virtual void Shutdown ()=0
 
KIGIT_ORPHAN_REGISTRY & OrphanRegistry ()
 Return the process-wide orphan thread registry owned by this backend.
 
virtual bool IsLibraryAvailable ()=0
 
virtual bool Clone (GIT_CLONE_HANDLER *aHandler)=0
 
virtual CommitResult Commit (GIT_COMMIT_HANDLER *aHandler, const std::vector< wxString > &aFiles, const wxString &aMessage, const wxString &aAuthorName, const wxString &aAuthorEmail)=0
 
virtual CommitResult Amend (GIT_COMMIT_HANDLER *aHandler, const std::vector< wxString > &aFiles, const wxString &aMessage, const wxString &aAuthorName, const wxString &aAuthorEmail)=0
 
virtual UndoCommitResult UndoLastCommit (GIT_COMMIT_HANDLER *aHandler, const wxString &aExpectedBranch, const git_oid &aExpectedHead, wxString &aMessage)=0
 Move aExpectedBranch back to the parent of aExpectedHead, leaving the index and working files as they are.
 
virtual PushResult Push (GIT_PUSH_HANDLER *aHandler, bool aForce=false)=0
 
virtual std::map< wxString, FileStatus > GetFileStatus (GIT_STATUS_HANDLER *aHandler, const wxString &aPathspec, bool aChangedOnly)=0
 
virtual wxString GetCurrentBranchName (GIT_STATUS_HANDLER *aHandler)=0
 
virtual void UpdateRemoteStatus (GIT_STATUS_HANDLER *aHandler, const std::set< wxString > &aLocalChanges, const std::set< wxString > &aRemoteChanges, std::map< wxString, FileStatus > &aFileStatus)=0
 
virtual wxString GetWorkingDirectory (GIT_STATUS_HANDLER *aHandler)=0
 
virtual bool GetConfigString (GIT_CONFIG_HANDLER *aHandler, const wxString &aKey, wxString &aValue)=0
 
virtual bool IsRepository (GIT_INIT_HANDLER *aHandler, const wxString &aPath)=0
 
virtual InitResult InitializeRepository (GIT_INIT_HANDLER *aHandler, const wxString &aPath)=0
 
virtual bool SetupRemote (GIT_INIT_HANDLER *aHandler, const RemoteConfig &aConfig)=0
 
virtual BranchResult SwitchToBranch (GIT_BRANCH_HANDLER *aHandler, const wxString &aBranchName)=0
 
virtual bool PerformFetch (GIT_PULL_HANDLER *aHandler, bool aSkipLock)=0
 
virtual PullResult PerformPull (GIT_PULL_HANDLER *aHandler)=0
 
virtual git_repository * GetRepositoryForFile (const char *aFilename, wxString *aError, wxString *aTrustCommand)=0
 aError receives why git refused to open the repository, and aTrustCommand the command that trusts it when another user owns it.
 
virtual int CreateBranch (git_repository *aRepo, const wxString &aBranchName, const wxString &aFrom)=0
 
virtual bool RemoveVCS (git_repository *&aRepo, const wxString &aProjectPath, bool aRemoveGitDir, wxString *aErrors)=0
 
virtual bool DeleteBranch (git_repository *aRepo, const wxString &aBranchName)=0
 
virtual bool StashSave (git_repository *aRepo, const wxString &aMessage)=0
 
virtual bool StashApply (git_repository *aRepo, size_t aIndex)=0
 
virtual bool StashPop (git_repository *aRepo, size_t aIndex)=0
 
virtual bool StashDrop (git_repository *aRepo, size_t aIndex)=0
 
virtual bool CreateTag (git_repository *aRepo, const wxString &aName, const wxString &aMessage)=0
 
virtual bool DeleteTag (git_repository *aRepo, const wxString &aName)=0
 
virtual bool CheckoutTag (git_repository *aRepo, const wxString &aName)=0
 
virtual bool AddRemote (git_repository *aRepo, const wxString &aName, const wxString &aUrl)=0
 
virtual bool SetRemoteUrl (git_repository *aRepo, const wxString &aName, const wxString &aUrl)=0
 
virtual bool RemoveRemote (git_repository *aRepo, const wxString &aName)=0
 
virtual bool SetUserConfig (git_repository *aRepo, const wxString &aName, const wxString &aEmail)=0
 
virtual RestoreResult RestoreVersion (KIGIT_COMMON &aCommon, const wxString &aCommitHash, KIGIT_ERROR_MESSAGE &aError)=0
 
virtual bool DiscardChanges (git_repository *aRepo, const std::vector< wxString > &aPaths, wxString &aError)=0
 
virtual bool IsPathInHead (git_repository *aRepo, const wxString &aPath)=0
 
virtual bool AbandonOperation (git_repository *aRepo, wxString &aError)=0
 Drop a merge, rebase, cherry-pick or revert left in progress and return to the last commit.
 
virtual bool GetMergeConflicts (git_repository *aRepo, const wxString &aStageDir, wxString &aHeadOid, wxString &aTheirsOid, std::vector< KIGIT_CONFLICT_SIDES > &aConflicts, wxString &aError)=0
 
virtual MergeCommitResult CreateMergedCommit (git_repository *aRepo, const wxString &aExpectedHeadOid, const wxString &aTheirsOid, const std::vector< std::pair< wxString, wxString > > &aResolvedFiles, KIGIT_ERROR_MESSAGE &aError)=0
 

Protected Attributes

KIGIT_ORPHAN_REGISTRY m_orphanRegistry
 

Detailed Description

Definition at line 90 of file git_backend.h.

Constructor & Destructor Documentation

◆ ~GIT_BACKEND()

virtual GIT_BACKEND::~GIT_BACKEND ( )
virtualdefault

Member Function Documentation

◆ AbandonOperation()

virtual bool GIT_BACKEND::AbandonOperation ( git_repository * aRepo,
wxString & aError )
pure virtual

Drop a merge, rebase, cherry-pick or revert left in progress and return to the last commit.

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::AbandonOperation().

◆ AddRemote()

virtual bool GIT_BACKEND::AddRemote ( git_repository * aRepo,
const wxString & aName,
const wxString & aUrl )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::AddRemote().

◆ Amend()

virtual CommitResult GIT_BACKEND::Amend ( GIT_COMMIT_HANDLER * aHandler,
const std::vector< wxString > & aFiles,
const wxString & aMessage,
const wxString & aAuthorName,
const wxString & aAuthorEmail )
pure virtual

Implemented in LIBGIT_BACKEND.

Referenced by GIT_COMMIT_HANDLER::PerformAmend().

◆ CheckoutTag()

virtual bool GIT_BACKEND::CheckoutTag ( git_repository * aRepo,
const wxString & aName )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::CheckoutTag().

◆ Clone()

virtual bool GIT_BACKEND::Clone ( GIT_CLONE_HANDLER * aHandler)
pure virtual

Implemented in LIBGIT_BACKEND.

Referenced by GIT_CLONE_HANDLER::PerformClone().

◆ Commit()

virtual CommitResult GIT_BACKEND::Commit ( GIT_COMMIT_HANDLER * aHandler,
const std::vector< wxString > & aFiles,
const wxString & aMessage,
const wxString & aAuthorName,
const wxString & aAuthorEmail )
pure virtual

Implemented in LIBGIT_BACKEND.

Referenced by GIT_COMMIT_HANDLER::PerformCommit().

◆ CreateBranch()

virtual int GIT_BACKEND::CreateBranch ( git_repository * aRepo,
const wxString & aBranchName,
const wxString & aFrom )
pure virtual

◆ CreateMergedCommit()

virtual MergeCommitResult GIT_BACKEND::CreateMergedCommit ( git_repository * aRepo,
const wxString & aExpectedHeadOid,
const wxString & aTheirsOid,
const std::vector< std::pair< wxString, wxString > > & aResolvedFiles,
KIGIT_ERROR_MESSAGE & aError )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::CreateMergedCommit().

◆ CreateTag()

virtual bool GIT_BACKEND::CreateTag ( git_repository * aRepo,
const wxString & aName,
const wxString & aMessage )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::CreateTag().

◆ DeleteBranch()

virtual bool GIT_BACKEND::DeleteBranch ( git_repository * aRepo,
const wxString & aBranchName )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::DeleteBranch().

◆ DeleteTag()

virtual bool GIT_BACKEND::DeleteTag ( git_repository * aRepo,
const wxString & aName )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::DeleteTag().

◆ DiscardChanges()

virtual bool GIT_BACKEND::DiscardChanges ( git_repository * aRepo,
const std::vector< wxString > & aPaths,
wxString & aError )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::DiscardChanges().

◆ GetConfigString()

virtual bool GIT_BACKEND::GetConfigString ( GIT_CONFIG_HANDLER * aHandler,
const wxString & aKey,
wxString & aValue )
pure virtual

◆ GetCurrentBranchName()

virtual wxString GIT_BACKEND::GetCurrentBranchName ( GIT_STATUS_HANDLER * aHandler)
pure virtual

◆ GetFileStatus()

virtual std::map< wxString, FileStatus > GIT_BACKEND::GetFileStatus ( GIT_STATUS_HANDLER * aHandler,
const wxString & aPathspec,
bool aChangedOnly )
pure virtual

Implemented in LIBGIT_BACKEND.

Referenced by GIT_STATUS_HANDLER::GetFileStatus().

◆ GetMergeConflicts()

virtual bool GIT_BACKEND::GetMergeConflicts ( git_repository * aRepo,
const wxString & aStageDir,
wxString & aHeadOid,
wxString & aTheirsOid,
std::vector< KIGIT_CONFLICT_SIDES > & aConflicts,
wxString & aError )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::GetMergeConflicts().

◆ GetRepositoryForFile()

virtual git_repository * GIT_BACKEND::GetRepositoryForFile ( const char * aFilename,
wxString * aError,
wxString * aTrustCommand )
pure virtual

aError receives why git refused to open the repository, and aTrustCommand the command that trusts it when another user owns it.

Both are untouched otherwise.

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT::PROJECT_GIT_UTILS::GetRepositoryForFile().

◆ GetWorkingDirectory()

virtual wxString GIT_BACKEND::GetWorkingDirectory ( GIT_STATUS_HANDLER * aHandler)
pure virtual

◆ Init()

virtual void GIT_BACKEND::Init ( )
pure virtual

◆ InitializeRepository()

virtual InitResult GIT_BACKEND::InitializeRepository ( GIT_INIT_HANDLER * aHandler,
const wxString & aPath )
pure virtual

◆ IsLibraryAvailable()

virtual bool GIT_BACKEND::IsLibraryAvailable ( )
pure virtual

Implemented in LIBGIT_BACKEND.

Referenced by PROJECT_TREE_PANE::showContextMenu().

◆ IsPathInHead()

virtual bool GIT_BACKEND::IsPathInHead ( git_repository * aRepo,
const wxString & aPath )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::IsPathInHead().

◆ IsRepository()

virtual bool GIT_BACKEND::IsRepository ( GIT_INIT_HANDLER * aHandler,
const wxString & aPath )
pure virtual

Implemented in LIBGIT_BACKEND.

Referenced by GIT_INIT_HANDLER::IsRepository().

◆ OrphanRegistry()

KIGIT_ORPHAN_REGISTRY & GIT_BACKEND::OrphanRegistry ( )
inline

Return the process-wide orphan thread registry owned by this backend.

Callers that abandon a long-running git operation must route their cleanup thread through this registry so the shutdown path can wait for libgit2 workers to finish before calling git_libgit2_shutdown().

Definition at line 108 of file git_backend.h.

References m_orphanRegistry.

Referenced by KIGIT::PROJECT_GIT_UTILS::SafeFreeRepository(), and KIGIT::StartTransfer().

◆ PerformFetch()

virtual bool GIT_BACKEND::PerformFetch ( GIT_PULL_HANDLER * aHandler,
bool aSkipLock )
pure virtual

Implemented in LIBGIT_BACKEND.

Referenced by GIT_PULL_HANDLER::PerformFetch().

◆ PerformPull()

virtual PullResult GIT_BACKEND::PerformPull ( GIT_PULL_HANDLER * aHandler)
pure virtual

Implemented in LIBGIT_BACKEND.

Referenced by GIT_PULL_HANDLER::PerformPull().

◆ Push()

virtual PushResult GIT_BACKEND::Push ( GIT_PUSH_HANDLER * aHandler,
bool aForce = false )
pure virtual

Implemented in LIBGIT_BACKEND.

Referenced by GIT_PUSH_HANDLER::PerformPush().

◆ RemoveRemote()

virtual bool GIT_BACKEND::RemoveRemote ( git_repository * aRepo,
const wxString & aName )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::RemoveRemote().

◆ RemoveVCS()

virtual bool GIT_BACKEND::RemoveVCS ( git_repository *& aRepo,
const wxString & aProjectPath,
bool aRemoveGitDir,
wxString * aErrors )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT::PROJECT_GIT_UTILS::RemoveVCS().

◆ RestoreVersion()

virtual RestoreResult GIT_BACKEND::RestoreVersion ( KIGIT_COMMON & aCommon,
const wxString & aCommitHash,
KIGIT_ERROR_MESSAGE & aError )
pure virtual

Implemented in LIBGIT_BACKEND.

Referenced by KIGIT_COMMON::RestoreVersion().

◆ SetRemoteUrl()

virtual bool GIT_BACKEND::SetRemoteUrl ( git_repository * aRepo,
const wxString & aName,
const wxString & aUrl )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::SetRemoteUrl().

◆ SetupRemote()

virtual bool GIT_BACKEND::SetupRemote ( GIT_INIT_HANDLER * aHandler,
const RemoteConfig & aConfig )
pure virtual

Implemented in LIBGIT_BACKEND.

Referenced by GIT_INIT_HANDLER::SetupRemote().

◆ SetUserConfig()

virtual bool GIT_BACKEND::SetUserConfig ( git_repository * aRepo,
const wxString & aName,
const wxString & aEmail )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::SetUserConfig().

◆ Shutdown()

virtual void GIT_BACKEND::Shutdown ( )
pure virtual

Implemented in LIBGIT_BACKEND.

◆ StashApply()

virtual bool GIT_BACKEND::StashApply ( git_repository * aRepo,
size_t aIndex )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::StashApply().

◆ StashDrop()

virtual bool GIT_BACKEND::StashDrop ( git_repository * aRepo,
size_t aIndex )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::StashDrop().

◆ StashPop()

virtual bool GIT_BACKEND::StashPop ( git_repository * aRepo,
size_t aIndex )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::StashPop().

◆ StashSave()

virtual bool GIT_BACKEND::StashSave ( git_repository * aRepo,
const wxString & aMessage )
pure virtual

Implemented in LIBGIT_BACKEND.

References git_repository.

Referenced by KIGIT_COMMON::StashSave().

◆ SwitchToBranch()

virtual BranchResult GIT_BACKEND::SwitchToBranch ( GIT_BRANCH_HANDLER * aHandler,
const wxString & aBranchName )
pure virtual

Implemented in LIBGIT_BACKEND.

Referenced by GIT_BRANCH_HANDLER::SwitchToBranch().

◆ UndoLastCommit()

virtual UndoCommitResult GIT_BACKEND::UndoLastCommit ( GIT_COMMIT_HANDLER * aHandler,
const wxString & aExpectedBranch,
const git_oid & aExpectedHead,
wxString & aMessage )
pure virtual

Move aExpectedBranch back to the parent of aExpectedHead, leaving the index and working files as they are.

aMessage receives the undone commit's full message, or on Published the remote-tracking branch holding it.

Implemented in LIBGIT_BACKEND.

Referenced by GIT_COMMIT_HANDLER::PerformUndoLastCommit().

◆ UpdateRemoteStatus()

virtual void GIT_BACKEND::UpdateRemoteStatus ( GIT_STATUS_HANDLER * aHandler,
const std::set< wxString > & aLocalChanges,
const std::set< wxString > & aRemoteChanges,
std::map< wxString, FileStatus > & aFileStatus )
pure virtual

Member Data Documentation

◆ m_orphanRegistry

KIGIT_ORPHAN_REGISTRY GIT_BACKEND::m_orphanRegistry
protected

Definition at line 202 of file git_backend.h.

Referenced by OrphanRegistry(), and LIBGIT_BACKEND::Shutdown().


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