KiCad PCB EDA Suite
Loading...
Searching...
No Matches
GIT_COMMIT_HANDLER Class Reference

#include <git_commit_handler.h>

Inheritance diagram for GIT_COMMIT_HANDLER:
KIGIT_COMMON KIGIT_ERRORS

Public Types

enum class  CommitResult { Success , Error , Cancelled }
 
enum class  GIT_STATUS {
  GIT_STATUS_UNTRACKED , GIT_STATUS_CURRENT , GIT_STATUS_MODIFIED , GIT_STATUS_ADDED ,
  GIT_STATUS_DELETED , GIT_STATUS_BEHIND , GIT_STATUS_AHEAD , GIT_STATUS_CONFLICTED ,
  GIT_STATUS_LAST
}
 
enum class  GIT_CONN_TYPE { GIT_CONN_HTTPS = 0 , GIT_CONN_SSH , GIT_CONN_LOCAL , GIT_CONN_LAST }
 

Public Member Functions

 GIT_COMMIT_HANDLER (git_repository *aRepo)
 
virtual ~GIT_COMMIT_HANDLER ()
 
CommitResult PerformCommit (const std::vector< std::string > &aFilesToCommit)
 
std::string GetErrorString () const
 
git_repository * GetRepo () const
 
void SetRepo (git_repository *aRepo)
 
wxString GetCurrentBranchName () const
 
std::vector< wxString > GetBranchNames () const
 
virtual void UpdateProgress (int aCurrent, int aTotal, const wxString &aMessage)
 
std::vector< wxString > GetProjectDirs ()
 Return a vector of project files in the repository.
 
std::pair< std::set< wxString >, std::set< wxString > > GetDifferentFiles () const
 Return a pair of sets of files that differ locally from the remote repository The first set is files that have been committed locally but not pushed The second set is files that have been committed remotely but not pulled.
 
wxString GetUsername () const
 
wxString GetPassword () const
 
GIT_CONN_TYPE GetConnType () const
 
void SetUsername (const wxString &aUsername)
 
void SetPassword (const wxString &aPassword)
 
void SetSSHKey (const wxString &aSSHKey)
 
void SetConnType (GIT_CONN_TYPE aConnType)
 
void SetConnType (unsigned aConnType)
 
unsigned & TestedTypes ()
 
bool HasLocalCommits () const
 
bool HasPushAndPullRemote () const
 
void UpdateCurrentBranchInfo ()
 
wxString GetRemotename () const
 
void ResetNextKey ()
 
wxString GetNextPublicKey ()
 
const std::vector< wxString > & GetErrorStrings () const
 
const wxString & PeekErrorString () const
 
wxString GetErrorString ()
 
void AddErrorString (const wxString aErrorString)
 
void AddErrorString (const std::string aErrorString)
 
void ClearErrorStrings ()
 

Protected Attributes

git_repository * m_repo
 
GIT_CONN_TYPE m_connType
 
wxString m_remote
 
wxString m_hostname
 
wxString m_username
 
wxString m_password
 
unsigned m_testedTypes
 

Private Member Functions

void AddErrorString (const std::string &aErrorString)
 
void updatePublicKeys ()
 
void updateConnectionType ()
 

Private Attributes

std::string m_errorString
 
std::vector< wxString > m_publicKeys
 
int m_nextPublicKey
 
std::vector< wxString > m_errorStrings
 

Detailed Description

Definition at line 35 of file git_commit_handler.h.

Member Enumeration Documentation

◆ CommitResult

Enumerator
Success 
Error 
Cancelled 

Definition at line 41 of file git_commit_handler.h.

◆ GIT_CONN_TYPE

enum class KIGIT_COMMON::GIT_CONN_TYPE
stronginherited
Enumerator
GIT_CONN_HTTPS 
GIT_CONN_SSH 
GIT_CONN_LOCAL 
GIT_CONN_LAST 

Definition at line 82 of file kicad_git_common.h.

◆ GIT_STATUS

enum class KIGIT_COMMON::GIT_STATUS
stronginherited
Enumerator
GIT_STATUS_UNTRACKED 
GIT_STATUS_CURRENT 
GIT_STATUS_MODIFIED 
GIT_STATUS_ADDED 
GIT_STATUS_DELETED 
GIT_STATUS_BEHIND 
GIT_STATUS_AHEAD 
GIT_STATUS_CONFLICTED 
GIT_STATUS_LAST 

