KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
git_pull_handler.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 3
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/gpl-3.0.html
19 * or you may search the http://www.gnu.org website for the version 3 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include "git_pull_handler.h"
27#include <trace_helpers.h>
28
29#include <wx/log.h>
30
31#include <iostream>
32#include <time.h>
33#include <memory>
34
36{
37}
38
39
41{
42}
43
44
45bool GIT_PULL_HANDLER::PerformFetch( bool aSkipLock )
46{
47 if( !GetRepo() )
48 {
49 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformFetch() - No repository found" );
50 return false;
51 }
52
53 std::unique_lock<std::mutex> lock( GetCommon()->m_gitActionMutex, std::try_to_lock );
54
55 if( !aSkipLock && !lock.owns_lock() )
56 {
57 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformFetch() - Could not lock mutex" );
58 return false;
59 }
60
61 // Fetch updates from remote repository
62 git_remote* remote = nullptr;
63
64 if( git_remote_lookup( &remote, GetRepo(), "origin" ) != 0 )
65 {
66 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformFetch() - Failed to lookup remote 'origin'" );
67 AddErrorString( wxString::Format( _( "Could not lookup remote '%s'" ), "origin" ) );
68 return false;
69 }
70
71 KIGIT::GitRemotePtr remotePtr( remote );
72
73 git_remote_callbacks remoteCallbacks;
74 git_remote_init_callbacks( &remoteCallbacks, GIT_REMOTE_CALLBACKS_VERSION );
75 remoteCallbacks.sideband_progress = progress_cb;
76 remoteCallbacks.transfer_progress = transfer_progress_cb;
77 remoteCallbacks.credentials = credentials_cb;
78 remoteCallbacks.payload = this;
79
80 TestedTypes() = 0;
82
83 if( git_remote_connect( remote, GIT_DIRECTION_FETCH, &remoteCallbacks, nullptr, nullptr ) )
84 {
85 wxString errorMsg = KIGIT_COMMON::GetLastGitError();
86 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformFetch() - Failed to connect to remote: %s", errorMsg );
87 AddErrorString( wxString::Format( _( "Could not connect to remote '%s': %s" ), "origin", errorMsg ) );
88 return false;
89 }
90
91 git_fetch_options fetchOptions;
92 git_fetch_init_options( &fetchOptions, GIT_FETCH_OPTIONS_VERSION );
93 fetchOptions.callbacks = remoteCallbacks;
94
95 if( git_remote_fetch( remote, nullptr, &fetchOptions, nullptr ) )
96 {
97 wxString errorMsg = KIGIT_COMMON::GetLastGitError();
98 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformFetch() - Failed to fetch from remote: %s", errorMsg );
99 AddErrorString( wxString::Format( _( "Could not fetch data from remote '%s': %s" ), "origin", errorMsg ) );
100 return false;
101 }
102
103 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformFetch() - Fetch completed successfully" );
104 return true;
105}
106
107
109{
110 PullResult result = PullResult::Success;
111 std::unique_lock<std::mutex> lock( GetCommon()->m_gitActionMutex, std::try_to_lock );
112
113 if( !lock.owns_lock() )
114 {
115 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformPull() - Could not lock mutex" );
116 return PullResult::Error;
117 }
118
119 if( !PerformFetch( true ) )
120 return PullResult::Error;
121
122 git_oid pull_merge_oid = {};
123
124 if( git_repository_fetchhead_foreach( GetRepo(), fetchhead_foreach_cb,
125 &pull_merge_oid ) )
126 {
127 AddErrorString( _( "Could not read 'FETCH_HEAD'" ) );
128 return PullResult::Error;
129 }
130
131 git_annotated_commit* fetchhead_commit;
132
133 if( git_annotated_commit_lookup( &fetchhead_commit, GetRepo(), &pull_merge_oid ) )
134 {
135 AddErrorString( _( "Could not lookup commit" ) );
136 return PullResult::Error;
137 }
138
139 KIGIT::GitAnnotatedCommitPtr fetchheadCommitPtr( fetchhead_commit );
140 const git_annotated_commit* merge_commits[] = { fetchhead_commit };
141 git_merge_analysis_t merge_analysis;
142 git_merge_preference_t merge_preference = GIT_MERGE_PREFERENCE_NONE;
143
144 if( git_merge_analysis( &merge_analysis, &merge_preference, GetRepo(), merge_commits, 1 ) )
145 {
146 AddErrorString( _( "Could not analyze merge" ) );
147 return PullResult::Error;
148 }
149
150 if( merge_analysis & GIT_MERGE_ANALYSIS_UNBORN )
151 {
152 AddErrorString( _( "Invalid HEAD. Cannot merge." ) );
153 return PullResult::MergeFailed;
154 }
155
156 // Nothing to do if the repository is up to date
157 if( merge_analysis & GIT_MERGE_ANALYSIS_UP_TO_DATE )
158 {
159 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformPull() - Repository is up to date" );
160 git_repository_state_cleanup( GetRepo() );
161 return PullResult::UpToDate;
162 }
163
164 // Fast-forward is easy, just update the local reference
165 if( merge_analysis & GIT_MERGE_ANALYSIS_FASTFORWARD )
166 {
167 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformPull() - Fast-forward merge" );
168 return handleFastForward();
169 }
170
171 if( merge_analysis & GIT_MERGE_ANALYSIS_NORMAL )
172 {
173 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformPull() - Normal merge" );
174
175 // Check git config to determine if we should rebase or merge
176 git_config* config = nullptr;
177
178 if( git_repository_config( &config, GetRepo() ) != GIT_OK )
179 {
180 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformPull() - Failed to get repository config" );
181 AddErrorString( _( "Could not access repository configuration" ) );
182 return PullResult::Error;
183 }
184
185 KIGIT::GitConfigPtr configPtr( config );
186
187 // Check for pull.rebase config
188 int rebase_value = 0;
189 int ret = git_config_get_bool( &rebase_value, config, "pull.rebase" );
190
191 // If pull.rebase is set to true, use rebase; otherwise use merge
192 if( ret == GIT_OK && rebase_value )
193 {
194 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformPull() - Using rebase based on config" );
195 return handleRebase( merge_commits, 1 );
196 }
197
198 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformPull() - Using merge based on config" );
199 return handleMerge( merge_commits, 1 );
200 }
201
202 wxLogTrace( traceGit, "GIT_PULL_HANDLER::PerformPull() - Merge needs resolution" );
203 //TODO: handle merges when they need to be resolved
204
205 return result;
206}
207
208const std::vector<std::pair<std::string, std::vector<CommitDetails>>>&
210{
211 return m_fetchResults;
212}
213
214
215std::string GIT_PULL_HANDLER::getFirstLineFromCommitMessage( const std::string& aMessage )
216{
217 if( aMessage.empty() )
218 return aMessage;
219
220 size_t firstLineEnd = aMessage.find_first_of( '\n' );
221
222 if( firstLineEnd != std::string::npos )
223 return aMessage.substr( 0, firstLineEnd );
224
225 return aMessage;
226}
227
228
229std::string GIT_PULL_HANDLER::getFormattedCommitDate( const git_time& aTime )
230{
231 char dateBuffer[64];
232 time_t time = static_cast<time_t>( aTime.time );
233 struct tm timeInfo;
234 #ifdef _WIN32
235 localtime_s( &timeInfo, &time );
236 #else
237 gmtime_r( &time, &timeInfo );
238 #endif
239 strftime( dateBuffer, sizeof( dateBuffer ), "%Y-%b-%d %H:%M:%S", &timeInfo );
240 return dateBuffer;
241}
242
243
245{
246 git_reference* rawRef = nullptr;
247
248 // Get the current HEAD reference
249 if( git_repository_head( &rawRef, GetRepo() ) )
250 {
251 AddErrorString( _( "Could not get repository head" ) );
252 return PullResult::Error;
253 }
254
255 KIGIT::GitReferencePtr headRef( rawRef );
256
257 git_oid updatedRefOid;
258 const char* currentBranchName = git_reference_name( rawRef );
259 wxString remoteBranchName = wxString::Format( "refs/remotes/origin/%s",
260 currentBranchName + strlen( "refs/heads/" ) );
261
262 // Get the OID of the updated reference (remote-tracking branch)
263 if( git_reference_name_to_id( &updatedRefOid, GetRepo(), remoteBranchName.c_str() ) != GIT_OK )
264 {
265 AddErrorString( wxString::Format( _( "Could not get reference OID for reference '%s'" ),
266 remoteBranchName ) );
267 return PullResult::Error;
268 }
269
270 // Get the target commit object
271 git_commit* targetCommit = nullptr;
272
273 if( git_commit_lookup( &targetCommit, GetRepo(), &updatedRefOid ) != GIT_OK )
274 {
275 AddErrorString( _( "Could not look up target commit" ) );
276 return PullResult::Error;
277 }
278
279 KIGIT::GitCommitPtr targetCommitPtr( targetCommit );
280
281 // Get the tree from the target commit
282 git_tree* targetTree = nullptr;
283
284 if( git_commit_tree( &targetTree, targetCommit ) != GIT_OK )
285 {
286 git_commit_free( targetCommit );
287 AddErrorString( _( "Could not get tree from target commit" ) );
288 return PullResult::Error;
289 }
290
291 KIGIT::GitTreePtr targetTreePtr( targetTree );
292
293 // Perform a checkout to update the working directory
294 git_checkout_options checkoutOptions;
295 git_checkout_init_options( &checkoutOptions, GIT_CHECKOUT_OPTIONS_VERSION );
296 auto notify_cb = []( git_checkout_notify_t why, const char* path, const git_diff_file* baseline,
297 const git_diff_file* target, const git_diff_file* workdir, void* payload ) -> int
298 {
299 switch( why )
300 {
301 case GIT_CHECKOUT_NOTIFY_CONFLICT:
302 wxLogTrace( traceGit, "Checkout conflict: %s", path ? path : "unknown" );
303 break;
304 case GIT_CHECKOUT_NOTIFY_DIRTY:
305 wxLogTrace( traceGit, "Checkout dirty: %s", path ? path : "unknown" );
306 break;
307 case GIT_CHECKOUT_NOTIFY_UPDATED:
308 wxLogTrace( traceGit, "Checkout updated: %s", path ? path : "unknown" );
309 break;
310 case GIT_CHECKOUT_NOTIFY_UNTRACKED:
311 wxLogTrace( traceGit, "Checkout untracked: %s", path ? path : "unknown" );
312 break;
313 case GIT_CHECKOUT_NOTIFY_IGNORED:
314 wxLogTrace( traceGit, "Checkout ignored: %s", path ? path : "unknown" );
315 break;
316 default:
317 break;
318 }
319
320 return 0;
321 };
322
323 checkoutOptions.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_ALLOW_CONFLICTS;
324 checkoutOptions.notify_flags = GIT_CHECKOUT_NOTIFY_ALL;
325 checkoutOptions.notify_cb = notify_cb;
326
327 if( git_checkout_tree( GetRepo(), reinterpret_cast<git_object*>( targetTree ), &checkoutOptions ) != GIT_OK )
328 {
329 AddErrorString( _( "Failed to perform checkout operation." ) );
330 return PullResult::Error;
331 }
332
333 git_reference* updatedRef = nullptr;
334
335 // Update the current branch to point to the new commit
336 if (git_reference_set_target(&updatedRef, rawRef, &updatedRefOid, nullptr) != GIT_OK)
337 {
338 AddErrorString( wxString::Format( _( "Failed to update reference '%s' to point to '%s'" ), currentBranchName,
339 git_oid_tostr_s( &updatedRefOid ) ) );
340 return PullResult::Error;
341 }
342
343 KIGIT::GitReferencePtr updatedRefPtr( updatedRef );
344
345 // Clean up the repository state
346 if( git_repository_state_cleanup( GetRepo() ) != GIT_OK )
347 {
348 AddErrorString( _( "Failed to clean up repository state after fast-forward." ) );
349 return PullResult::Error;
350 }
351
352 git_revwalk* revWalker = nullptr;
353
354 // Collect commit details for updated references
355 if( git_revwalk_new( &revWalker, GetRepo() ) != GIT_OK )
356 {
357 AddErrorString( _( "Failed to initialize revision walker." ) );
358 return PullResult::Error;
359 }
360
361 KIGIT::GitRevWalkPtr revWalkerPtr( revWalker );
362 git_revwalk_sorting( revWalker, GIT_SORT_TIME );
363
364 if( git_revwalk_push_glob( revWalker, currentBranchName ) != GIT_OK )
365 {
366 AddErrorString( _( "Failed to push reference to revision walker." ) );
367 return PullResult::Error;
368 }
369
370 std::pair<std::string, std::vector<CommitDetails>>& branchCommits = m_fetchResults.emplace_back();
371 branchCommits.first = currentBranchName;
372
373 git_oid commitOid;
374
375 while( git_revwalk_next( &commitOid, revWalker ) == GIT_OK )
376 {
377 git_commit* commit = nullptr;
378
379 if( git_commit_lookup( &commit, GetRepo(), &commitOid ) )
380 {
381 AddErrorString( wxString::Format( _( "Could not lookup commit '%s'" ),
382 git_oid_tostr_s( &commitOid ) ) );
383 return PullResult::Error;
384 }
385
386 KIGIT::GitCommitPtr commitPtr( commit );
387
388 CommitDetails details;
389 details.m_sha = git_oid_tostr_s( &commitOid );
390 details.m_firstLine = getFirstLineFromCommitMessage( git_commit_message( commit ) );
391 details.m_author = git_commit_author( commit )->name;
392 details.m_date = getFormattedCommitDate( git_commit_author( commit )->when );
393
394 branchCommits.second.push_back( details );
395 }
396
397 return PullResult::FastForward;
398}
399
400
401PullResult GIT_PULL_HANDLER::handleMerge( const git_annotated_commit** aMergeHeads,
402 size_t aMergeHeadsCount )
403{
404 git_merge_options merge_opts;
405 git_merge_options_init( &merge_opts, GIT_MERGE_OPTIONS_VERSION );
406
407 git_checkout_options checkout_opts;
408 git_checkout_init_options( &checkout_opts, GIT_CHECKOUT_OPTIONS_VERSION );
409
410 checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE;
411
412 if( git_merge( GetRepo(), aMergeHeads, aMergeHeadsCount, &merge_opts, &checkout_opts ) )
413 {
414 AddErrorString( _( "Could not merge commits" ) );
415 return PullResult::Error;
416 }
417
418 // Get the repository index
419 git_index* index = nullptr;
420
421 if( git_repository_index( &index, GetRepo() ) )
422 {
423 AddErrorString( _( "Could not get repository index" ) );
424 return PullResult::Error;
425 }
426
427 KIGIT::GitIndexPtr indexPtr( index );
428
429 // Check for conflicts
430 git_index_conflict_iterator* conflicts = nullptr;
431
432 if( git_index_conflict_iterator_new( &conflicts, index ) )
433 {
434 AddErrorString( _( "Could not get conflict iterator" ) );
435 return PullResult::Error;
436 }
437
438 KIGIT::GitIndexConflictIteratorPtr conflictsPtr( conflicts );
439
440 const git_index_entry* ancestor = nullptr;
441 const git_index_entry* our = nullptr;
442 const git_index_entry* their = nullptr;
443 std::vector<ConflictData> conflict_data;
444
445 while( git_index_conflict_next( &ancestor, &our, &their, conflicts ) == 0 )
446 {
447 // Case 3: Both files have changed
448 if( ancestor && our && their )
449 {
450 ConflictData conflict_datum;
451 conflict_datum.filename = our->path;
452 conflict_datum.our_oid = our->id;
453 conflict_datum.their_oid = their->id;
454 conflict_datum.our_commit_time = our->mtime.seconds;
455 conflict_datum.their_commit_time = their->mtime.seconds;
456 conflict_datum.our_status = _( "Changed" );
457 conflict_datum.their_status = _( "Changed" );
458 conflict_datum.use_ours = true;
459
460 conflict_data.push_back( conflict_datum );
461 }
462 // Case 4: File added in both ours and theirs
463 else if( !ancestor && our && their )
464 {
465 ConflictData conflict_datum;
466 conflict_datum.filename = our->path;
467 conflict_datum.our_oid = our->id;
468 conflict_datum.their_oid = their->id;
469 conflict_datum.our_commit_time = our->mtime.seconds;
470 conflict_datum.their_commit_time = their->mtime.seconds;
471 conflict_datum.our_status = _( "Added" );
472 conflict_datum.their_status = _( "Added" );
473 conflict_datum.use_ours = true;
474
475 conflict_data.push_back( conflict_datum );
476 }
477 // Case 1: Remote file has changed or been added, local file has not
478 else if( their && !our )
479 {
480 // Accept their changes
481 git_index_add( index, their );
482 }
483 // Case 2: Local file has changed or been added, remote file has not
484 else if( our && !their )
485 {
486 // Accept our changes
487 git_index_add( index, our );
488 }
489 else
490 {
491 wxLogError( wxS( "Unexpected conflict state" ) );
492 }
493 }
494
495 if( conflict_data.empty() )
496 {
497 git_index_conflict_cleanup( index );
498 git_index_write( index );
499 }
500
501 return conflict_data.empty() ? PullResult::Success : PullResult::MergeFailed;
502}
503
504
505PullResult GIT_PULL_HANDLER::handleRebase( const git_annotated_commit** aMergeHeads, size_t aMergeHeadsCount )
506{
507 // Get the current branch reference
508 git_reference* head_ref = nullptr;
509
510 if( git_repository_head( &head_ref, GetRepo() ) )
511 {
512 wxString errorMsg = KIGIT_COMMON::GetLastGitError();
513 wxLogTrace( traceGit, "GIT_PULL_HANDLER::handleRebase() - Failed to get HEAD: %s", errorMsg );
514 return PullResult::Error;
515 }
516
517 KIGIT::GitReferencePtr headRefPtr(head_ref);
518
519 // Initialize rebase operation
520 git_rebase* rebase = nullptr;
521 git_rebase_options rebase_opts = GIT_REBASE_OPTIONS_INIT;
522 rebase_opts.checkout_options.checkout_strategy = GIT_CHECKOUT_SAFE;
523
524 if( git_rebase_init( &rebase, GetRepo(), nullptr, nullptr, aMergeHeads[0], &rebase_opts ) )
525 {
526 wxString errorMsg = KIGIT_COMMON::GetLastGitError();
527 wxLogTrace( traceGit, "GIT_PULL_HANDLER::handleRebase() - Failed to initialize rebase: %s", errorMsg );
528 return PullResult::Error;
529 }
530
531 KIGIT::GitRebasePtr rebasePtr( rebase );
532 git_rebase_operation* operation = nullptr;
533
534 while( git_rebase_next( &operation, rebase ) != GIT_ITEROVER )
535 {
536 // Check for conflicts
537 git_index* index = nullptr;
538 if( git_repository_index( &index, GetRepo() ) )
539 {
540 wxLogTrace( traceGit, "GIT_PULL_HANDLER::handleRebase() - Failed to get index: %s",
542 return PullResult::Error;
543 }
544 KIGIT::GitIndexPtr indexPtr( index );
545
546 if( git_index_has_conflicts( index ) )
547 {
548 // Abort the rebase if there are conflicts because we need to merge manually
549 git_rebase_abort( rebase );
550 AddErrorString( _( "Conflicts detected during rebase" ) );
551 return PullResult::MergeFailed;
552 }
553
554 git_oid commit_id;
555 git_signature* committer = nullptr;
556
557 if( git_signature_default( &committer, GetRepo() ) )
558 {
559 wxLogTrace( traceGit, "GIT_PULL_HANDLER::handleRebase() - Failed to create signature: %s",
561 return PullResult::Error;
562 }
563
564 KIGIT::GitSignaturePtr committerPtr( committer );
565
566 if( git_rebase_commit( &commit_id, rebase, nullptr, committer, nullptr, nullptr ) != GIT_OK )
567 {
568 wxString errorMsg = KIGIT_COMMON::GetLastGitError();
569 wxLogTrace( traceGit, "GIT_PULL_HANDLER::handleRebase() - Failed to commit operation: %s", errorMsg );
570 git_rebase_abort( rebase );
571 return PullResult::Error;
572 }
573 }
574
575 // Finish the rebase
576 if( git_rebase_finish( rebase, nullptr ) )
577 {
578 wxLogTrace( traceGit, "GIT_PULL_HANDLER::handleRebase() - Failed to finish rebase: %s",
580 return PullResult::Error;
581 }
582
583 wxLogTrace( traceGit, "GIT_PULL_HANDLER::handleRebase() - Rebase completed successfully" );
584 git_repository_state_cleanup( GetRepo() );
585 return PullResult::Success;
586}
587
588
589void GIT_PULL_HANDLER::UpdateProgress( int aCurrent, int aTotal, const wxString& aMessage )
590{
591
592}
bool PerformFetch(bool aSkipLock=false)
std::string getFirstLineFromCommitMessage(const std::string &aMessage)
PullResult handleRebase(const git_annotated_commit **aMergeHeads, size_t aMergeHeadsCount)
PullResult handleFastForward()
PullResult handleMerge(const git_annotated_commit **aMergeHeads, size_t aMergeHeadsCount)
const std::vector< std::pair< std::string, std::vector< CommitDetails > > > & GetFetchResults() const
GIT_PULL_HANDLER(KIGIT_COMMON *aCommon)
void UpdateProgress(int aCurrent, int aTotal, const wxString &aMessage) override
std::string getFormattedCommitDate(const git_time &aTime)
std::vector< std::pair< std::string, std::vector< CommitDetails > > > m_fetchResults
PullResult PerformPull()
static wxString GetLastGitError()
void AddErrorString(const wxString aErrorString)
git_repository * GetRepo() const
Get a pointer to the git repository.
unsigned & TestedTypes()
Return the connection types that have been tested for authentication.
KIGIT_COMMON * GetCommon() const
Get the common object.
void ResetNextKey()
Reset the next public key to test.
#define _(s)
PullResult
const wxChar *const traceGit
Flag to enable Git debugging output.
int fetchhead_foreach_cb(const char *, const char *, const git_oid *aOID, unsigned int aIsMerge, void *aPayload)
int progress_cb(const char *str, int len, void *aPayload)
int transfer_progress_cb(const git_transfer_progress *aStats, void *aPayload)
int credentials_cb(git_cred **aOut, const char *aUrl, const char *aUsername, unsigned int aAllowedTypes, void *aPayload)
std::unique_ptr< git_commit, decltype([](git_commit *aCommit) { git_commit_free(aCommit) GitCommitPtr
A unique pointer for git_commit objects with automatic cleanup.
std::unique_ptr< git_annotated_commit, decltype([](git_annotated_commit *aCommit) { git_annotated_commit_free(aCommit) GitAnnotatedCommitPtr
A unique pointer for git_annotated_commit objects with automatic cleanup.
std::unique_ptr< git_tree, decltype([](git_tree *aTree) { git_tree_free(aTree) GitTreePtr
A unique pointer for git_tree objects with automatic cleanup.
std::unique_ptr< git_index, decltype([](git_index *aIndex) { git_index_free(aIndex) GitIndexPtr
A unique pointer for git_index objects with automatic cleanup.
std::unique_ptr< git_signature, decltype([](git_signature *aSignature) { git_signature_free(aSignature) GitSignaturePtr
A unique pointer for git_signature objects with automatic cleanup.
std::unique_ptr< git_rebase, decltype([](git_rebase *aRebase) { git_rebase_free(aRebase) GitRebasePtr
A unique pointer for git_rebase objects with automatic cleanup.
std::unique_ptr< git_config, decltype([](git_config *aConfig) { git_config_free(aConfig) GitConfigPtr
A unique pointer for git_config objects with automatic cleanup.
std::unique_ptr< git_reference, decltype([](git_reference *aRef) { git_reference_free(aRef) GitReferencePtr
A unique pointer for git_reference objects with automatic cleanup.
std::unique_ptr< git_index_conflict_iterator, decltype([](git_index_conflict_iterator *aIterator) { git_index_conflict_iterator_free(aIterator) GitIndexConflictIteratorPtr
A unique pointer for git_index_conflict_iterator objects with automatic cleanup.
std::unique_ptr< git_revwalk, decltype([](git_revwalk *aWalker) { git_revwalk_free(aWalker) GitRevWalkPtr
A unique pointer for git_revwalk objects with automatic cleanup.
std::unique_ptr< git_remote, decltype([](git_remote *aRemote) { git_remote_free(aRemote) GitRemotePtr
A unique pointer for git_remote objects with automatic cleanup.
std::string m_sha
std::string m_date
std::string m_firstLine
std::string m_author
std::string their_status
std::string our_status
std::string filename
git_time_t their_commit_time
git_time_t our_commit_time
wxLogTrace helper definitions.