gi-ggit-1.0.1: libgit2-glib bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Ggit.Objects.Commit

Contents

Description

Represents a commit object.

Synopsis

Exported types

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

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 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 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 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 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 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 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 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 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 Tree

Returns: a Tree.

Get the tree object for commit.

getTreeId

commitGetTreeId Source #

Arguments

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

commit: a Commit.

-> m 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.