KiCad PCB EDA Suite
|
#include <git_commit_handler.h>
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_IGNORED , 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< wxString > &aFiles, const wxString &aMessage, const wxString &aAuthorName, const wxString &aAuthorEmail) |
wxString | GetErrorString () const |
git_repository * | GetRepo () const |
void | SetRepo (git_repository *aRepo) |
wxString | GetCurrentBranchName () const |
std::vector< wxString > | GetBranchNames () const |
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) |
unsigned & | TestedTypes () |
bool | HasLocalCommits () const |
bool | HasPushAndPullRemote () const |
void | UpdateCurrentBranchInfo () |
wxString | GetGitRootDirectory () const |
wxString | GetRemotename () const |
void | ResetNextKey () |
wxString | GetNextPublicKey () |
void | SetRemote (const wxString &aRemote) |
int | HandleSSHKeyAuthentication (git_cred **aOut, const wxString &aUsername) |
int | HandlePlaintextAuthentication (git_cred **aOut, const wxString &aUsername) |
int | HandleSSHAgentAuthentication (git_cred **aOut, const wxString &aUsername) |
bool | IsCancelled () const |
void | SetCancelled (bool aCancel) |
Static Public Member Functions | |
static wxString | GetLastGitError () |
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 |
std::mutex | m_gitActionMutex |
Private Member Functions | |
void | AddErrorString (const wxString &aErrorString) |
void | updatePublicKeys () |
void | updateConnectionType () |
Private Attributes | |
wxString | m_errorString |
std::vector< wxString > | m_publicKeys |
int | m_nextPublicKey |
std::atomic< bool > | m_cancel |
Static Private Attributes | |
static const unsigned | KIGIT_CREDENTIAL_SSH_AGENT = 1 << sizeof( m_testedTypes - 1 ) |
Definition at line 36 of file git_commit_handler.h.
|
strong |
Enumerator | |
---|---|
Success | |
Error | |
Cancelled |
Definition at line 42 of file git_commit_handler.h.
|
stronginherited |
Enumerator | |
---|---|
GIT_CONN_HTTPS | |
GIT_CONN_SSH | |
GIT_CONN_LOCAL | |
GIT_CONN_LAST |
Definition at line 84 of file kicad_git_common.h.
|
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_IGNORED | |
GIT_STATUS_LAST |
Definition at line 70 of file kicad_git_common.h.
GIT_COMMIT_HANDLER::GIT_COMMIT_HANDLER | ( | git_repository * | aRepo | ) |
Definition at line 28 of file git_commit_handler.cpp.
|
virtual |
Definition at line 33 of file git_commit_handler.cpp.
|
private |
Definition at line 161 of file git_commit_handler.cpp.
References m_errorString.
Referenced by PerformCommit().
|
inherited |
Definition at line 103 of file kicad_git_common.cpp.
References KIGIT_COMMON::m_repo, and traceGit.
Referenced by KIGIT_REPO_MIXIN::GetBranchNames(), PROJECT_TREE_PANE::onGitSwitchBranch(), and PROJECT_TREE_PANE::onRight().
|
inherited |
Definition at line 665 of file kicad_git_common.cpp.
References KIGIT_COMMON::GetRemotename(), KIGIT_COMMON::GIT_CONN_HTTPS, KIGIT_COMMON::GIT_CONN_LOCAL, KIGIT_COMMON::GIT_CONN_SSH, and KIGIT_COMMON::m_remote.
Referenced by KIGIT_REPO_MIXIN::GetConnType().
|
inherited |
Definition at line 71 of file kicad_git_common.cpp.
References KIGIT_COMMON::m_repo, and traceGit.
Referenced by KIGIT_REPO_MIXIN::GetCurrentBranchName().
|
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 234 of file kicad_git_common.cpp.
References delta, KIGIT_COMMON::GetLastGitError(), KIGIT_COMMON::m_repo, and traceGit.
Referenced by KIGIT_REPO_MIXIN::GetDifferentFiles(), and PROJECT_TREE_PANE::updateGitStatusIconMap().
wxString GIT_COMMIT_HANDLER::GetErrorString | ( | ) | const |
Definition at line 155 of file git_commit_handler.cpp.
References m_errorString.
Referenced by PROJECT_TREE_PANE::onGitCommit().
|
inherited |
Definition at line 558 of file kicad_git_common.cpp.
References KIGIT_COMMON::m_repo, and path.
Referenced by KIGIT_REPO_MIXIN::GetGitRootDirectory(), and PROJECT_TREE_PANE::onRight().
|
inlinestaticinherited |
Definition at line 140 of file kicad_git_common.h.
Referenced by KIGIT::PROJECT_GIT_UTILS::CreateBranch(), credentials_cb(), GIT_CONFIG_HANDLER::GetConfigString(), GIT_STATUS_HANDLER::GetCurrentBranchName(), getDefaultAuthorAndEmail(), KIGIT_COMMON::GetDifferentFiles(), GIT_STATUS_HANDLER::GetFileStatus(), KIGIT_COMMON::GetProjectDirs(), KIGIT_COMMON::GetRemotename(), KIGIT::PROJECT_GIT_UTILS::GetRepositoryForFile(), GIT_PULL_HANDLER::handleRebase(), KIGIT_COMMON::HandleSSHAgentAuthentication(), KIGIT_COMMON::HandleSSHKeyAuthentication(), GIT_STATUS_HANDLER::HasChangedFiles(), KIGIT_COMMON::HasLocalCommits(), GIT_INIT_HANDLER::InitializeRepository(), KIGIT_PCB_MERGE::Merge(), DIALOG_GIT_REPOSITORY::OnTestClick(), PerformCommit(), GIT_PULL_HANDLER::PerformFetch(), GIT_PUSH_HANDLER::PerformPush(), GIT_INIT_HANDLER::SetupRemote(), and GIT_BRANCH_HANDLER::SwitchToBranch().
|
inlineinherited |
Definition at line 120 of file kicad_git_common.h.
References KIGIT_COMMON::m_nextPublicKey, and KIGIT_COMMON::m_publicKeys.
Referenced by KIGIT_REPO_MIXIN::GetNextPublicKey(), and KIGIT_COMMON::HandleSSHKeyAuthentication().
|
inlineinherited |
Definition at line 93 of file kicad_git_common.h.
References KIGIT_COMMON::m_password.
Referenced by KIGIT_REPO_MIXIN::GetPassword(), KIGIT_COMMON::HandlePlaintextAuthentication(), and KIGIT_COMMON::HandleSSHKeyAuthentication().
|
inherited |
Return a vector of project files in the repository.
Sorted by the depth of the project file in the directory tree
Definition at line 166 of file kicad_git_common.cpp.
References KIGIT_COMMON::GetLastGitError(), KIGIT_COMMON::m_repo, and traceGit.
Referenced by KIGIT_REPO_MIXIN::GetProjectDirs().
|
inherited |
Definition at line 477 of file kicad_git_common.cpp.
References KIGIT_COMMON::GetLastGitError(), KIGIT_COMMON::m_repo, and traceGit.
Referenced by KIGIT_COMMON::GetConnType(), KIGIT_REPO_MIXIN::GetRemotename(), and KIGIT_COMMON::UpdateCurrentBranchInfo().
|
inherited |
Definition at line 66 of file kicad_git_common.cpp.
References KIGIT_COMMON::m_repo.
Referenced by KIGIT_REPO_MIXIN::GetRepo(), and PerformCommit().
|
inlineinherited |
Definition at line 92 of file kicad_git_common.h.
References KIGIT_COMMON::m_username.
Referenced by KIGIT_REPO_MIXIN::GetUsername().
|
inherited |
Definition at line 786 of file kicad_git_common.cpp.
References KIGIT_COMMON::GetPassword(), and KIGIT_COMMON::m_testedTypes.
Referenced by credentials_cb().
|
inherited |
Definition at line 796 of file kicad_git_common.cpp.
References KIGIT_COMMON::GetLastGitError(), KIGIT_COMMON::KIGIT_CREDENTIAL_SSH_AGENT, KIGIT_COMMON::m_testedTypes, and traceGit.
Referenced by KIGIT_COMMON::HandleSSHKeyAuthentication().
|
inherited |
Definition at line 754 of file kicad_git_common.cpp.
References KIGIT_COMMON::GetLastGitError(), KIGIT_COMMON::GetNextPublicKey(), KIGIT_COMMON::GetPassword(), KIGIT_COMMON::HandleSSHAgentAuthentication(), KIGIT_COMMON::KIGIT_CREDENTIAL_SSH_AGENT, KIGIT_COMMON::m_testedTypes, and traceGit.
Referenced by credentials_cb().
|
inherited |
Definition at line 388 of file kicad_git_common.cpp.
References KIGIT_COMMON::GetLastGitError(), KIGIT_COMMON::m_repo, and traceGit.
Referenced by PROJECT_TREE_PANE::onRight().
|
inherited |
Definition at line 449 of file kicad_git_common.cpp.
References KIGIT_COMMON::m_repo, and traceGit.
Referenced by PROJECT_TREE_PANE::onRight().
|
inlineinherited |
Definition at line 150 of file kicad_git_common.h.
References KIGIT_COMMON::m_cancel.
Referenced by progress_cb(), and transfer_progress_cb().
GIT_COMMIT_HANDLER::CommitResult GIT_COMMIT_HANDLER::PerformCommit | ( | const std::vector< wxString > & | aFiles, |
const wxString & | aMessage, | ||
const wxString & | aAuthorName, | ||
const wxString & | aAuthorEmail | ||
) |
Definition at line 38 of file git_commit_handler.cpp.
References _, AddErrorString(), Error, KIGIT_COMMON::GetLastGitError(), KIGIT_COMMON::GetRepo(), and Success.
Referenced by PROJECT_TREE_PANE::onGitCommit().
|
inlineinherited |
Definition at line 118 of file kicad_git_common.h.
References KIGIT_COMMON::m_nextPublicKey.
Referenced by KIGIT_REPO_MIXIN::ResetNextKey().
|
inlineinherited |
Definition at line 155 of file kicad_git_common.h.
References KIGIT_COMMON::m_cancel.
Referenced by PROJECT_TREE_PANE::EmptyTreePrj(), GIT_PULL_HANDLER::PerformFetch(), and GIT_PUSH_HANDLER::PerformPush().
|
inlineinherited |
Definition at line 97 of file kicad_git_common.h.
References KIGIT_COMMON::m_password.
Referenced by DIALOG_GIT_REPOSITORY::OnTestClick(), KIGIT_REPO_MIXIN::SetPassword(), and GIT_INIT_HANDLER::SetupRemote().
|
inlineinherited |
Definition at line 128 of file kicad_git_common.h.
References KIGIT_COMMON::m_remote, and KIGIT_COMMON::updateConnectionType().
Referenced by DIALOG_GIT_REPOSITORY::OnTestClick().
|
inlineinherited |
Definition at line 46 of file kicad_git_common.h.
References KIGIT_COMMON::m_repo.
Referenced by GIT_INIT_HANDLER::InitializeRepository(), and GIT_CLONE_HANDLER::PerformClone().
|
inherited |
Definition at line 547 of file kicad_git_common.cpp.
References KIGIT_COMMON::m_publicKeys.
Referenced by DIALOG_GIT_REPOSITORY::OnTestClick(), PROJECT_TREE_PANE::ReCreateTreePrj(), KIGIT_REPO_MIXIN::SetSSHKey(), GIT_INIT_HANDLER::SetupRemote(), and KIGIT_COMMON::updatePublicKeys().
|
inlineinherited |
Definition at line 96 of file kicad_git_common.h.
References KIGIT_COMMON::m_username.
Referenced by DIALOG_GIT_REPOSITORY::OnTestClick(), PROJECT_TREE_PANE::ReCreateTreePrj(), GIT_INIT_HANDLER::SetupRemote(), and KIGIT_REPO_MIXIN::SetUsername().
|
inlineinherited |
Definition at line 103 of file kicad_git_common.h.
References KIGIT_COMMON::m_testedTypes.
Referenced by KIGIT_REPO_MIXIN::TestedTypes().
|
privateinherited |
Definition at line 685 of file kicad_git_common.cpp.
References KIGIT_COMMON::GIT_CONN_HTTPS, KIGIT_COMMON::GIT_CONN_LOCAL, KIGIT_COMMON::GIT_CONN_SSH, KIGIT_COMMON::m_connType, KIGIT_COMMON::m_hostname, KIGIT_COMMON::m_password, KIGIT_COMMON::m_remote, and KIGIT_COMMON::m_username.
Referenced by KIGIT_COMMON::SetRemote(), and KIGIT_COMMON::UpdateCurrentBranchInfo().
|
inherited |
Definition at line 638 of file kicad_git_common.cpp.
References KIGIT_COMMON::GetRemotename(), KIPLATFORM::SECRETS::GetSecret(), KIGIT_COMMON::m_password, KIGIT_COMMON::m_remote, KIGIT_COMMON::m_repo, KIGIT_COMMON::m_username, KIGIT_COMMON::updateConnectionType(), and KIGIT_COMMON::updatePublicKeys().
Referenced by PROJECT_TREE_PANE::ReCreateTreePrj().
|
privateinherited |
Definition at line 569 of file kicad_git_common.cpp.
References KIGIT_COMMON::m_hostname, KIGIT_COMMON::m_publicKeys, and KIGIT_COMMON::SetSSHKey().
Referenced by KIGIT_COMMON::UpdateCurrentBranchInfo().
|
staticprivateinherited |
Definition at line 190 of file kicad_git_common.h.
Referenced by KIGIT_COMMON::HandleSSHAgentAuthentication(), and KIGIT_COMMON::HandleSSHKeyAuthentication().
|
privateinherited |
Definition at line 186 of file kicad_git_common.h.
Referenced by KIGIT_COMMON::IsCancelled(), and KIGIT_COMMON::SetCancelled().
|
protectedinherited |
Definition at line 163 of file kicad_git_common.h.
Referenced by KIGIT_COMMON::updateConnectionType().
|
private |
Definition at line 59 of file git_commit_handler.h.
Referenced by AddErrorString(), and GetErrorString().
|
protectedinherited |
Definition at line 171 of file kicad_git_common.h.
Referenced by PROJECT_TREE_PANE::EmptyTreePrj().
|
protectedinherited |
Definition at line 165 of file kicad_git_common.h.
Referenced by KIGIT_COMMON::updateConnectionType(), and KIGIT_COMMON::updatePublicKeys().
|
privateinherited |
Definition at line 184 of file kicad_git_common.h.
Referenced by KIGIT_COMMON::GetNextPublicKey(), and KIGIT_COMMON::ResetNextKey().
|
protectedinherited |
Definition at line 167 of file kicad_git_common.h.
Referenced by KIGIT_COMMON::GetPassword(), KIGIT_COMMON::SetPassword(), KIGIT_COMMON::updateConnectionType(), and KIGIT_COMMON::UpdateCurrentBranchInfo().
|
privateinherited |
Definition at line 183 of file kicad_git_common.h.
Referenced by KIGIT_COMMON::GetNextPublicKey(), KIGIT_COMMON::SetSSHKey(), and KIGIT_COMMON::updatePublicKeys().
|
protectedinherited |
Definition at line 164 of file kicad_git_common.h.
Referenced by KIGIT_COMMON::GetConnType(), GIT_CLONE_HANDLER::PerformClone(), GIT_CLONE_HANDLER::SetRemote(), KIGIT_COMMON::SetRemote(), KIGIT_COMMON::updateConnectionType(), and KIGIT_COMMON::UpdateCurrentBranchInfo().
|
protectedinherited |
Definition at line 161 of file kicad_git_common.h.
Referenced by KIGIT_COMMON::GetBranchNames(), KIGIT_COMMON::GetCurrentBranchName(), KIGIT_COMMON::GetDifferentFiles(), KIGIT_COMMON::GetGitRootDirectory(), KIGIT_COMMON::GetProjectDirs(), KIGIT_COMMON::GetRemotename(), KIGIT_COMMON::GetRepo(), KIGIT_COMMON::HasLocalCommits(), KIGIT_COMMON::HasPushAndPullRemote(), KIGIT_COMMON::SetRepo(), and KIGIT_COMMON::UpdateCurrentBranchInfo().
|
protectedinherited |
Definition at line 169 of file kicad_git_common.h.
Referenced by KIGIT_COMMON::HandlePlaintextAuthentication(), KIGIT_COMMON::HandleSSHAgentAuthentication(), KIGIT_COMMON::HandleSSHKeyAuthentication(), and KIGIT_COMMON::TestedTypes().
|
protectedinherited |
Definition at line 166 of file kicad_git_common.h.
Referenced by KIGIT_COMMON::GetUsername(), KIGIT_COMMON::SetUsername(), KIGIT_COMMON::updateConnectionType(), and KIGIT_COMMON::UpdateCurrentBranchInfo().