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

The project's git session. More...

#include <kicad_git_common.h>

Inheritance diagram for KIGIT_COMMON:
GIT_COMMIT_HANDLER

Classes

struct  CREDENTIAL_IDENTITY
 The remote the credential prompt was opened for. More...
 
class  OPERATION_GUARD
 Publishes a token for as long as its operation runs. More...
 
struct  PROMPTED_CREDENTIALS
 What the credential prompt collected. More...
 
struct  REMOTE_URL
 A transport address with any embedded credentials extracted. More...
 

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 }
 
using CANCEL_TOKEN = std::shared_ptr<std::atomic<bool>>
 One token per operation.
 

Public Member Functions

 KIGIT_COMMON (git_repository *aRepo, const wxString &aProjectPath=wxEmptyString)
 aProjectPath is the absolute project directory.
 
 KIGIT_COMMON (const KIGIT_COMMON &aOther)
 
 ~KIGIT_COMMON ()
 
git_repository * GetRepo () const
 
void SetRepo (git_repository *aRepo)
 
wxString GetCurrentBranchName () const
 
wxString GetHeadCommitId () const
 Full commit ID at HEAD, or empty for an unborn or missing HEAD.
 
std::vector< KIGIT_BRANCH_INFO > GetBranches () const
 Local and remote branches with their tip commits.
 
KIGIT_BRANCH_DETAIL GetBranchDetail (const wxString &aBranch) 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 SetConnType (GIT_CONN_TYPE aConnType)
 For a remote whose address names no transport, the user picks one in the prompt.
 
void SetUsername (const wxString &aUsername)
 
void SetPassword (const wxString &aPassword)
 
void SetSSHKey (const wxString &aSSHKey)
 
wxString GetSSHKey () const
 The key the project was set up with, even when its file is gone, otherwise the first key offered.
 
wxString GetFirstOfferedSSHKey () const
 The key the next attempt will try first, for the credential prompt to show.
 
CREDENTIAL_IDENTITY GetCredentialIdentity () const
 
bool ApplyPromptedCredentials (const CREDENTIAL_IDENTITY &aFor, const PROMPTED_CREDENTIALS &aEntered)
 Apply what the prompt collected, unless the session has moved to another remote since aFor was taken.
 
std::atomic< unsigned > & TestedTypes ()
 
bool HasLocalCommits () const
 True when HEAD has commits its upstream does not, or has no upstream yet.
 
bool HasUpstreamCommits () const
 True when the upstream branch has commits the current branch does not.
 
bool IsPullRebaseConfigured () const
 True when the repository is set to rebase rather than merge when getting changes.
 
bool IsHeadDetached () const
 True when HEAD points at a commit rather than a branch, as after checking out a tag.
 
std::optional< size_t > GetUnmergedCommitCount (const wxString &aBranch) const
 Commits in aBranch that HEAD does not contain. No value when either cannot be read.
 
bool HasUncommittedTrackedChanges (bool *aReadOk=nullptr) const
 
std::vector< wxString > GetRecentCommitMessages (size_t aMax) const
 
std::vector< KIGIT_COMMIT_INFO > GetRecentCommits (size_t aMax=50, const KIGIT_HISTORY_FILTER &aFilter={}) const
 
KIGIT_COMMIT_DETAIL GetCommitDetail (const wxString &aHash) const
 
wxString GetLastCommitMessage () const
 
std::vector< KIGIT_STASH_INFO > GetStashes () const
 
KIGIT_STASH_DETAIL GetStashDetail (const wxString &aId) const
 
std::vector< KIGIT_TAG_INFO > GetTags () const
 
KIGIT_TAG_DETAIL GetTagDetail (const wxString &aName) const
 
bool IsHeadUnborn () const
 True while the repository has no commits, so HEAD names a branch that does not exist yet.
 
bool CreateBranch (const wxString &aName, const wxString &aFrom=wxEmptyString)
 
bool StartUnbornBranch (const wxString &aName)
 Point HEAD at a branch that does not exist yet, so the first commit creates it.
 
bool DeleteBranch (const wxString &aName)
 
bool StashSave (const wxString &aMessage)
 Set the uncommitted tracked changes aside as a new stash, as git stash push would.
 
bool StashApply (size_t aIndex)
 
bool StashPop (size_t aIndex)
 
bool StashDrop (size_t aIndex)
 
bool CreateTag (const wxString &aName, const wxString &aMessage=wxEmptyString)
 
bool DeleteTag (const wxString &aName)
 
bool CheckoutTag (const wxString &aName)
 
bool AddRemote (const wxString &aName, const wxString &aUrl)
 
bool SetRemoteUrl (const wxString &aName, const wxString &aUrl)
 
bool RemoveRemote (const wxString &aName)
 
bool SetUserConfig (const wxString &aName, const wxString &aEmail)
 
bool GetMergeConflicts (const wxString &aStageDir, wxString &aHeadOid, wxString &aTheirsOid, std::vector< KIGIT_CONFLICT_SIDES > &aConflicts, wxString &aError)
 Recompute the merge in memory and extract each conflicted file's three versions into aStageDir, without touching the repository.
 
RestoreResult RestoreVersion (const wxString &aCommitHash, KIGIT_ERROR_MESSAGE &aError)
 Restore the project as it was at aCommitHash, recorded as a new commit on top of the current head.
 
bool DiscardChanges (const std::vector< wxString > &aPaths, wxString &aError)
 Put the given working directory relative paths back to their committed state.
 
bool IsPathInHead (const wxString &aPath)
 True when the working directory relative path exists in the HEAD commit's tree.
 
bool IsPathConflicted (const wxString &aPath) const
 True while aPath is one of the files a merge or rebase stopped on.
 
bool IsOperationInProgress () const
 True while a merge, rebase, cherry-pick or revert is in progress, which refuses commits.
 
GitOperation OperationInProgress () const
 Which operation that is, so the panel can name it.
 
bool AbandonOperation (wxString &aError)
 Drop that operation and return to the last commit. The caller holds the action lock.
 
