Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
Represents a commit object.
Synopsis
- newtype Commit = Commit (ManagedPtr Commit)
- class (GObject o, IsDescendantOf Commit o) => IsCommit o
- toCommit :: (MonadIO m, IsCommit o) => o -> m Commit
- noCommit :: Maybe Commit
- commitAmend :: (HasCallStack, MonadIO m, IsCommit a, IsSignature b, IsSignature c, IsTree d) => a -> Maybe Text -> b -> c -> Maybe Text -> Text -> d -> m (Maybe OId)
- commitGetAuthor :: (HasCallStack, MonadIO m, IsCommit a) => a -> m (Maybe Signature)
- commitGetCommitter :: (HasCallStack, MonadIO m, IsCommit a) => a -> m (Maybe Signature)
- commitGetMessage :: (HasCallStack, MonadIO m, IsCommit a) => a -> m (Maybe Text)
- commitGetMessageEncoding :: (HasCallStack, MonadIO m, IsCommit a) => a -> m (Maybe Text)
- commitGetNthAncestor :: (HasCallStack, MonadIO m, IsCommit a) => a -> Word32 -> m (Maybe Commit)
- commitGetParents :: (HasCallStack, MonadIO m, IsCommit a) => a -> m (Maybe CommitParents)
- commitGetSubject :: (HasCallStack, MonadIO m, IsCommit a) => a -> m (Maybe Text)
- commitGetTree :: (HasCallStack, MonadIO m, IsCommit a) => a -> m (Maybe Tree)
- commitGetTreeId :: (HasCallStack, MonadIO m, IsCommit a) => a -> m (Maybe OId)
Exported types
Memory-managed wrapper type.
Instances
GObject Commit Source # | |
Defined in GI.Ggit.Objects.Commit gobjectType :: IO GType # | |
HasParentTypes Commit Source # | |
Defined in GI.Ggit.Objects.Commit | |
type ParentTypes Commit Source # | |
Defined in GI.Ggit.Objects.Commit |
class (GObject o, IsDescendantOf Commit o) => IsCommit o Source #
Instances
(GObject o, IsDescendantOf Commit o) => IsCommit o Source # | |
Defined in GI.Ggit.Objects.Commit |
Methods
amend
:: (HasCallStack, MonadIO m, IsCommit a, IsSignature b, IsSignature c, IsTree d) | |
=> a |
|
-> Maybe Text |
|
-> b |
|
-> c |
|
-> Maybe Text |
|
-> Text |
|
-> d |
|
-> m (Maybe OId) | Returns: the |
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
:: (HasCallStack, MonadIO m, IsCommit a) | |
=> a |
|
-> m (Maybe Signature) | Returns: the author of the commit. |
Gets the author of commit
. The returned value must be free'd with
objectUnref
.
getCommitter
:: (HasCallStack, MonadIO m, IsCommit a) | |
=> a |
|
-> m (Maybe Signature) | Returns: the committer of the commit. |
Gets the committer of commit
. The returned value must be free'd with
objectUnref
.
getMessage
:: (HasCallStack, MonadIO m, IsCommit a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsCommit a) | |
=> a |
|
-> m (Maybe Text) | Returns: the encoding of the commit message or |
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
:: (HasCallStack, MonadIO m, IsCommit a) | |
=> a |
|
-> Word32 |
|
-> m (Maybe Commit) | Returns: the |
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
:: (HasCallStack, MonadIO m, IsCommit a) | |
=> a |
|
-> m (Maybe CommitParents) | Returns: the parents collection of the commit. |
Gets the parents collection for commit
.
getSubject
:: (HasCallStack, MonadIO m, IsCommit a) | |
=> a |
|
-> 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
Get the tree object for commit
.
getTreeId
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.