Definition at line 69 of file kicad_git_common.h.

Constructor & Destructor Documentation

◆ GIT_COMMIT_HANDLER()

GIT_COMMIT_HANDLER::GIT_COMMIT_HANDLER ( git_repository *  aRepo)

Definition at line 26 of file git_commit_handler.cpp.

◆ ~GIT_COMMIT_HANDLER()

GIT_COMMIT_HANDLER::~GIT_COMMIT_HANDLER ( )
virtual

Definition at line 31 of file git_commit_handler.cpp.

Member Function Documentation

◆ AddErrorString() [1/3]

void GIT_COMMIT_HANDLER::AddErrorString ( const std::string &  aErrorString)
private

Definition at line 48 of file git_commit_handler.cpp.

References m_errorString.

◆ AddErrorString() [2/3]

void KIGIT_ERRORS::AddErrorString ( const std::string  aErrorString)
inlineinherited

Definition at line 66 of file kicad_git_errors.h.

References KIGIT_ERRORS::m_errorStrings.

◆ AddErrorString() [3/3]

◆ ClearErrorStrings()

void KIGIT_ERRORS::ClearErrorStrings ( )
inlineinherited

Definition at line 71 of file kicad_git_errors.h.

References KIGIT_ERRORS::m_errorStrings.

◆ GetBranchNames()

std::vector< wxString > KIGIT_COMMON::GetBranchNames ( ) const
inherited

Definition at line 81 of file kicad_git_common.cpp.

References KIGIT_COMMON::m_repo.

Referenced by PROJECT_TREE_PANE::onRight().

◆ GetConnType()

GIT_CONN_TYPE KIGIT_COMMON::GetConnType ( ) const
inlineinherited

Definition at line 92 of file kicad_git_common.h.

References KIGIT_COMMON::m_connType.

Referenced by credentials_cb().

◆ GetCurrentBranchName()

wxString KIGIT_COMMON::GetCurrentBranchName ( ) const
inherited

Definition at line 49 of file kicad_git_common.cpp.

References KIGIT_COMMON::m_repo.

◆ GetDifferentFiles()

std::pair< std::set< wxString >, std::set< wxString > > KIGIT_COMMON::GetDifferentFiles ( ) const
inherited

Return a pair of sets of files that differ locally from the remote repository The first set is files that have been committed locally but not pushed The second set is files that have been committed remotely but not pulled.

Definition at line 200 of file kicad_git_common.cpp.

References delta, and KIGIT_COMMON::m_repo.

Referenced by PROJECT_TREE_PANE::updateGitStatusIcons().

◆ GetErrorString() [1/2]

wxString KIGIT_ERRORS::GetErrorString ( )
inlineinherited

◆ GetErrorString() [2/2]

std::string GIT_COMMIT_HANDLER::GetErrorString ( ) const

Definition at line 42 of file git_commit_handler.cpp.

References m_errorString.

◆ GetErrorStrings()

const std::vector< wxString > & KIGIT_ERRORS::GetErrorStrings ( ) const
inlineinherited

Definition at line 38 of file kicad_git_errors.h.

References KIGIT_ERRORS::m_errorStrings.

◆ GetNextPublicKey()

wxString KIGIT_COMMON::GetNextPublicKey ( )
inlineinherited

Definition at line 123 of file kicad_git_common.h.

References KIGIT_COMMON::m_nextPublicKey, and KIGIT_COMMON::m_publicKeys.

Referenced by credentials_cb().

◆ GetPassword()

wxString KIGIT_COMMON::GetPassword ( ) const
inlineinherited

Definition at line 91 of file kicad_git_common.h.

References KIGIT_COMMON::m_password.

Referenced by credentials_cb().

◆ GetProjectDirs()

std::vector< wxString > KIGIT_COMMON::GetProjectDirs ( )
inherited

Return a vector of project files in the repository.

Sorted by the depth of the project file in the directory tree

Returns
std::vector<wxString> of project files

Definition at line 134 of file kicad_git_common.cpp.

References KIGIT_COMMON::m_repo.

Referenced by KICAD_MANAGER_CONTROL::NewFromRepository().

◆ GetRemotename()

wxString KIGIT_COMMON::GetRemotename ( ) const
inherited

Definition at line 394 of file kicad_git_common.cpp.

References KIGIT_COMMON::m_repo.

Referenced by KIGIT_COMMON::UpdateCurrentBranchInfo().