MergeCommitResult CreateMergedCommit (const wxString &aExpectedHeadOid, const wxString &aTheirsOid, const std::vector< std::pair< wxString, wxString > > &aResolvedFiles, KIGIT_ERROR_MESSAGE &aError)
 Redo the merge with each conflicted path replaced by its resolved file, then commit and check out.
 
bool HasPushAndPullRemote () const
 
void UpdateCurrentBranchInfo ()
 
void SyncRemoteUrl (const wxString &aRawUrl)
 Bind the session to the URL a transfer is about to connect to.
 
void FollowRewrittenUrl (const wxString &aRawUrl)
 Bind the session to a URL that url.insteadOf rewrote, keeping the username, password and key entered for the original.
 
wxString GetGitRootDirectory () const
 
wxString GetRemotename () const
 
std::vector< std::pair< wxString, wxString > > GetRemotes () const
 Returns every remote as a (name, URL) pair.
 
wxDateTime GetLastFetchTime () const
 
std::pair< int, int > GetWorkingTreeLineStats (const std::set< wxString > &aPaths) const
 
wxString GetRemoteNameOrDefault () const
 Returns GetRemotename() when non-empty, otherwise "origin".
 
void SetProjectDir (const wxString &aProjectDir)
 Keep symlinks in the repository path so Git status paths match the project tree.
 
wxString GetProjectDir () const
 Return the path set by SetProjectDir(), or the repository's working directory.
 
std::optional< wxString > GetProjectPrefix () const
 Project folder relative to the repository, with a trailing slash.
 
void SetAttachError (const wxString &aError, const wxString &aTrustCommand=wxEmptyString)
 Why binding a repository last failed, for the panels to show. Empty on success.
 
const wxString & GetAttachError () const
 
const wxString & GetAttachTrustCommand () const
 The command that trusts a repository another user owns, when that is why attaching failed.
 
void ResetNextKey ()
 
wxString GetNextPublicKey ()
 By value, so the caller never holds a pointer into the vector.
 
void SetRemote (const wxString &aRemote)
 
wxString GetRemote () const
 
int HandleSSHKeyAuthentication (git_cred **aOut, const wxString &aUsername, KIGIT_AUTH_ATTEMPT &aAttempt)
 Offer the agent's keys once, then the next key file, recording in aAttempt which file was offered.
 
int HandlePlaintextAuthentication (git_cred **aOut, const wxString &aUsername)
 
int HandleSSHAgentAuthentication (git_cred **aOut, const wxString &aUsername)
 
bool IsShuttingDown () const
 Background timers ask this before starting work of their own.
 
void SetShuttingDown (bool aCancel)
 Stop the operation running now and keep later ones from starting.
 
int SSHPortFor (const wxString &aHost) const
 The SSH port the session's remote names for aHost, 22 when it names none, or -1 when the remote is on another host or its port is not valid.
 
std::unique_lock< std::mutex > TryLockAction ()
 
std::unique_lock< std::mutex > TryLockActionFor (std::chrono::milliseconds aWait)
 TryLockAction that keeps trying for aWait before giving up.
 
std::unique_lock< std::mutex > LockAction ()
 
void AddRefreshListener (void *aOwner, std::function< void()> aCallback)
 
void RemoveRefreshListener (void *aOwner)
 
void NotifyRefreshListeners ()
 

Static Public Member Functions

static REMOTE_URL ParseRemoteURL (const wxString &aURL)
 
static wxString GetLastGitError ()
 libgit2's last message, without credentials from any URL it quotes, so it is safe to show or trace.
 
static KIGIT_ERROR_INFO GetLastGitErrorInfo (int aCode)
 The error libgit2 holds for a call that returned aCode.
 
static CANCEL_TOKEN NewCancelToken ()
 

Static Public Attributes

static constexpr std::chrono::milliseconds ACTION_LOCK_WAIT { 2000 }
 Long enough for a status read to finish, short enough that a window does not look hung.
 

Protected Attributes

git_repository * m_repo
 
wxString m_projectDir
 
wxString m_projectPath
 
wxString m_attachError
 
wxString m_attachTrustCommand
 
GIT_CONN_TYPE m_connType
 
wxString m_remote
 
wxString m_urlUsername
 
wxString m_hostname
 
int m_port = 0
 
wxString m_username
 
wxString m_password
 
std::atomic< unsigned > m_testedTypes
 
std::mutex m_gitActionMutex
 
std::mutex m_credentialsMutex
 Serializes the credential fields between the UI thread and the authentication callback's worker thread.
 
std::vector< std::pair< void *, std::function< void()> > > m_refreshListeners
 

Private Member Functions

std::optional< KIGIT_AHEAD_BEHIND > compareRefs (const git_reference *aBranch, const git_reference *aBase) const
 Count commits unique to aBranch and aBase. No value if the history cannot be read.
 
CANCEL_TOKEN ActiveCancelToken () const
 
wxString remoteNameWithoutUpstream () const
 Remote to use when HEAD names no upstream, empty when several remotes leave it ambiguous.
 
void updatePublicKeys ()
 
void rebuildPublicKeysUnlocked ()
 Rebuild m_publicKeys as the project key, when offerable, then the discovered keys, and restart from the first.
 
void updateConnectionType ()
 
void updateConnectionTypeUnlocked ()
 Body of updateConnectionType, for callers that already hold m_credentialsMutex.
 

Private Attributes

std::vector< wxString > m_discoveredKeys
 
std::vector< wxString > m_publicKeys
 
wxString m_publicKeysHost
 
wxString m_projectSSHKey
 
int m_nextPublicKey
 
bool m_secretFetched
 
std::mutex m_operationMutex
 Guarded together, so a shutdown cannot miss an operation registering itself at the same moment.
 
CANCEL_TOKEN m_activeCancel
 
bool m_shutdown = false
 

Static Private Attributes

static const unsigned KIGIT_CREDENTIAL_SSH_AGENT = 1u << ( sizeof( unsigned ) * 8 - 1 )
 

Friends

class GIT_PUSH_HANDLER
 
