|
KiCad PCB EDA Suite
|
#include <git/git_backend.h>#include <git/git_compare_handler.h>#include <git/kicad_git_errors.h>#include <git/kigit_known_hosts.h>#include <import_export.h>#include <git2.h>#include <atomic>#include <chrono>#include <functional>#include <mutex>#include <optional>#include <set>#include <utility>#include <vector>#include <wx/datetime.h>#include <wx/string.h>Go to the source code of this file.
Classes | |
| struct | KIGIT_ERROR_INFO |
| What libgit2 reported for a failed call, read before anything else can replace it. More... | |
| struct | KIGIT_COMMIT_INFO |
| struct | KIGIT_STASH_DETAIL |
| struct | KIGIT_BRANCH_INFO |
| struct | KIGIT_AHEAD_BEHIND |
| struct | KIGIT_BRANCH_DETAIL |
| struct | KIGIT_HISTORY_FILTER |
| struct | KIGIT_COMMIT_FILE |
| struct | KIGIT_COMMIT_DETAIL |
| struct | KIGIT_STASH_INFO |
| struct | KIGIT_TAG_INFO |
| struct | KIGIT_TAG_DETAIL |
| struct | KIGIT_CONFLICT_SIDES |
| class | KIGIT_COMMON |
| The project's git session. More... | |
| struct | KIGIT_COMMON::REMOTE_URL |
| A transport address with any embedded credentials extracted. More... | |
| struct | KIGIT_COMMON::CREDENTIAL_IDENTITY |
| The remote the credential prompt was opened for. More... | |
| struct | KIGIT_COMMON::PROMPTED_CREDENTIALS |
| What the credential prompt collected. More... | |
| class | KIGIT_COMMON::OPERATION_GUARD |
| Publishes a token for as long as its operation runs. More... | |
Namespaces | |
| namespace | KIGIT |
Enumerations | |
| enum class | GitOperation { None , Merge , Rebase , CherryPick , Revert , Other } |
| enum class | RestoreResult { Restored , AlreadyCurrent , Dirty , Error } |
Functions | |
| APIEXPORT int | progress_cb (const char *str, int len, void *data) |
| APIEXPORT void | clone_progress_cb (const char *str, size_t len, size_t total, void *data) |
| APIEXPORT int | transfer_progress_cb (const git_transfer_progress *aStats, void *aPayload) |
| APIEXPORT int | update_cb (const char *aRefname, const git_oid *aFirst, const git_oid *aSecond, void *aPayload) |
| APIEXPORT int | push_transfer_progress_cb (unsigned int aCurrent, unsigned int aTotal, size_t aBytes, void *aPayload) |
| APIEXPORT int | push_update_reference_cb (const char *aRefname, const char *aStatus, void *aPayload) |
| APIEXPORT int | fetchhead_foreach_cb (const char *, const char *, const git_oid *aOID, unsigned int aIsMerge, void *aPayload) |
| APIEXPORT int | credentials_cb (git_cred **aOut, const char *aUrl, const char *aUsername, unsigned int aAllowedTypes, void *aPayload) |
| APIEXPORT int | certificate_check_cb (git_cert *aCert, int aValid, const char *aHost, void *aPayload) |
| Check an SSH host key against known_hosts, which decides alone. | |
| bool | KIGIT::IsPrivateKeyEncrypted (const wxString &aKeyText) |
| Report whether an SSH private key is protected by a passphrase. | |
| APIEXPORT wxWindow *& | KIGIT::ActiveAdvancedGitWindow () |
| The advanced git window, or null when none is open. | |
| git_tree * | KIGIT::ResolveRefToTree (git_repository *aRepo, const wxString &aRef) |
| Resolve a string ref (branch name, short OID, full OID, tag) to its tree. | |
| std::vector< wxString > | KIGIT::CompareBranchRefs (git_repository *aRepo) |
| Refs to offer when comparing branches, base first and head second. | |
| void | KIGIT::CollectDiffDeltas (git_diff *aDiff, const std::function< void(const git_diff_delta &)> &aCallback) |
Walk every delta in a computed diff, invoking aCallback once per delta. | |
| wxString | KIGIT::ComposeCommitMessage (const wxString &aSummary, const wxString &aDescription, const wxString &aSignOff) |
| Join a summary line, an optional description and an optional sign-off into one commit message. | |
| void | KIGIT::SplitCommitMessage (const wxString &aMessage, wxString &aSummary, wxString &aDescription) |
| Split a commit message into its first line and the description after the first blank line. | |
| wxString | KIGIT::BranchNameError (const wxString &aName) |
| Empty when aName is a branch name git would accept, otherwise why it would not, in the words to show the user. | |
| wxString | KIGIT::DecodeRepoText (const char *aText) |
| Decode text that came out of a repository. | |
| wxString | KIGIT::BusyMessage () |
| What every caller says when it finds the session already busy. | |
|
strong |
| Enumerator | |
|---|---|
| None | |
| Merge | |
| Rebase | |
| CherryPick | |
| Revert | |
| Other | |
Definition at line 189 of file kicad_git_common.h.
|
strong |
| Enumerator | |
|---|---|
| Restored | A new commit carrying the old version's content was created. |
| AlreadyCurrent | The chosen version's content matches the current head. |
| Dirty | Uncommitted changes exist, and restoring would overwrite them. |
| Error | The restore failed. See the error string. |
Definition at line 201 of file kicad_git_common.h.
| APIEXPORT int certificate_check_cb | ( | git_cert * | aCert, |
| int | aValid, | ||
| const char * | aHost, | ||
| void * | aPayload ) |
Check an SSH host key against known_hosts, which decides alone.
A listed key returns 0, and any other state fails with GIT_ECERTIFICATE and is recorded with KIGIT_REPO_MIXIN::SetHostKeyFailure. A key KiCad cannot read, or a host or port that does not match the synced remote, fails without a record. Other certificates, such as HTTPS ones, are left to libgit2. Never returns a positive value, which libgit2 1.9 takes as accepting an unverified SSH host.
Definition at line 2846 of file kicad_git_common.cpp.
References _, KIGIT::HOST_KEY_FAILURE::fingerprint, KIGIT_REPO_MIXIN::GetCommon(), KIGIT::HOST_KEY_FAILURE::host, KIGIT::HostKeyFingerprint(), KIGIT::HostKeyType(), KIGIT::HOST_KEY_FAILURE::keyType, KIGIT::LookupKnownHost(), KIGIT::MATCH, KIGIT::HOST_KEY_FAILURE::port, KIGIT::HOST_KEY_FAILURE::rawKey, KIGIT::ReadKnownHosts(), KIGIT_REPO_MIXIN::SetHostKeyFailure(), KIGIT_REPO_MIXIN::SetHostKeyRefusal(), KIGIT_COMMON::SSHPortFor(), KIGIT::HOST_KEY_FAILURE::state, and traceGit.
Referenced by LIBGIT_BACKEND::Clone(), DIALOG_GIT_REPOSITORY::OnTestClick(), LIBGIT_BACKEND::PerformFetch(), and LIBGIT_BACKEND::Push().
| APIEXPORT void clone_progress_cb | ( | const char * | str, |
| size_t | len, | ||
| size_t | total, | ||
| void * | data ) |
Definition at line 2622 of file kicad_git_common.cpp.
References KIGIT_REPO_MIXIN::UpdateProgress().
Referenced by LIBGIT_BACKEND::Clone().
| APIEXPORT int credentials_cb | ( | git_cred ** | aOut, |
| const char * | aUrl, | ||
| const char * | aUsername, | ||
| unsigned int | aAllowedTypes, | ||
| void * | aPayload ) |
Definition at line 2750 of file kicad_git_common.cpp.
References _, KIGIT_REPO_MIXIN::AuthAttempt(), KIGIT_AUTH_ATTEMPT::connType, KIGIT_REPO_MIXIN::GetCommon(), KIGIT_REPO_MIXIN::GetConnType(), KIGIT_COMMON::GetLastGitError(), KIGIT_REPO_MIXIN::GetUsername(), KIGIT_COMMON::GIT_CONN_HTTPS, KIGIT_COMMON::GIT_CONN_LOCAL, KIGIT_COMMON::GIT_CONN_SSH, KIGIT_COMMON::HandlePlaintextAuthentication(), KIGIT_COMMON::HandleSSHKeyAuthentication(), result, KIGIT_REPO_MIXIN::SetAuthFailure(), KIGIT::StripEmbeddedUserinfo(), KIGIT_COMMON::SyncRemoteUrl(), KIGIT_REPO_MIXIN::TestedTypes(), and traceGit.
Referenced by LIBGIT_BACKEND::Clone(), DIALOG_GIT_REPOSITORY::OnTestClick(), LIBGIT_BACKEND::PerformFetch(), and LIBGIT_BACKEND::Push().
| APIEXPORT int fetchhead_foreach_cb | ( | const char * | , |
| const char * | , | ||
| const git_oid * | aOID, | ||
| unsigned int | aIsMerge, | ||
| void * | aPayload ) |
Definition at line 2612 of file kicad_git_common.cpp.
Referenced by LIBGIT_BACKEND::PerformPull().
| APIEXPORT int progress_cb | ( | const char * | str, |
| int | len, | ||
| void * | data ) |
Definition at line 2631 of file kicad_git_common.cpp.
References KIGIT_REPO_MIXIN::IsThisOperationCancelled(), KIGIT_REPO_MIXIN::ReceiveSideband(), and traceGit.
Referenced by LIBGIT_BACKEND::PerformFetch(), and LIBGIT_BACKEND::Push().
| APIEXPORT int push_transfer_progress_cb | ( | unsigned int | aCurrent, |
| unsigned int | aTotal, | ||
| size_t | aBytes, | ||
| void * | aPayload ) |
Definition at line 2697 of file kicad_git_common.cpp.
References _, KIGIT_REPO_MIXIN::IsThisOperationCancelled(), traceGit, and KIGIT_REPO_MIXIN::UpdateProgress().
Referenced by BOOST_AUTO_TEST_CASE(), and LIBGIT_BACKEND::Push().
| APIEXPORT int push_update_reference_cb | ( | const char * | aRefname, |
| const char * | aStatus, | ||
| void * | aPayload ) |
Definition at line 2722 of file kicad_git_common.cpp.
References _, KIGIT::DecodeServerText(), KIGIT::PrintableServerText(), KIGIT_REPO_MIXIN::SetPushRefusal(), and KIGIT_REPO_MIXIN::UpdateProgress().
Referenced by LIBGIT_BACKEND::Push().
| APIEXPORT int transfer_progress_cb | ( | const git_transfer_progress * | aStats, |
| void * | aPayload ) |
Definition at line 2646 of file kicad_git_common.cpp.
References _, KIGIT_REPO_MIXIN::IsThisOperationCancelled(), traceGit, and KIGIT_REPO_MIXIN::UpdateProgress().
Referenced by LIBGIT_BACKEND::Clone(), LIBGIT_BACKEND::PerformFetch(), and LIBGIT_BACKEND::Push().
| APIEXPORT int update_cb | ( | const char * | aRefname, |
| const git_oid * | aFirst, | ||
| const git_oid * | aSecond, | ||
| void * | aPayload ) |
Definition at line 2665 of file kicad_git_common.cpp.
References _, and KIGIT_REPO_MIXIN::UpdateProgress().
Referenced by LIBGIT_BACKEND::Push().