gi-ggit-1.0.11: libgit2-glib bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Ggit.Objects.Commit

Description

Represents a commit object.

Synopsis

Exported types

newtype Commit Source #

Memory-managed wrapper type.

Constructors

Commit (ManagedPtr Commit) 

Instances

Instances details
Eq Commit Source # 
Instance details

Defined in GI.Ggit.Objects.Commit

Methods

(==) :: Commit -> Commit -> Bool #

(/=) :: Commit -> Commit -> Bool #

GObject Commit Source # 
Instance details

Defined in GI.Ggit.Objects.Commit

ManagedPtrNewtype Commit Source # 
Instance details

Defined in GI.Ggit.Objects.Commit

TypedObject Commit Source # 
Instance details

Defined in GI.Ggit.Objects.Commit

Methods

glibType :: IO GType #

HasParentTypes Commit Source # 
Instance details

Defined in GI.Ggit.Objects.Commit

IsGValue (Maybe Commit) Source #

Convert Commit to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Ggit.Objects.Commit

type ParentTypes Commit Source # 
Instance details

Defined in GI.Ggit.Objects.Commit

class (GObject o, IsDescendantOf Commit o) => IsCommit o Source #

Type class for types which can be safely cast to Commit, for instance with toCommit.

Instances

Instances details
(GObject o, IsDescendantOf Commit o) => IsCommit o Source # 
Instance details

Defined in GI.Ggit.Objects.Commit

toCommit :: (MonadIO m, IsCommit o) => o -> m Commit Source #

Cast to Commit, for types for which this is known to be safe. For general casts, use castTo.

Methods

amend

commitAmend Source #

Arguments

:: (HasCallStack, MonadIO m, IsCommit a, IsSignature b, IsSignature c, IsTree d) 
=> a

commit: a Commit.

-> Maybe Text

updateRef: name of the reference to update.

-> b

author: author signature.

-> c

committer: committer signature (and time of commit).

-> Maybe Text

messageEncoding: message encoding.

-> Text

message: commit message.

-> d

tree: the tree of objects to commit.

-> m (Maybe OId)

Returns: the OId of the created commit object, or Nothing in case of an error. (Can throw GError)

Amend an existing commit. If updateRef is not Nothing, the given reference will be updated to point to the newly created commit. Use "HEAD" to update the HEAD of the current branch and make it point to this commit.

If messageEncoding is set to Nothing, "UTF-8" encoding is assumed for the provided message. Note that message will not be cleaned up automatically. You can use ggit_message_prettify to do this yourself if needed.

getAuthor

commitGetAuthor Source #

Arguments

:: (HasCallStack, MonadIO m, IsCommit a) 
=> a

commit: a Commit.

-> m (Maybe Signature)

Returns: the author of the commit.

Gets the author of commit. The returned value must be free'd with objectUnref.

getCommitter

commitGetCommitter Source #

Arguments

:: (HasCallStack, MonadIO m, IsCommit a) 
=> a

commit: a Commit.

-> m (Maybe Signature)

Returns: the committer of the commit.

Gets the committer of commit. The returned value must be free'd with objectUnref.

getMessage

commitGetMessage Source #

Arguments

:: (HasCallStack, MonadIO m, IsCommit a) 
=> a

commit: a Commit.

-> m (Maybe Text)

Returns: the message of the commit.

Gets the full message of commit. The resulting message is always encoded in UTF-8.

getMessageEncoding

commitGetMessageEncoding Source #

Arguments

:: (HasCallStack, MonadIO m, IsCommit a) 
=> a

commit: a Commit.

-> m (Maybe Text)

Returns: the encoding of the commit message or Nothing.

Get the encoding for the message of a commit, as a string representing a standard encoding name.

The encoding may be Nothing if the 'encoding' header in the commit is missing; in that case UTF-8 is assumed.

getNthAncestor

commitGetNthAncestor Source #

Arguments

:: (HasCallStack, MonadIO m, IsCommit a) 
=> a

commit: a Commit.

-> Word32

n: the requested ancestor.

-> m (Maybe Commit)

Returns: the n ancestor commit. (Can throw GError)

Gets the commit object that is the n-th generation ancestor of the named commit object, following only the first parents. Passing 0 to the n parameter returns another instance of commit.

getParents

commitGetParents Source #

Arguments

:: (HasCallStack, MonadIO m, IsCommit a) 
=> a

commit: a Commit.

-> m (Maybe CommitParents)

Returns: the parents collection of the commit.

Gets the parents collection for commit.

getSubject

commitGetSubject Source #

Arguments

:: (HasCallStack, MonadIO m, IsCommit a) 
=> a

commit: a Commit.

-> m (Maybe Text)

Returns: the subject of the commit.

Gets the subject of commit. The subject of a commit is the first line of the commit message (as per convention). The resulting subject is always encoded in UTF-8.

getTree

commitGetTree Source #

Arguments

:: (HasCallStack, MonadIO m, IsCommit a) 
=> a

commit: a Commit.

-> m (Maybe Tree)

Returns: a Tree.

Get the tree object for commit.

getTreeId

commitGetTreeId Source #

Arguments

:: (HasCallStack, MonadIO m, IsCommit a) 
=> a

commit: a Commit.

-> m (Maybe OId)

Returns: a OId.

Get the OId of the tree of commit. Note that this is more efficient than getting the tree object with commitGetTree because no additional files need to be read from disk.