class GIT_PULL_HANDLER
 
class GIT_CLONE_HANDLER
 
class LIBGIT_BACKEND
 

Detailed Description

The project's git session.

A project can be open before it is ever put under version control, and integration can be turned off for it, so a session with no repository is a normal state rather than a programming error. Every method answers empty, false or nothing in that case.

Definition at line 229 of file kicad_git_common.h.

Member Typedef Documentation

◆ CANCEL_TOKEN

using KIGIT_COMMON::CANCEL_TOKEN = std::shared_ptr<std::atomic<bool>>

One token per operation.

Born uncancelled, so nothing has to be reset before an operation starts and one operation's cancel cannot reach another.

Definition at line 614 of file kicad_git_common.h.

Member Enumeration Documentation

◆ GIT_CONN_TYPE

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

Definition at line 289 of file kicad_git_common.h.

◆ GIT_STATUS

enum class KIGIT_COMMON::GIT_STATUS
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 275 of file kicad_git_common.h.

Constructor & Destructor Documentation

◆ KIGIT_COMMON() [1/2]

KIGIT_COMMON::KIGIT_COMMON ( git_repository * aRepo,
const wxString & aProjectPath = wxEmptyString )

aProjectPath is the absolute project directory.

Leave it empty for handlers that do not need a project folder.

Definition at line 59 of file kicad_git_common.cpp.

References GIT_CONN_LOCAL, git_repository, m_connType, m_nextPublicKey, m_projectPath, m_repo, m_secretFetched, and m_testedTypes.

Referenced by GIT_COMMIT_HANDLER::GIT_COMMIT_HANDLER(), KIGIT_COMMON(), and KIGIT_COMMON::OPERATION_GUARD::OPERATION_GUARD().

◆ KIGIT_COMMON() [2/2]

◆ ~KIGIT_COMMON()

KIGIT_COMMON::~KIGIT_COMMON ( )

Definition at line 95 of file kicad_git_common.cpp.

Member Function Documentation

◆ AbandonOperation()

bool KIGIT_COMMON::AbandonOperation ( wxString & aError)

Drop that operation and return to the last commit. The caller holds the action lock.

Definition at line 1658 of file kicad_git_common.cpp.

References GIT_BACKEND::AbandonOperation(), GetGitBackend(), and m_repo.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ ActiveCancelToken()

CANCEL_TOKEN KIGIT_COMMON::ActiveCancelToken ( ) const
inlineprivate

Definition at line 731 of file kicad_git_common.h.

References m_activeCancel, and m_operationMutex.

Referenced by GetRecentCommits().

◆ AddRefreshListener()

void KIGIT_COMMON::AddRefreshListener ( void * aOwner,
std::function< void()> aCallback )

◆ AddRemote()

bool KIGIT_COMMON::AddRemote ( const wxString & aName,
const wxString & aUrl )

◆ ApplyPromptedCredentials()

bool KIGIT_COMMON::ApplyPromptedCredentials ( const CREDENTIAL_IDENTITY & aFor,
const PROMPTED_CREDENTIALS & aEntered )

Apply what the prompt collected, unless the session has moved to another remote since aFor was taken.

The check and the apply share one critical section, so a background fetch cannot slip between them. The per-attempt state is reset with it, so the next transfer starts over with these. Returns false, leaving everything alone, when the identity moved.

Definition at line 1928 of file kicad_git_common.cpp.

References KIGIT_COMMON::CREDENTIAL_IDENTITY::connType, KIGIT_COMMON::PROMPTED_CREDENTIALS::connType, m_connType, m_credentialsMutex, m_nextPublicKey, m_password, m_projectSSHKey, m_remote, m_secretFetched, m_testedTypes, m_username, KIGIT_COMMON::PROMPTED_CREDENTIALS::password, rebuildPublicKeysUnlocked(), KIGIT_COMMON::CREDENTIAL_IDENTITY::remote, KIGIT_COMMON::PROMPTED_CREDENTIALS::sshKey, KIGIT_COMMON::CREDENTIAL_IDENTITY::username, and KIGIT_COMMON::PROMPTED_CREDENTIALS::username.

Referenced by KIGIT::PromptForCredentials().

◆ CheckoutTag()

bool KIGIT_COMMON::CheckoutTag ( const wxString & aName)

◆ compareRefs()

std::optional< KIGIT_AHEAD_BEHIND > KIGIT_COMMON::compareRefs ( const git_reference * aBranch,
const git_reference * aBase ) const
private

Count commits unique to aBranch and aBase. No value if the history cannot be read.

Definition at line 861 of file kicad_git_common.cpp.

References KIGIT_AHEAD_BEHIND::ahead, KIGIT_AHEAD_BEHIND::behind, m_repo, and result.

Referenced by GetBranchDetail(), GetUnmergedCommitCount(), HasLocalCommits(), HasUpstreamCommits(), and LIBGIT_BACKEND.

◆ CreateBranch()

◆ CreateMergedCommit()

MergeCommitResult KIGIT_COMMON::CreateMergedCommit ( const wxString & aExpectedHeadOid,
const wxString & aTheirsOid,
const std::vector< std::pair< wxString, wxString > > & aResolvedFiles,
KIGIT_ERROR_MESSAGE & aError )

Redo the merge with each conflicted path replaced by its resolved file, then commit and check out.

All or nothing.

aTheirsOid pins the remote commit, so a background fetch cannot change what gets merged. An empty resolved-file path records "the file is deleted". A failure leaves its reason in aError's details, and a summary only when the next step is known.

Definition at line 1671 of file kicad_git_common.cpp.

References GIT_BACKEND::CreateMergedCommit(), GetGitBackend(), and m_repo.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ CreateTag()

bool KIGIT_COMMON::CreateTag ( const wxString & aName,
const wxString & aMessage = wxEmptyString )

◆ DeleteBranch()

bool KIGIT_COMMON::DeleteBranch ( const wxString & aName)

◆ DeleteTag()

bool KIGIT_COMMON::DeleteTag ( const wxString & aName)

