SlHelpers
Loading...
Searching...
No Matches
SlGit::Commit Class Reference

Commit is a representation of a git commit. More...

#include <Commit.h>

Inheritance diagram for SlGit::Commit:
SlGit::TypedObject< git_commit > SlGit::Object

Public Member Functions

std::optional< Commit > parent (unsigned int nth=0) const noexcept
 Get the nth parent of this Commit.
std::optional< Commit > ancestor (unsigned int nth=0) const noexcept
 Get the nth generation ancestor of this Commit.
std::optional< Treetree () const noexcept
 Get the Tree of this Commit.
const git_oid * treeId () const noexcept
 Get the OID of the tree of this Commit.
std::string treeIdStr () const noexcept
 Get the SHA of the tree of this Commit.
std::string messageEncoding () const noexcept
 Get the commit message encoding of this Commit.
std::string message () const noexcept
 Get the commit message of this Commit.
std::string summary () const noexcept
 Get the summary line of this Commit.
git_time_t time () const noexcept
 Get the time of this Commit.
int timeOffset () const noexcept
 Get the timezone offset of this Commit.
const git_signature * committer () const noexcept
 Get the committer of this Commit.
const git_signature * author () const noexcept
 Get the author of this Commit.
std::string rawHeader () const noexcept
 Get a raw Commit header.
unsigned int parentCount () const noexcept
 Get count of parents.
const git_oid * parentId (unsigned int nth) const noexcept
 Get OID of the nth parent.
std::optional< std::string > catFile (const std::string &file) const noexcept
 Cat a file in this Commit's tree.
GitTy * commit () const noexcept
 Get the stored pointer to libgit2's git_commit.
 operator GitTy * () const noexcept
 Alias for commit() – implicit conversion.
Public Member Functions inherited from SlGit::TypedObject< git_commit >
git_object * object () const noexcept override
 Get a pointer to the generic git_object.
 operator git_commit * () const noexcept
 Alias for typed().
Public Member Functions inherited from SlGit::Object
const git_oid * id () const noexcept
 Get OID (SHA) of this Object.
std::string idStr () const noexcept
 Get OID (SHA) of this Object – as a string.
git_object_t type () const noexcept
 Get Type of this Object.
std::string typeStr () const noexcept
 Get Type of this Object – as a string.
const Reporepo () const
 Get the Repo this Object lives in.
bool operator== (const Object &other) const noexcept
 Compare two Objects (their SHAs).
bool operator!= (const Object &other) const noexcept
 Compare two Objects (their SHAs).

Friends

class Repo
class Tag

Additional Inherited Members

Protected Member Functions inherited from SlGit::TypedObject< git_commit >
git_commit * typed () const noexcept
 Get the stored pointer typed to one of libgit2's types.
Protected Member Functions inherited from SlGit::Object
 Object (const Repo &repo)
 Constuct a new Object.

Detailed Description

Commit is a representation of a git commit.


The documentation for this class was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/slhelpers-20260428.f233ce9-build/slhelpers-20260428.f233ce9/include/git/Commit.h