Class PDJE_GitHandler

Class Documentation

class PDJE_GitHandler

User facing helper that manages a Git repository and history.

Public Functions

bool Save(const std::string &tracingFile, const std::string &timeStamp)

Commit changes with an autogenerated message.

bool Undo()

Undoes the last commit.

Returns:

true if the undo was successful, false otherwise.

bool Redo()

Redoes the last undone commit.

Returns:

true if the redo was successful, false otherwise.

bool Go(const std::string &branchName, git_oid *commitID)

Checks out a specific branch or commit.

Parameters:
  • branchName – The name of the branch to check out.

  • commitID – A pointer to the commit ID to check out (optional).

Returns:

true if the checkout was successful, false otherwise.

std::string GetLogWithJSONGraph()
inline bool UpdateLog()
inline bool UpdateLog(const std::string &branchName)
DiffResult GetDiff(const gitwrap::commit &oldTimeStamp, const gitwrap::commit &newTimeStamp)

Retrieve a diff between two timestamps.

bool DeleteGIT(const fs::path &path)

Delete repository data at the given path.

bool Open(const fs::path &path)

Initialize the handler with an existing repository path.

bool Close()

Close the repository.

PDJE_GitHandler() = delete
PDJE_GitHandler(const std::string &auth_name, const std::string &auth_email)

Construct with author information for commits.

~PDJE_GitHandler()

Public Members

std::string RecentERR
GitWrapper gw