◆ DiscardChanges()

bool KIGIT_COMMON::DiscardChanges ( const std::vector< wxString > & aPaths,
wxString & aError )

Put the given working directory relative paths back to their committed state.

A path that is not in HEAD keeps its file and loses its staged entry.

Definition at line 1598 of file kicad_git_common.cpp.

References GIT_BACKEND::DiscardChanges(), GetGitBackend(), and m_repo.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ FollowRewrittenUrl()

void KIGIT_COMMON::FollowRewrittenUrl ( const wxString & aRawUrl)

Bind the session to a URL that url.insteadOf rewrote, keeping the username, password and key entered for the original.

Definition at line 2101 of file kicad_git_common.cpp.

References m_credentialsMutex, m_password, m_secretFetched, m_username, and SyncRemoteUrl().

Referenced by DIALOG_GIT_REPOSITORY::OnTestClick().

◆ GetAttachError()

const wxString & KIGIT_COMMON::GetAttachError ( ) const
inline

Definition at line 564 of file kicad_git_common.h.

References m_attachError.

◆ GetAttachTrustCommand()

const wxString & KIGIT_COMMON::GetAttachTrustCommand ( ) const
inline

The command that trusts a repository another user owns, when that is why attaching failed.

Definition at line 567 of file kicad_git_common.h.

References m_attachTrustCommand.

◆ GetBranchDetail()

KIGIT_BRANCH_DETAIL KIGIT_COMMON::GetBranchDetail ( const wxString & aBranch) const

◆ GetBranches()

std::vector< KIGIT_BRANCH_INFO > KIGIT_COMMON::GetBranches ( ) const

Local and remote branches with their tip commits.

Symbolic aliases are omitted. Callers choose the display order.

Definition at line 524 of file kicad_git_common.cpp.

References KIGIT::DecodeRepoText(), GetLastGitError(), info, m_repo, and traceGit.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PROJECT_TREE_PANE::onGitSwitchBranch(), GIT_ADVANCED_DIALOG::populateTopBar(), and GIT_COMMIT_PANE::RefreshFileList().

◆ GetCommitDetail()

◆ GetConnType()

KIGIT_COMMON::GIT_CONN_TYPE KIGIT_COMMON::GetConnType ( ) const

◆ GetCredentialIdentity()

KIGIT_COMMON::CREDENTIAL_IDENTITY KIGIT_COMMON::GetCredentialIdentity ( ) const

Definition at line 1921 of file kicad_git_common.cpp.

References m_connType, m_credentialsMutex, m_remote, and m_username.

Referenced by KIGIT::PromptForCredentials().

◆ GetCurrentBranchName()

◆ GetDifferentFiles()

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 724 of file kicad_git_common.cpp.

References KIGIT::CollectDiffDeltas(), GetLastGitError(), IsShuttingDown(), m_repo, and traceGit.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ GetFirstOfferedSSHKey()

wxString KIGIT_COMMON::GetFirstOfferedSSHKey ( ) const

The key the next attempt will try first, for the credential prompt to show.

Empty when no key file can be offered.

Definition at line 1904 of file kicad_git_common.cpp.

References KIGIT::IsOfferableSSHKey(), m_credentialsMutex, m_projectSSHKey, and m_publicKeys.

Referenced by initialSSHKey().

◆ GetGitRootDirectory()

wxString KIGIT_COMMON::GetGitRootDirectory ( ) const

◆ GetHeadCommitId()

wxString KIGIT_COMMON::GetHeadCommitId ( ) const

Full commit ID at HEAD, or empty for an unborn or missing HEAD.

The caller holds the action lock when capturing this alongside the branch name for a later operation.

Definition at line 169 of file kicad_git_common.cpp.

References m_repo.

Referenced by PANEL_GIT_BRANCHES::onForcePush(), and GIT_COMMIT_PANE::submitPush().

◆ GetLastCommitMessage()

wxString KIGIT_COMMON::GetLastCommitMessage ( ) const

Definition at line 221 of file kicad_git_common.cpp.

References KIGIT::DecodeRepoText(), m_repo, and message.

Referenced by GIT_COMMIT_PANE::BeginAmend().

◆ GetLastFetchTime()

wxDateTime KIGIT_COMMON::GetLastFetchTime ( ) const

Definition at line 339 of file kicad_git_common.cpp.

References m_repo.

Referenced by BOOST_AUTO_TEST_CASE().

◆ GetLastGitError()

◆ GetLastGitErrorInfo()

KIGIT_ERROR_INFO KIGIT_COMMON::GetLastGitErrorInfo ( int aCode)
static

The error libgit2 holds for a call that returned aCode.

Read it straight after the call, because the callbacks and cleanup that follow can replace it.

Definition at line 2171 of file kicad_git_common.cpp.

References info.

Referenced by LIBGIT_BACKEND::Clone(), DIALOG_GIT_REPOSITORY::OnTestClick(), LIBGIT_BACKEND::PerformFetch(), LIBGIT_BACKEND::Push(), and LIBGIT_BACKEND::SetupRemote().

◆ GetMergeConflicts()

bool KIGIT_COMMON::GetMergeConflicts ( const wxString & aStageDir,
wxString & aHeadOid,
wxString & aTheirsOid,
std::vector< KIGIT_CONFLICT_SIDES > & aConflicts,
wxString & aError )

Recompute the merge in memory and extract each conflicted file's three versions into aStageDir, without touching the repository.

aHeadOid pins HEAD for CreateMergedCommit.

Definition at line 1664 of file kicad_git_common.cpp.

References GetGitBackend(), GIT_BACKEND::GetMergeConflicts(), and m_repo.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GIT_COMMIT_PANE::resolvePullConflicts().

◆ GetNextPublicKey()

wxString KIGIT_COMMON::GetNextPublicKey ( )

By value, so the caller never holds a pointer into the vector.

Definition at line 1998 of file kicad_git_common.cpp.

References KIGIT::IsOfferableSSHKey(), m_credentialsMutex, m_nextPublicKey, and m_publicKeys.

