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 blame hunk.
Synopsis
- newtype BlameHunk = BlameHunk (ManagedPtr BlameHunk)
- noBlameHunk :: Maybe BlameHunk
- blameHunkGetFinalCommitId :: (HasCallStack, MonadIO m) => BlameHunk -> m (Maybe OId)
- blameHunkGetFinalSignature :: (HasCallStack, MonadIO m) => BlameHunk -> m (Maybe Signature)
- blameHunkGetFinalStartLineNumber :: (HasCallStack, MonadIO m) => BlameHunk -> m Word16
- blameHunkGetLinesInHunk :: (HasCallStack, MonadIO m) => BlameHunk -> m Word16
- blameHunkGetOrigCommitId :: (HasCallStack, MonadIO m) => BlameHunk -> m (Maybe OId)
- blameHunkGetOrigPath :: (HasCallStack, MonadIO m) => BlameHunk -> m (Maybe Text)
- blameHunkGetOrigSignature :: (HasCallStack, MonadIO m) => BlameHunk -> m (Maybe Signature)
- blameHunkGetOrigStartLineNumber :: (HasCallStack, MonadIO m) => BlameHunk -> m Word16
- blameHunkIsBoundary :: (HasCallStack, MonadIO m) => BlameHunk -> m Bool
- blameHunkRef :: (HasCallStack, MonadIO m) => BlameHunk -> m (Maybe BlameHunk)
- blameHunkUnref :: (HasCallStack, MonadIO m) => BlameHunk -> m ()
Exported types
Memory-managed wrapper type.
Instances
BoxedObject BlameHunk Source # | |
Methods
getFinalCommitId
blameHunkGetFinalCommitId Source #
Get the id of the commit where this hunk was last changed.
getFinalSignature
blameHunkGetFinalSignature Source #
Get the signature of the final version of the hunk.
getFinalStartLineNumber
blameHunkGetFinalStartLineNumber Source #
:: (HasCallStack, MonadIO m) | |
=> BlameHunk |
|
-> m Word16 | Returns: the final hunk line number. |
Get the line number where the hunk begins in the final version of the file. Line numbers start at 1.
getLinesInHunk
blameHunkGetLinesInHunk Source #
:: (HasCallStack, MonadIO m) | |
=> BlameHunk |
|
-> m Word16 | Returns: the number of lines in the hunk. |
Get the number of lines in the hunk.
getOrigCommitId
blameHunkGetOrigCommitId Source #
Get the id of the commit where the hunk was found. This is usually the same
the final commit id, except when GGIT_BLAME_TRACK_COPIES_ANY_COMMIT
was used.
getOrigPath
:: (HasCallStack, MonadIO m) | |
=> BlameHunk |
|
-> m (Maybe Text) | Returns: the path or |
Get the path of the file where this hunk originated, as of the commit
specified by ggit_blame_hunk_get_orig_commit_id
.
getOrigSignature
blameHunkGetOrigSignature Source #
Get the signature of the commit specified by ggit_blame_hunk_get_orig_commit_id
.
getOrigStartLineNumber
blameHunkGetOrigStartLineNumber Source #
:: (HasCallStack, MonadIO m) | |
=> BlameHunk |
|
-> m Word16 | Returns: the orig hunk line number. |
Get the line number where the hunk begins in the file specified by
ggit_blame_hunk_get_orig_path
at the commit specified by
ggit_blame_hunk_get_orig_commit_id
. Line numbers start at 1.
isBoundary
:: (HasCallStack, MonadIO m) | |
=> BlameHunk |
|
-> m Bool | Returns: whether the hunk is at a boundary commit. |
Get whether the hunk has been tracked to a boundary commit (the root,
or the commit specified in ggit_blame_options_set_oldest_commit
).
ref
Atomically increments the reference count of blameHunk
by one.
This function is MT-safe and may be called from any thread.
unref
:: (HasCallStack, MonadIO m) | |
=> BlameHunk |
|
-> m () |
Atomically decrements the reference count of blameHunk
by one.
If the reference count drops to 0, blameHunk
is freed.