gi-ggit-1.0.12: 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.RevisionWalker

Description

Represents a revision walker.

Synopsis

Exported types

newtype RevisionWalker Source #

Memory-managed wrapper type.

Constructors

RevisionWalker (ManagedPtr RevisionWalker) 

Instances

Instances details
Eq RevisionWalker Source # 
Instance details

Defined in GI.Ggit.Objects.RevisionWalker

GObject RevisionWalker Source # 
Instance details

Defined in GI.Ggit.Objects.RevisionWalker

ManagedPtrNewtype RevisionWalker Source # 
Instance details

Defined in GI.Ggit.Objects.RevisionWalker

TypedObject RevisionWalker Source # 
Instance details

Defined in GI.Ggit.Objects.RevisionWalker

Methods

glibType :: IO GType

HasParentTypes RevisionWalker Source # 
Instance details

Defined in GI.Ggit.Objects.RevisionWalker

IsGValue (Maybe RevisionWalker) Source #

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

Instance details

Defined in GI.Ggit.Objects.RevisionWalker

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe RevisionWalker -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe RevisionWalker)

type ParentTypes RevisionWalker Source # 
Instance details

Defined in GI.Ggit.Objects.RevisionWalker

type ParentTypes RevisionWalker = '[Native, ObjectFactoryBase, Object, Initable]

class (GObject o, IsDescendantOf RevisionWalker o) => IsRevisionWalker o Source #

Type class for types which can be safely cast to RevisionWalker, for instance with toRevisionWalker.

Instances

Instances details
(GObject o, IsDescendantOf RevisionWalker o) => IsRevisionWalker o Source # 
Instance details

Defined in GI.Ggit.Objects.RevisionWalker

toRevisionWalker :: (MonadIO m, IsRevisionWalker o) => o -> m RevisionWalker Source #

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

Methods

getRepository

revisionWalkerGetRepository Source #

Arguments

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

walker: a Repository.

-> m (Maybe Repository)

Returns: the repository on which this walker is operating or Nothing.

Gets the repository on which this walker is operating.

hide

revisionWalkerHide Source #

Arguments

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

walker: a RevisionWalker.

-> OId

oid: a OId.

-> m ()

(Can throw GError)

Marks a commit (and its ancestors) uninteresting for the output.

The given OID must belong to a commit on the walked repository.

The resolved commit and all its parents will be hidden from the output on the revision walk.

hideGlob

revisionWalkerHideGlob Source #

Arguments

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

walker: a RevisionWalker.

-> Text

item: the glob to hide.

-> m ()

(Can throw GError)

Hide all OIDs pointed to by references that match the given glob pattern to the revsision walker. A leading 'refs/' is implied if not present, as well as a trailing '/ \ *' if the glob lacks '?', '\ *' or '['.

hideHead

revisionWalkerHideHead Source #

Arguments

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

walker: a RevisionWalker.

-> m ()

(Can throw GError)

Hide the OID of the current HEAD to the revision walker.

hideRef

revisionWalkerHideRef Source #

Arguments

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

walker: a RevisionWalker.

-> Text

item: the reference to hide.

-> m ()

(Can throw GError)

Hide the OID pointed to by the named reference to the revision walker.

new

revisionWalkerNew Source #

Arguments

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

repository: a Repository.

-> m (Maybe RevisionWalker)

Returns: a new RevisionWalker or Nothing. (Can throw GError)

Creates a new revision walker to iterate through repository.

This revision walker uses a custom memory pool and an internal commit cache, so it is relatively expensive to allocate.

For maximum performance, this revision walker should be reused for different walks.

This revision walker is *not* thread safe: it may only be used to walk a repository on a single thread; however, it is possible to have several revision walkers in several different threads walking the same repository.

next

revisionWalkerNext Source #

Arguments

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

walker: a RevisionWalker.

-> m (Maybe OId)

Returns: the next commit from the revision walk or Nothing. (Can throw GError)

Gets the next commit from the revision walk.

The initial call to this method is *not* blocking when iterating through a repository with a time-sorting mode.

Iterating with Topological or inverted modes makes the initial call blocking to preprocess the commit list, but this block should be mostly unnoticeable on most repositories (topological preprocessing times at 0.3s on the git.git repo).

The revision walker is reset when the walk is over.

push

revisionWalkerPush Source #

Arguments

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

walker: a RevisionWalker.

-> OId

oid: a OId.

-> m ()

(Can throw GError)

Marks a commit to start traversal from.

The given OID must belong to a commit on the walked repository.

The given commit will be used as one of the roots when starting the revision walk. At least one commit must be pushed the repository before a walk can be started.

pushGlob

revisionWalkerPushGlob Source #

Arguments

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

walker: a RevisionWalker.

-> Text

item: the glob to push.

-> m ()

(Can throw GError)

Push all OIDs pointed to by references that match the given glob pattern to the revsision walker. A leading 'refs/' is implied if not present, as well as a trailing '/ \ *' if the glob lacks '?', '\ *' or '['.

pushHead

revisionWalkerPushHead Source #

Arguments

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

walker: a RevisionWalker.

-> m ()

(Can throw GError)

Push the OID of the current HEAD to the revision walker.

pushRange

revisionWalkerPushRange Source #

Arguments

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

walker: a RevisionWalker.

-> Text

range: the range to push.

-> m ()

(Can throw GError)

Push and hide the respective endpoints of the given range. The range should be of the form: &ltcommit&gt..<commit>, where each <commit> is in the form accepted by revparse. The left-hand commit will be hidden and the right-hand commit pushed.

pushRef

revisionWalkerPushRef Source #

Arguments

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

walker: a RevisionWalker.

-> Text

item: the reference to push.

-> m ()

(Can throw GError)

Push the OID pointed to by the named reference to the revision walker.

reset

revisionWalkerReset Source #

Arguments

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

walker: a RevisionWalker.

-> m () 

Resets the revision walker for reuse.

This will clear all the pushed and hidden commits, and leave the walker in a blank state (just like at creation) ready to receive new commit pushes and start a new walk.

The revision walk is automatically reset when a walk is over.

setSortMode

revisionWalkerSetSortMode Source #

Arguments

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

walker: a RevisionWalker.

-> [SortMode]

sortMode: a SortMode value.

-> m () 

Change the sorting mode when iterating through the repository's contents.

Changing the sorting mode resets the walker.

Properties

repository

No description available in the introspection data.

clearRevisionWalkerRepository :: (MonadIO m, IsRevisionWalker o) => o -> m () Source #

Set the value of the “repository” property to Nothing. When overloading is enabled, this is equivalent to

clear #repository

constructRevisionWalkerRepository :: (IsRevisionWalker o, MonadIO m, IsRepository a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “repository” property. This is rarely needed directly, but it is used by new.

getRevisionWalkerRepository :: (MonadIO m, IsRevisionWalker o) => o -> m (Maybe Repository) Source #

Get the value of the “repository” property. When overloading is enabled, this is equivalent to

get revisionWalker #repository

setRevisionWalkerRepository :: (MonadIO m, IsRevisionWalker o, IsRepository a) => o -> a -> m () Source #

Set the value of the “repository” property. When overloading is enabled, this is equivalent to

set revisionWalker [ #repository := value ]