Referenced by BOOST_AUTO_TEST_CASE(), and HandleSSHKeyAuthentication().

◆ GetPassword()

◆ GetProjectDir()

wxString KIGIT_COMMON::GetProjectDir ( ) const

Return the path set by SetProjectDir(), or the repository's working directory.

Definition at line 105 of file kicad_git_common.cpp.

References m_projectDir, and m_repo.

Referenced by GetProjectPrefix().

◆ GetProjectDirs()

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

Returns
std::vector<wxString> of project files

Definition at line 655 of file kicad_git_common.cpp.

References GetLastGitError(), m_repo, and traceGit.

Referenced by BOOST_AUTO_TEST_CASE(), and KICAD_MANAGER_CONTROL::NewFromRepository().

◆ GetProjectPrefix()

std::optional< wxString > KIGIT_COMMON::GetProjectPrefix ( ) const

Project folder relative to the repository, with a trailing slash.

An empty string means the repository root. No value means the folder is unknown.

Definition at line 122 of file kicad_git_common.cpp.

References GetProjectDir(), m_projectPath, m_repo, and KIGIT::PROJECT_GIT_UTILS::ProjectPrefix().

Referenced by BuildGitChangeEntries(), KIGIT::PROJECT_GIT_UTILS::LfsRefusal(), KIGIT::PROJECT_GIT_UTILS::ProjectUsesGitLfs(), and LIBGIT_BACKEND::RestoreVersion().

◆ GetRecentCommitMessages()

std::vector< wxString > KIGIT_COMMON::GetRecentCommitMessages ( size_t aMax) const

◆ GetRecentCommits()

◆ GetRemote()

◆ GetRemotename()

wxString KIGIT_COMMON::GetRemotename ( ) const

◆ GetRemoteNameOrDefault()

wxString KIGIT_COMMON::GetRemoteNameOrDefault ( ) const

Returns GetRemotename() when non-empty, otherwise "origin".

Centralizes the fallback policy used by push/pull/fetch paths.

Definition at line 1772 of file kicad_git_common.cpp.

References GetRemotename().

Referenced by adoptRemoteHistory(), HasPushAndPullRemote(), PANEL_GIT_BRANCHES::onForcePush(), LIBGIT_BACKEND::PerformFetch(), LIBGIT_BACKEND::PerformPull(), LIBGIT_BACKEND::Push(), and resolveMissingRemote().

◆ GetRemotes()

std::vector< std::pair< wxString, wxString > > KIGIT_COMMON::GetRemotes ( ) const

Returns every remote as a (name, URL) pair.

Definition at line 1398 of file kicad_git_common.cpp.

References m_repo, name, and KIGIT::StripEmbeddedUserinfo().

Referenced by BOOST_AUTO_TEST_CASE().

◆ GetRepo()

◆ GetSSHKey()

wxString KIGIT_COMMON::GetSSHKey ( ) const

The key the project was set up with, even when its file is gone, otherwise the first key offered.

Empty when none is known.

Definition at line 1893 of file kicad_git_common.cpp.

References m_credentialsMutex, m_projectSSHKey, and m_publicKeys.

◆ GetStashDetail()

KIGIT_STASH_DETAIL KIGIT_COMMON::GetStashDetail ( const wxString & aId) const

◆ GetStashes()

◆ GetTagDetail()

KIGIT_TAG_DETAIL KIGIT_COMMON::GetTagDetail ( const wxString & aName) const

Definition at line 1493 of file kicad_git_common.cpp.

References KIGIT::DecodeRepoText(), m_repo, and message.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GetTags().

◆ GetTags()

std::vector< KIGIT_TAG_INFO > KIGIT_COMMON::GetTags ( ) const

◆ GetUnmergedCommitCount()

std::optional< size_t > KIGIT_COMMON::GetUnmergedCommitCount ( const wxString & aBranch) const

Commits in aBranch that HEAD does not contain. No value when either cannot be read.

Definition at line 964 of file kicad_git_common.cpp.

References compareRefs(), and m_repo.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ GetUsername()

◆ GetWorkingTreeLineStats()

std::pair< int, int > KIGIT_COMMON::GetWorkingTreeLineStats ( const std::set< wxString > & aPaths) const

◆ HandlePlaintextAuthentication()

int KIGIT_COMMON::HandlePlaintextAuthentication ( git_cred ** aOut,
const wxString & aUsername )

Definition at line 2585 of file kicad_git_common.cpp.

References GetPassword(), and m_testedTypes.

Referenced by credentials_cb().

◆ HandleSSHAgentAuthentication()

int KIGIT_COMMON::HandleSSHAgentAuthentication ( git_cred ** aOut,
const wxString & aUsername )

◆ HandleSSHKeyAuthentication()

int KIGIT_COMMON::HandleSSHKeyAuthentication ( git_cred ** aOut,
const wxString & aUsername,
KIGIT_AUTH_ATTEMPT & aAttempt )

Offer the agent's keys once, then the next key file, recording in aAttempt which file was offered.

Definition at line 2543 of file kicad_git_common.cpp.

References KIGIT_AUTH_ATTEMPT::agentTried, GetLastGitError(), GetNextPublicKey(), GetPassword(), HandleSSHAgentAuthentication(), KIGIT_AUTH_ATTEMPT::keysTried, KIGIT_CREDENTIAL_SSH_AGENT, m_testedTypes, and traceGit.

Referenced by credentials_cb().

◆ HasLocalCommits()

bool KIGIT_COMMON::HasLocalCommits ( ) const

True when HEAD has commits its upstream does not, or has no upstream yet.

False for a detached or unborn HEAD.

Definition at line 891 of file kicad_git_common.cpp.

References compareRefs(), IsHeadDetached(), m_repo, and result.

