|
KiCad PCB EDA Suite
|
#include <kicad_git_common.h>
Public Types | |
| 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 | |
| KIGIT_COMMON (git_repository *aRepo) | |
| KIGIT_COMMON (const KIGIT_COMMON &aOther) | |
| ~KIGIT_COMMON () | |
| 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 () |
| 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 | SetProjectDir (const wxString &aProjectDir) |
| Set the project directory path, preserving any symlinks in the path. | |
| wxString | GetProjectDir () const |
| Get the project directory path. | |
| 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 |
| wxString | m_projectDir |
| 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 | updatePublicKeys () |
| void | updateConnectionType () |
Private Attributes | |
| std::vector< wxString > | m_publicKeys |
| int | m_nextPublicKey |
| bool | m_secretFetched |
| std::atomic< bool > | m_cancel |
Static Private Attributes | |
| static const unsigned | KIGIT_CREDENTIAL_SSH_AGENT = 1 << sizeof( m_testedTypes - 1 ) |
Friends | |
| class | GIT_PUSH_HANDLER |
| class | GIT_PULL_HANDLER |
| class | GIT_CLONE_HANDLER |
| class | LIBGIT_BACKEND |
| class | PROJECT_TREE_PANE |
Definition at line 39 of file kicad_git_common.h.
|
strong |
| Enumerator | |
|---|---|
| GIT_CONN_HTTPS | |
| GIT_CONN_SSH | |
| GIT_CONN_LOCAL | |
| GIT_CONN_LAST | |
Definition at line 87 of file kicad_git_common.h.
|
strong |
| 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 73 of file kicad_git_common.h.
| KIGIT_COMMON::KIGIT_COMMON | ( | git_repository * | aRepo | ) |
Definition at line 41 of file kicad_git_common.cpp.
References GIT_CONN_LOCAL, m_connType, m_nextPublicKey, m_repo, m_secretFetched, and m_testedTypes.
Referenced by GIT_ADD_TO_INDEX_HANDLER::GIT_ADD_TO_INDEX_HANDLER(), GIT_COMMIT_HANDLER::GIT_COMMIT_HANDLER(), GIT_REMOVE_FROM_INDEX_HANDLER::GIT_REMOVE_FROM_INDEX_HANDLER(), and KIGIT_COMMON().
| KIGIT_COMMON::KIGIT_COMMON | ( | const KIGIT_COMMON & | aOther | ) |
Definition at line 46 of file kicad_git_common.cpp.
References KIGIT_COMMON(), m_connType, m_gitActionMutex, m_hostname, m_nextPublicKey, m_password, m_projectDir, m_publicKeys, m_remote, m_repo, m_secretFetched, m_testedTypes, and m_username.
| KIGIT_COMMON::~KIGIT_COMMON | ( | ) |
Definition at line 64 of file kicad_git_common.cpp.
| std::vector< wxString > KIGIT_COMMON::GetBranchNames | ( | ) | const |
Definition at line 142 of file kicad_git_common.cpp.
| KIGIT_COMMON::GIT_CONN_TYPE KIGIT_COMMON::GetConnType | ( | ) | const |
Definition at line 709 of file kicad_git_common.cpp.
References GetRemotename(), GIT_CONN_HTTPS, GIT_CONN_LOCAL, GIT_CONN_SSH, and m_remote.
| wxString KIGIT_COMMON::GetCurrentBranchName | ( | ) | const |
Definition at line 91 of file kicad_git_common.cpp.
References m_repo, and traceGit.
Referenced by TEXT_EVAL_VCS::GetBranch().
| std::pair< std::set< wxString >, std::set< wxString > > KIGIT_COMMON::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.
Definition at line 273 of file kicad_git_common.cpp.
References delta, GetLastGitError(), IsCancelled(), m_repo, and traceGit.
| wxString KIGIT_COMMON::GetGitRootDirectory | ( | ) | const |
Definition at line 601 of file kicad_git_common.cpp.
Referenced by PROJECT_TREE_PANE::onRight().
|
inlinestatic |
Definition at line 157 of file kicad_git_common.h.
Referenced by LIBGIT_BACKEND::Commit(), LIBGIT_BACKEND::CreateBranch(), credentials_cb(), LIBGIT_BACKEND::GetConfigString(), LIBGIT_BACKEND::GetCurrentBranchName(), getDefaultAuthorAndEmail(), GetDifferentFiles(), LIBGIT_BACKEND::GetFileStatus(), GetProjectDirs(), GetRemotename(), LIBGIT_BACKEND::GetRepositoryForFile(), LIBGIT_BACKEND::handleMerge(), LIBGIT_BACKEND::handleRebase(), HandleSSHAgentAuthentication(), HandleSSHKeyAuthentication(), LIBGIT_BACKEND::HasChangedFiles(), HasLocalCommits(), LIBGIT_BACKEND::hasUnstagedChanges(), LIBGIT_BACKEND::InitializeRepository(), KIGIT_PCB_MERGE::Merge(), DIALOG_GIT_REPOSITORY::OnTestClick(), LIBGIT_BACKEND::PerformFetch(), LIBGIT_BACKEND::Push(), LIBGIT_BACKEND::SetupRemote(), and LIBGIT_BACKEND::SwitchToBranch().
|
inline |
Definition at line 135 of file kicad_git_common.h.
References m_nextPublicKey, and m_publicKeys.
Referenced by HandleSSHKeyAuthentication().
| wxString KIGIT_COMMON::GetPassword | ( | ) |
Definition at line 123 of file kicad_git_common.cpp.
References KIPLATFORM::SECRETS::GetSecret(), GIT_CONN_LOCAL, m_connType, m_password, m_remote, m_secretFetched, and m_username.
Referenced by HandlePlaintextAuthentication(), and HandleSSHKeyAuthentication().
| wxString KIGIT_COMMON::GetProjectDir | ( | ) | const |
Get the project directory path.
If a symlink-preserving path was set via SetProjectDir(), returns that path. Otherwise falls back to git_repository_workdir().
Definition at line 74 of file kicad_git_common.cpp.
References m_projectDir, and m_repo.
| std::vector< wxString > KIGIT_COMMON::GetProjectDirs | ( | ) |
Return a vector of project files in the repository.
Sorted by the depth of the project file in the directory tree
Definition at line 205 of file kicad_git_common.cpp.
References GetLastGitError(), m_repo, and traceGit.
| wxString KIGIT_COMMON::GetRemotename | ( | ) | const |
Definition at line 520 of file kicad_git_common.cpp.
References GetLastGitError(), m_repo, and traceGit.
Referenced by GetConnType(), and UpdateCurrentBranchInfo().
| git_repository * KIGIT_COMMON::GetRepo | ( | ) | const |
Definition at line 68 of file kicad_git_common.cpp.
References m_repo.
Referenced by LIBGIT_BACKEND::AddToIndex(), LIBGIT_BACKEND::Commit(), LIBGIT_BACKEND::PerformAddToIndex(), LIBGIT_BACKEND::PerformRemoveFromIndex(), and LIBGIT_BACKEND::RemoveFromIndex().
|
inline |
Definition at line 95 of file kicad_git_common.h.
References m_username.
| int KIGIT_COMMON::HandlePlaintextAuthentication | ( | git_cred ** | aOut, |
| const wxString & | aUsername ) |
Definition at line 832 of file kicad_git_common.cpp.
References GetPassword(), and m_testedTypes.
Referenced by credentials_cb().
| int KIGIT_COMMON::HandleSSHAgentAuthentication | ( | git_cred ** | aOut, |
| const wxString & | aUsername ) |
Definition at line 842 of file kicad_git_common.cpp.
References GetLastGitError(), KIGIT_CREDENTIAL_SSH_AGENT, m_testedTypes, and traceGit.
Referenced by HandleSSHKeyAuthentication().
| int KIGIT_COMMON::HandleSSHKeyAuthentication | ( | git_cred ** | aOut, |
| const wxString & | aUsername ) |
Definition at line 800 of file kicad_git_common.cpp.
References GetLastGitError(), GetNextPublicKey(), GetPassword(), HandleSSHAgentAuthentication(), KIGIT_CREDENTIAL_SSH_AGENT, m_testedTypes, and traceGit.
Referenced by credentials_cb().
| bool KIGIT_COMMON::HasLocalCommits | ( | ) | const |
Definition at line 431 of file kicad_git_common.cpp.
References GetLastGitError(), m_repo, and traceGit.
Referenced by PROJECT_TREE_PANE::onRight().
| bool KIGIT_COMMON::HasPushAndPullRemote | ( | ) | const |
Definition at line 492 of file kicad_git_common.cpp.
References m_repo, and traceGit.
Referenced by PROJECT_TREE_PANE::onRight().
|
inline |
Definition at line 167 of file kicad_git_common.h.
References m_cancel.
Referenced by GetDifferentFiles(), PROJECT_TREE_PANE::gitStatusTimerHandler(), PROJECT_TREE_PANE::onGitSyncTimer(), progress_cb(), and transfer_progress_cb().
|
inline |
Definition at line 133 of file kicad_git_common.h.
References m_nextPublicKey.
|
inline |
Definition at line 172 of file kicad_git_common.h.
References m_cancel.
Referenced by LIBGIT_BACKEND::PerformFetch(), and LIBGIT_BACKEND::Push().
|
inline |
Definition at line 100 of file kicad_git_common.h.
References m_password, and m_secretFetched.
Referenced by DIALOG_GIT_REPOSITORY::OnTestClick(), and LIBGIT_BACKEND::SetupRemote().
|
inline |
Set the project directory path, preserving any symlinks in the path.
This is used to ensure git status paths match the paths used in the project tree.
Definition at line 125 of file kicad_git_common.h.
References m_projectDir.
|
inline |
Definition at line 143 of file kicad_git_common.h.
References m_password, m_remote, m_secretFetched, and updateConnectionType().
Referenced by DIALOG_GIT_REPOSITORY::OnTestClick().
|
inline |
Definition at line 49 of file kicad_git_common.h.
References m_repo.
Referenced by LIBGIT_BACKEND::Clone(), and LIBGIT_BACKEND::InitializeRepository().
| void KIGIT_COMMON::SetSSHKey | ( | const wxString & | aSSHKey | ) |
Definition at line 590 of file kicad_git_common.cpp.
References m_publicKeys.
Referenced by DIALOG_GIT_REPOSITORY::OnTestClick(), LIBGIT_BACKEND::SetupRemote(), and updatePublicKeys().
|
inline |
Definition at line 99 of file kicad_git_common.h.
References m_secretFetched, and m_username.
Referenced by DIALOG_GIT_REPOSITORY::OnTestClick(), and LIBGIT_BACKEND::SetupRemote().
|
inline |
Definition at line 106 of file kicad_git_common.h.
References m_testedTypes.
|
private |
Definition at line 729 of file kicad_git_common.cpp.
References GIT_CONN_HTTPS, GIT_CONN_LOCAL, GIT_CONN_SSH, m_connType, m_hostname, m_password, m_remote, m_secretFetched, and m_username.
Referenced by PROJECT_TREE_PANE, SetRemote(), and UpdateCurrentBranchInfo().
| void KIGIT_COMMON::UpdateCurrentBranchInfo | ( | ) |
Definition at line 681 of file kicad_git_common.cpp.
References GetRemotename(), m_password, m_remote, m_repo, m_secretFetched, updateConnectionType(), and updatePublicKeys().
|
private |
Definition at line 612 of file kicad_git_common.cpp.
References m_hostname, m_publicKeys, and SetSSHKey().
Referenced by PROJECT_TREE_PANE, and UpdateCurrentBranchInfo().
|
friend |
Definition at line 195 of file kicad_git_common.h.
References GIT_CLONE_HANDLER.
Referenced by GIT_CLONE_HANDLER.
|
friend |
Definition at line 194 of file kicad_git_common.h.
References GIT_PULL_HANDLER.
Referenced by GIT_PULL_HANDLER.
|
friend |
Definition at line 193 of file kicad_git_common.h.
References GIT_PUSH_HANDLER.
Referenced by GIT_PUSH_HANDLER.
|
friend |
Definition at line 196 of file kicad_git_common.h.
References LIBGIT_BACKEND.
Referenced by LIBGIT_BACKEND.
|
friend |
Definition at line 197 of file kicad_git_common.h.
References PROJECT_TREE_PANE, updateConnectionType(), and updatePublicKeys().
Referenced by PROJECT_TREE_PANE.
|
staticprivate |
Definition at line 211 of file kicad_git_common.h.
Referenced by HandleSSHAgentAuthentication(), and HandleSSHKeyAuthentication().
|
private |
Definition at line 207 of file kicad_git_common.h.
Referenced by IsCancelled(), and SetCancelled().
|
protected |
Definition at line 182 of file kicad_git_common.h.
Referenced by GetPassword(), KIGIT_COMMON(), KIGIT_COMMON(), and updateConnectionType().
|
protected |
Definition at line 190 of file kicad_git_common.h.
Referenced by LIBGIT_BACKEND::Clone(), KIGIT_COMMON(), LIBGIT_BACKEND::PerformFetch(), LIBGIT_BACKEND::PerformPull(), and LIBGIT_BACKEND::Push().
|
protected |
Definition at line 184 of file kicad_git_common.h.
Referenced by KIGIT_COMMON(), updateConnectionType(), and updatePublicKeys().
|
private |
Definition at line 204 of file kicad_git_common.h.
Referenced by GetNextPublicKey(), KIGIT_COMMON(), KIGIT_COMMON(), and ResetNextKey().
|
protected |
Definition at line 186 of file kicad_git_common.h.
Referenced by GetPassword(), KIGIT_COMMON(), SetPassword(), SetRemote(), updateConnectionType(), and UpdateCurrentBranchInfo().
|
protected |
Definition at line 180 of file kicad_git_common.h.
Referenced by GetProjectDir(), KIGIT_COMMON(), and SetProjectDir().
|
private |
Definition at line 203 of file kicad_git_common.h.
Referenced by GetNextPublicKey(), KIGIT_COMMON(), SetSSHKey(), and updatePublicKeys().
|
protected |
Definition at line 183 of file kicad_git_common.h.
Referenced by LIBGIT_BACKEND::Clone(), GetConnType(), GetPassword(), KIGIT_COMMON(), GIT_CLONE_HANDLER::SetRemote(), SetRemote(), updateConnectionType(), and UpdateCurrentBranchInfo().
|
protected |
Definition at line 178 of file kicad_git_common.h.
Referenced by GetBranchNames(), GetCurrentBranchName(), GetDifferentFiles(), GetGitRootDirectory(), GetProjectDir(), GetProjectDirs(), GetRemotename(), GetRepo(), HasLocalCommits(), HasPushAndPullRemote(), KIGIT_COMMON(), KIGIT_COMMON(), SetRepo(), and UpdateCurrentBranchInfo().
|
private |
Definition at line 205 of file kicad_git_common.h.
Referenced by GetPassword(), KIGIT_COMMON(), KIGIT_COMMON(), SetPassword(), SetRemote(), SetUsername(), updateConnectionType(), and UpdateCurrentBranchInfo().
|
protected |
Definition at line 188 of file kicad_git_common.h.
Referenced by HandlePlaintextAuthentication(), HandleSSHAgentAuthentication(), HandleSSHKeyAuthentication(), KIGIT_COMMON(), KIGIT_COMMON(), and TestedTypes().
|
protected |
Definition at line 185 of file kicad_git_common.h.
Referenced by GetPassword(), GetUsername(), KIGIT_COMMON(), SetUsername(), and updateConnectionType().