◆ GetRepo()

git_repository * KIGIT_COMMON::GetRepo ( ) const
inherited

Definition at line 44 of file kicad_git_common.cpp.

References KIGIT_COMMON::m_repo.

◆ GetUsername()

wxString KIGIT_COMMON::GetUsername ( ) const
inlineinherited

Definition at line 90 of file kicad_git_common.h.

References KIGIT_COMMON::m_username.

Referenced by credentials_cb().

◆ HasLocalCommits()

bool KIGIT_COMMON::HasLocalCommits ( ) const
inherited

Definition at line 318 of file kicad_git_common.cpp.

References KIGIT_COMMON::m_repo.

Referenced by PROJECT_TREE_PANE::onRight().

◆ HasPushAndPullRemote()

bool KIGIT_COMMON::HasPushAndPullRemote ( ) const
inherited

Definition at line 367 of file kicad_git_common.cpp.

References KIGIT_COMMON::m_repo.

Referenced by PROJECT_TREE_PANE::onRight().

◆ PeekErrorString()

const wxString & KIGIT_ERRORS::PeekErrorString ( ) const
inlineinherited

Definition at line 43 of file kicad_git_errors.h.

References _, and KIGIT_ERRORS::m_errorStrings.

◆ PerformCommit()

GIT_COMMIT_HANDLER::CommitResult GIT_COMMIT_HANDLER::PerformCommit ( const std::vector< std::string > &  aFilesToCommit)

Definition at line 36 of file git_commit_handler.cpp.

References Success.

◆ ResetNextKey()

void KIGIT_COMMON::ResetNextKey ( )
inlineinherited

◆ SetConnType() [1/2]

void KIGIT_COMMON::SetConnType ( GIT_CONN_TYPE  aConnType)
inlineinherited

◆ SetConnType() [2/2]

void KIGIT_COMMON::SetConnType ( unsigned  aConnType)
inlineinherited

Definition at line 99 of file kicad_git_common.h.

References KIGIT_COMMON::GIT_CONN_LAST, and KIGIT_COMMON::m_connType.

◆ SetPassword()

void KIGIT_COMMON::SetPassword ( const wxString &  aPassword)
inlineinherited

◆ SetRepo()

void KIGIT_COMMON::SetRepo ( git_repository *  aRepo)
inlineinherited

Definition at line 43 of file kicad_git_common.h.

References KIGIT_COMMON::m_repo.

◆ SetSSHKey()

void KIGIT_COMMON::SetSSHKey ( const wxString &  aSSHKey)
inherited

◆ SetUsername()

void KIGIT_COMMON::SetUsername ( const wxString &  aUsername)
inlineinherited

◆ TestedTypes()

unsigned & KIGIT_COMMON::TestedTypes ( )
inlineinherited

Definition at line 108 of file kicad_git_common.h.

References KIGIT_COMMON::m_testedTypes.

Referenced by credentials_cb().

◆ updateConnectionType()

◆ UpdateCurrentBranchInfo()

◆ UpdateProgress()

virtual void KIGIT_COMMON::UpdateProgress ( int  aCurrent,
int  aTotal,
const wxString &  aMessage 
)
inlinevirtualinherited

◆ updatePublicKeys()

void KIGIT_COMMON::updatePublicKeys ( )
privateinherited

Member Data Documentation

◆ m_connType

GIT_CONN_TYPE KIGIT_COMMON::m_connType
protectedinherited

◆ m_errorString

std::string GIT_COMMIT_HANDLER::m_errorString
private

Definition at line 55 of file git_commit_handler.h.

Referenced by AddErrorString(), and GetErrorString().

◆ m_errorStrings

std::vector<wxString> KIGIT_ERRORS::m_errorStrings
privateinherited

◆ m_hostname

wxString KIGIT_COMMON::m_hostname
protectedinherited

◆ m_nextPublicKey

int KIGIT_COMMON::m_nextPublicKey
privateinherited

◆ m_password

wxString KIGIT_COMMON::m_password
protectedinherited

◆ m_publicKeys

std::vector<wxString> KIGIT_COMMON::m_publicKeys
privateinherited

◆ m_remote

wxString KIGIT_COMMON::m_remote
protectedinherited

◆ m_repo

◆ m_testedTypes

unsigned KIGIT_COMMON::m_testedTypes
protectedinherited

◆ m_username

wxString KIGIT_COMMON::m_username
protectedinherited

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