Referenced by amendRefusal(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GIT_COMMIT_PANE::RefreshFileList().

◆ HasPushAndPullRemote()

◆ HasUncommittedTrackedChanges()

bool KIGIT_COMMON::HasUncommittedTrackedChanges ( bool * aReadOk = nullptr) const

◆ HasUpstreamCommits()

bool KIGIT_COMMON::HasUpstreamCommits ( ) const

True when the upstream branch has commits the current branch does not.

Definition at line 941 of file kicad_git_common.cpp.

References compareRefs(), and m_repo.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and GIT_COMMIT_PANE::RefreshFileList().

◆ IsHeadDetached()

bool KIGIT_COMMON::IsHeadDetached ( ) const

True when HEAD points at a commit rather than a branch, as after checking out a tag.

Definition at line 918 of file kicad_git_common.cpp.

References m_repo.

Referenced by amendRefusal(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), HasLocalCommits(), PANEL_GIT_BRANCHES::onForcePush(), PANEL_GIT_HISTORY::onRestoreVersion(), and GIT_COMMIT_PANE::RefreshFileList().

◆ IsHeadUnborn()

bool KIGIT_COMMON::IsHeadUnborn ( ) const

True while the repository has no commits, so HEAD names a branch that does not exist yet.

Definition at line 1430 of file kicad_git_common.cpp.

References m_repo.

Referenced by amendRefusal(), BOOST_AUTO_TEST_CASE(), moveToNewBranch(), and StartUnbornBranch().

◆ IsOperationInProgress()

bool KIGIT_COMMON::IsOperationInProgress ( ) const

True while a merge, rebase, cherry-pick or revert is in progress, which refuses commits.

Definition at line 1630 of file kicad_git_common.cpp.

References m_repo.

Referenced by amendRefusal(), BOOST_AUTO_TEST_CASE(), and GIT_COMMIT_PANE::RefreshFileList().

◆ IsPathConflicted()

bool KIGIT_COMMON::IsPathConflicted ( const wxString & aPath) const

True while aPath is one of the files a merge or rebase stopped on.

Definition at line 1610 of file kicad_git_common.cpp.

References index, and m_repo.

Referenced by BOOST_AUTO_TEST_CASE(), and GIT_COMMIT_PANE::discardFile().

◆ IsPathInHead()

bool KIGIT_COMMON::IsPathInHead ( const wxString & aPath)

True when the working directory relative path exists in the HEAD commit's tree.

Definition at line 1604 of file kicad_git_common.cpp.

References GetGitBackend(), GIT_BACKEND::IsPathInHead(), and m_repo.

Referenced by BOOST_AUTO_TEST_CASE(), GIT_COMMIT_PANE::discardFile(), and MaterializeWorkingFile().

◆ IsPullRebaseConfigured()

bool KIGIT_COMMON::IsPullRebaseConfigured ( ) const

True when the repository is set to rebase rather than merge when getting changes.

Definition at line 924 of file kicad_git_common.cpp.

References config, and m_repo.

Referenced by BOOST_AUTO_TEST_CASE(), and GIT_COMMIT_PANE::resolvePullConflicts().

◆ IsShuttingDown()

bool KIGIT_COMMON::IsShuttingDown ( ) const
inline

Background timers ask this before starting work of their own.

Definition at line 654 of file kicad_git_common.h.

References m_operationMutex, and m_shutdown.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), GetDifferentFiles(), and GetRecentCommits().

◆ LockAction()

◆ NewCancelToken()

static CANCEL_TOKEN KIGIT_COMMON::NewCancelToken ( )
inlinestatic

◆ NotifyRefreshListeners()

void KIGIT_COMMON::NotifyRefreshListeners ( )

◆ OperationInProgress()

GitOperation KIGIT_COMMON::OperationInProgress ( ) const

Which operation that is, so the panel can name it.

Definition at line 1636 of file kicad_git_common.cpp.

References CherryPick, m_repo, Merge, None, Other, Rebase, and Revert.

Referenced by BOOST_AUTO_TEST_CASE(), and GIT_COMMIT_PANE::RefreshFileList().

◆ ParseRemoteURL()

◆ rebuildPublicKeysUnlocked()

void KIGIT_COMMON::rebuildPublicKeysUnlocked ( )
private

Rebuild m_publicKeys as the project key, when offerable, then the discovered keys, and restart from the first.

The caller holds m_credentialsMutex.

Definition at line 1980 of file kicad_git_common.cpp.

References KIGIT::IsOfferableSSHKey(), KIGIT::IsSameSSHKey(), m_discoveredKeys, m_nextPublicKey, m_projectSSHKey, m_publicKeys, and traceGit.

Referenced by ApplyPromptedCredentials(), SetSSHKey(), and updatePublicKeys().

◆ remoteNameWithoutUpstream()

wxString KIGIT_COMMON::remoteNameWithoutUpstream ( ) const
private

Remote to use when HEAD names no upstream, empty when several remotes leave it ambiguous.

Definition at line 1783 of file kicad_git_common.cpp.

References GetLastGitError(), m_repo, and traceGit.

Referenced by GetRemotename().

◆ RemoveRefreshListener()

void KIGIT_COMMON::RemoveRefreshListener ( void * aOwner)

◆ RemoveRemote()

bool KIGIT_COMMON::RemoveRemote ( const wxString & aName)

◆ ResetNextKey()

void KIGIT_COMMON::ResetNextKey ( )
inline

Definition at line 569 of file kicad_git_common.h.

References m_credentialsMutex, and m_nextPublicKey.

Referenced by BOOST_AUTO_TEST_CASE().

◆ RestoreVersion()

RestoreResult KIGIT_COMMON::RestoreVersion ( const wxString & aCommitHash,
KIGIT_ERROR_MESSAGE & aError )

Restore the project as it was at aCommitHash, recorded as a new commit on top of the current head.

Only the session's project folder is restored. A failure leaves its reason in aError's details, and a summary only when the next step is known.

Definition at line 1592 of file kicad_git_common.cpp.

References GetGitBackend(), and GIT_BACKEND::RestoreVersion().

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ SetAttachError()

void KIGIT_COMMON::SetAttachError ( const wxString & aError,
const wxString & aTrustCommand = wxEmptyString )
inline

Why binding a repository last failed, for the panels to show. Empty on success.

Definition at line 558 of file kicad_git_common.h.

References m_attachError, and m_attachTrustCommand.

◆ SetConnType()

void KIGIT_COMMON::SetConnType ( GIT_CONN_TYPE aConnType)

For a remote whose address names no transport, the user picks one in the prompt.

Definition at line 2130 of file kicad_git_common.cpp.

References m_connType, and m_credentialsMutex.

◆ SetPassword()

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

◆ SetProjectDir()

void KIGIT_COMMON::SetProjectDir ( const wxString & aProjectDir)
inline

Keep symlinks in the repository path so Git status paths match the project tree.

Definition at line 546 of file kicad_git_common.h.

References m_projectDir.

Referenced by PROJECT_TREE_PANE::onGitInitializeProject().

◆ SetRemote()

◆ SetRemoteUrl()

bool KIGIT_COMMON::SetRemoteUrl ( const wxString & aName,
const wxString & aUrl )

◆ SetRepo()

◆ SetShuttingDown()

void KIGIT_COMMON::SetShuttingDown ( bool aCancel)
inline

Stop the operation running now and keep later ones from starting.

Definition at line 661 of file kicad_git_common.h.

References m_activeCancel, m_operationMutex, and m_shutdown.

Referenced by BOOST_AUTO_TEST_CASE(), and PROJECT_TREE_PANE::onGitInitializeProject().

◆ SetSSHKey()

void KIGIT_COMMON::SetSSHKey ( const wxString & aSSHKey)

◆ SetUserConfig()

bool KIGIT_COMMON::SetUserConfig ( const wxString & aName,
const wxString & aEmail )

◆ SetUsername()

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

◆ SSHPortFor()

int KIGIT_COMMON::SSHPortFor ( const wxString & aHost) const

The SSH port the session's remote names for aHost, 22 when it names none, or -1 when the remote is on another host or its port is not valid.

Definition at line 1956 of file kicad_git_common.cpp.

References m_credentialsMutex, m_hostname, and m_port.

Referenced by certificate_check_cb().

◆ StartUnbornBranch()

bool KIGIT_COMMON::StartUnbornBranch ( const wxString & aName)

Point HEAD at a branch that does not exist yet, so the first commit creates it.

Only meaningful while the repository has no commits. With no commit to start it at, a branch cannot be created any other way.

Definition at line 1436 of file kicad_git_common.cpp.

References KIGIT::BranchNameError(), IsHeadUnborn(), and m_repo.

Referenced by BOOST_AUTO_TEST_CASE(), and moveToNewBranch().

◆ StashApply()

bool KIGIT_COMMON::StashApply ( size_t aIndex)

◆ StashDrop()

bool KIGIT_COMMON::StashDrop ( size_t aIndex)

◆ StashPop()

bool KIGIT_COMMON::StashPop ( size_t aIndex)

◆ StashSave()

bool KIGIT_COMMON::StashSave ( const wxString & aMessage)

Set the uncommitted tracked changes aside as a new stash, as git stash push would.

Definition at line 1463 of file kicad_git_common.cpp.

References GetGitBackend(), m_repo, and GIT_BACKEND::StashSave().

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ SyncRemoteUrl()

void KIGIT_COMMON::SyncRemoteUrl ( const wxString & aRawUrl)

Bind the session to the URL a transfer is about to connect to.

An unchanged URL keeps the session credentials, so a password corrected in the prompt outlives a stale one in the URL. A changed URL replaces the username and password with its own, clearing any it lacks.

Definition at line 2070 of file kicad_git_common.cpp.

References KIGIT_COMMON::REMOTE_URL::connType, KIGIT_COMMON::REMOTE_URL::hostname, m_connType, m_credentialsMutex, m_hostname, m_password, m_port, m_publicKeysHost, m_remote, m_secretFetched, m_urlUsername, m_username, ParseRemoteURL(), KIGIT_COMMON::REMOTE_URL::password, KIGIT_COMMON::REMOTE_URL::port, updatePublicKeys(), KIGIT_COMMON::REMOTE_URL::url, and KIGIT_COMMON::REMOTE_URL::username.

Referenced by credentials_cb(), FollowRewrittenUrl(), LIBGIT_BACKEND::PerformFetch(), LIBGIT_BACKEND::Push(), resolveMissingRemote(), SetRemote(), and UpdateCurrentBranchInfo().

◆ TestedTypes()

std::atomic< unsigned > & KIGIT_COMMON::TestedTypes ( )
inline

Definition at line 377 of file kicad_git_common.h.

References m_testedTypes.

◆ TryLockAction()

std::unique_lock< std::mutex > KIGIT_COMMON::TryLockAction ( )
inline

Definition at line 674 of file kicad_git_common.h.

References m_gitActionMutex.

Referenced by KIGIT::TryLockAction().

◆ TryLockActionFor()

std::unique_lock< std::mutex > KIGIT_COMMON::TryLockActionFor ( std::chrono::milliseconds aWait)

TryLockAction that keeps trying for aWait before giving up.

For the UI thread, where a blocking LockAction could wait out a whole network timeout.

Definition at line 1967 of file kicad_git_common.cpp.

References m_gitActionMutex.

Referenced by resolveMissingRemote(), and KIGIT::WaitForActionLock().

◆ updateConnectionType()

void KIGIT_COMMON::updateConnectionType ( )
private

Definition at line 2517 of file kicad_git_common.cpp.

References m_credentialsMutex, and updateConnectionTypeUnlocked().

◆ updateConnectionTypeUnlocked()

void KIGIT_COMMON::updateConnectionTypeUnlocked ( )
private

◆ UpdateCurrentBranchInfo()

void KIGIT_COMMON::UpdateCurrentBranchInfo ( )

◆ updatePublicKeys()

void KIGIT_COMMON::updatePublicKeys ( )
private

Friends And Related Symbol Documentation

◆ GIT_CLONE_HANDLER

friend class GIT_CLONE_HANDLER
friend

Definition at line 724 of file kicad_git_common.h.

References GIT_CLONE_HANDLER.

Referenced by GIT_CLONE_HANDLER.

◆ GIT_PULL_HANDLER

friend class GIT_PULL_HANDLER
friend

Definition at line 723 of file kicad_git_common.h.

References GIT_PULL_HANDLER.

Referenced by GIT_PULL_HANDLER.

◆ GIT_PUSH_HANDLER

friend class GIT_PUSH_HANDLER
friend

Definition at line 722 of file kicad_git_common.h.

References GIT_PUSH_HANDLER.

Referenced by GIT_PUSH_HANDLER.

◆ LIBGIT_BACKEND

friend class LIBGIT_BACKEND
friend

Definition at line 725 of file kicad_git_common.h.

References compareRefs(), and LIBGIT_BACKEND.

Referenced by LIBGIT_BACKEND.

Member Data Documentation

◆ ACTION_LOCK_WAIT

std::chrono::milliseconds KIGIT_COMMON::ACTION_LOCK_WAIT { 2000 }
staticconstexpr

Long enough for a status read to finish, short enough that a window does not look hung.

Definition at line 680 of file kicad_git_common.h.

Referenced by PROJECT_TREE_PANE::onGitInitializeProject(), resolveMissingRemote(), and KIGIT::WaitForActionLock().

◆ KIGIT_CREDENTIAL_SSH_AGENT

const unsigned KIGIT_COMMON::KIGIT_CREDENTIAL_SSH_AGENT = 1u << ( sizeof( unsigned ) * 8 - 1 )
staticprivate

Definition at line 766 of file kicad_git_common.h.

Referenced by HandleSSHAgentAuthentication(), and HandleSSHKeyAuthentication().

◆ m_activeCancel

CANCEL_TOKEN KIGIT_COMMON::m_activeCancel
private

Definition at line 760 of file kicad_git_common.h.

Referenced by ActiveCancelToken(), and SetShuttingDown().

◆ m_attachError

wxString KIGIT_COMMON::m_attachError
protected

Definition at line 699 of file kicad_git_common.h.

Referenced by GetAttachError(), and SetAttachError().

◆ m_attachTrustCommand

wxString KIGIT_COMMON::m_attachTrustCommand
protected

Definition at line 700 of file kicad_git_common.h.

Referenced by GetAttachTrustCommand(), and SetAttachError().

◆ m_connType

◆ m_credentialsMutex

std::mutex KIGIT_COMMON::m_credentialsMutex
mutableprotected

Serializes the credential fields between the UI thread and the authentication callback's worker thread.

wxString is copy on write, so a read racing a write corrupts it. Separate from m_gitActionMutex, which the worker holds while the callback runs.

Definition at line 717 of file kicad_git_common.h.

Referenced by ApplyPromptedCredentials(), FollowRewrittenUrl(), GetConnType(), GetCredentialIdentity(), GetFirstOfferedSSHKey(), GetNextPublicKey(), GetPassword(), GetRemote(), GetSSHKey(), GetUsername(), ResetNextKey(), SetConnType(), SetPassword(), SetRemote(), SetSSHKey(), SetUsername(), SSHPortFor(), SyncRemoteUrl(), updateConnectionType(), and updatePublicKeys().

◆ m_discoveredKeys

std::vector<wxString> KIGIT_COMMON::m_discoveredKeys
private

Definition at line 750 of file kicad_git_common.h.

Referenced by KIGIT_COMMON(), rebuildPublicKeysUnlocked(), and updatePublicKeys().

◆ m_gitActionMutex

std::mutex KIGIT_COMMON::m_gitActionMutex
protected

Definition at line 712 of file kicad_git_common.h.

Referenced by KIGIT_COMMON(), LockAction(), TryLockAction(), and TryLockActionFor().

◆ m_hostname

wxString KIGIT_COMMON::m_hostname
protected

◆ m_nextPublicKey

int KIGIT_COMMON::m_nextPublicKey
private

◆ m_operationMutex

std::mutex KIGIT_COMMON::m_operationMutex
mutableprivate

Guarded together, so a shutdown cannot miss an operation registering itself at the same moment.

The token is null when nothing is running.

Definition at line 759 of file kicad_git_common.h.

Referenced by ActiveCancelToken(), IsShuttingDown(), and SetShuttingDown().

◆ m_password

wxString KIGIT_COMMON::m_password
protected

◆ m_port

int KIGIT_COMMON::m_port = 0
protected

◆ m_projectDir

wxString KIGIT_COMMON::m_projectDir
protected

Definition at line 697 of file kicad_git_common.h.

Referenced by GetProjectDir(), KIGIT_COMMON(), and SetProjectDir().

◆ m_projectPath

wxString KIGIT_COMMON::m_projectPath
protected

Definition at line 698 of file kicad_git_common.h.

Referenced by GetProjectPrefix(), KIGIT_COMMON(), and KIGIT_COMMON().

◆ m_projectSSHKey

wxString KIGIT_COMMON::m_projectSSHKey
private

◆ m_publicKeys

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

◆ m_publicKeysHost

wxString KIGIT_COMMON::m_publicKeysHost
private

Definition at line 752 of file kicad_git_common.h.

Referenced by KIGIT_COMMON(), SyncRemoteUrl(), and updatePublicKeys().

◆ m_refreshListeners

std::vector<std::pair<void*, std::function<void()> > > KIGIT_COMMON::m_refreshListeners
protected

◆ m_remote

◆ m_repo

◆ m_secretFetched

◆ m_shutdown

bool KIGIT_COMMON::m_shutdown = false
private

Definition at line 761 of file kicad_git_common.h.

Referenced by IsShuttingDown(), and SetShuttingDown().

◆ m_testedTypes

std::atomic<unsigned> KIGIT_COMMON::m_testedTypes
protected

◆ m_urlUsername

wxString KIGIT_COMMON::m_urlUsername
protected

Definition at line 704 of file kicad_git_common.h.

Referenced by KIGIT_COMMON(), SyncRemoteUrl(), and updateConnectionTypeUnlocked().

◆ m_username


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