gi-ggit-1.0.9: libgit2-glib bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Ggit.Objects.Repository

Description

Represents an existing git repository including all of it's object contents.

Synopsis

Exported types

newtype Repository Source #

Memory-managed wrapper type.

Constructors

Repository (ManagedPtr Repository) 

Instances

Instances details
Eq Repository Source # 
Instance details

Defined in GI.Ggit.Objects.Repository

Methods

(==) :: Repository -> Repository -> Bool

(/=) :: Repository -> Repository -> Bool

GObject Repository Source # 
Instance details

Defined in GI.Ggit.Objects.Repository

ManagedPtrNewtype Repository Source # 
Instance details

Defined in GI.Ggit.Objects.Repository

Methods

toManagedPtr :: Repository -> ManagedPtr Repository

TypedObject Repository Source # 
Instance details

Defined in GI.Ggit.Objects.Repository

Methods

glibType :: IO GType

IsGValue Repository Source #

Convert Repository to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Ggit.Objects.Repository

Methods

toGValue :: Repository -> IO GValue

fromGValue :: GValue -> IO Repository

HasParentTypes Repository Source # 
Instance details

Defined in GI.Ggit.Objects.Repository

type ParentTypes Repository Source # 
Instance details

Defined in GI.Ggit.Objects.Repository

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

class (GObject o, IsDescendantOf Repository o) => IsRepository o Source #

Type class for types which can be safely cast to Repository, for instance with toRepository.

Instances

Instances details
(GObject o, IsDescendantOf Repository o) => IsRepository o Source # 
Instance details

Defined in GI.Ggit.Objects.Repository

toRepository :: (MonadIO m, IsRepository o) => o -> m Repository Source #

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

Methods

Overloaded methods

addRemoteFetch

repositoryAddRemoteFetch Source #

Arguments

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

repository: a Repository.

-> b

remote: a Remote.

-> Text

refspec: the fetch refspec.

-> m ()

(Can throw GError)

Adds a fetch refspec to the remote's configuration. Adds refspec to the fetch list in the configuration. No loaded remote instances will be affected.

addRemotePush

repositoryAddRemotePush Source #

Arguments

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

repository: a Repository.

-> b

remote: a Remote.

-> Text

refspec: the push refspec.

-> m ()

(Can throw GError)

Adds a push refspec to remote's configuration. Adds the given refspec to the push list in the configuration. No loaded remote instances will be affected.

blameFile

repositoryBlameFile Source #

Arguments

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

repository: a Repository.

-> b

file: the file to blame.

-> Maybe BlameOptions

blameOptions: blame options.

-> m (Maybe Blame)

Returns: a Blame. (Can throw GError)

Get a blame for a single file.

checkoutHead

repositoryCheckoutHead Source #

Arguments

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

repository: a Repository.

-> Maybe b

options: a CheckoutOptions or Nothing.

-> m ()

(Can throw GError)

Update files in the working tree to reflect the contents of current HEAD. If options is Nothing, then the default checkout options will be used.

If the checkout was not successfull, then error will be set.

checkoutIndex

repositoryCheckoutIndex Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a, IsIndex b, IsCheckoutOptions c) 
=> a

repository: a Repository.

-> Maybe b

index: a Index or Nothing.

-> Maybe c

options: a CheckoutOptions or Nothing.

-> m ()

(Can throw GError)

Update files in the working tree to reflect the contents of the index. If index is Nothing, then the current index of the repository will be used. If options is Nothing, then the default checkout options will be used.

If the checkout was not successfull, then error will be set.

checkoutTree

repositoryCheckoutTree Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a, IsObject b, IsCheckoutOptions c) 
=> a

repository: a Repository.

-> Maybe b

tree: a Object or Nothing.

-> Maybe c

options: a CheckoutOptions or Nothing.

-> m ()

(Can throw GError)

Update files in the working tree to reflect the contents of the specified commit, tag or tree object. If tree is Nothing, then the current HEAD of the repository will be used. If options is Nothing, then the default checkout options will be used.

If the checkout was not successfull, then error will be set.

cherryPick

repositoryCherryPick Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a, IsCommit b, IsCherryPickOptions c) 
=> a

repository: a Repository.

-> b

commit: a Commit.

-> c

options: a CherryPickOptions.

-> m ()

(Can throw GError)

Cherry pick the specified commit, making changes in the index and the working directory.

cherryPickCommit

repositoryCherryPickCommit Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a, IsCommit b, IsCommit c) 
=> a

repository: a Repository.

-> b

commit: a Commit to cherry-pick.

-> c

ourCommit: a Commit to cherry-pick on.

-> Word32

mainline: the parent of the commit, in case of a merge commit.

-> Maybe MergeOptions

mergeOptions: a MergeOptions.

-> m (Maybe Index)

Returns: a Index. (Can throw GError)

Cherry-picks the given commit against the provided ourCommit, producing and index that reflects the result of the cherry-pick.

clone

repositoryClone Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a, IsCloneOptions b) 
=> Text

url: url to fetch the repository from.

-> a

location: the location of the repository.

-> Maybe b

options: a CloneOptions.

-> m (Maybe Repository)

Returns: a newly created Repository. (Can throw GError)

Clones a new git repository in the given folder.

createBlob

repositoryCreateBlob Source #

Arguments

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

repository: a Repository.

-> m (Maybe BlobOutputStream)

Returns: a BlobOutputStream.

Create a new blob and return a OutputStream to write contents to the blob. This is an efficient way to create new blobs without copying data. The blob id can be obtained from the blob output stream using ggit_blob_output_stream_get_id, after you close the stream.

createBlobFromBuffer

repositoryCreateBlobFromBuffer Source #

Arguments

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

repository: a Repository.

-> ByteString

buffer: the data.

-> m (Maybe OId)

Returns: the new GgitOid of the written blob, or Nothing if writing the blob failed. (Can throw GError)

Write an in-memory buffer to the object database as a blob.

createBlobFromFile

repositoryCreateBlobFromFile Source #

Arguments

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

repository: a Repository.

-> b

file: a File.

-> m OId

(Can throw GError)

Write a file to the object database as a blob.

Returns (transfer full) (nullable): the new GgitOid of the written blob, or Nothing if writing the blob failed.

createBlobFromPath

repositoryCreateBlobFromPath Source #

Arguments

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

repository: a Repository.

-> Text

path: the file path.

-> m (Maybe OId)

Returns: the new GgitOid of the written blob, or Nothing if writing the blob failed. (Can throw GError)

Write a path relative to the repository working directory to the object database as a blob.

createBranch

repositoryCreateBranch Source #

Arguments

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

repository: a Repository.

-> Text

branchName: the name of the branch.

-> b

target: a Object.

-> [CreateFlags]

flags: a CreateFlags.

-> m (Maybe Branch)

Returns: the reference to which the branch points, or Nothing in case of an error. (Can throw GError)

Creates a new branch pointing at a target commit.

createCommit

repositoryCreateCommit Source #

Arguments

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

repository: a Repository.

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

-> [Commit]

parents: parent commits.

-> m (Maybe OId)

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

Create a new 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.

createCommitFromIds

repositoryCreateCommitFromIds Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a, IsSignature b, IsSignature c) 
=> a

repository: a Repository.

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

-> OId

tree: the tree of objects to commit.

-> [OId]

parents: parent commits.

-> m (Maybe OId)

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

Create a new 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.

createIndexEntryForFile

repositoryCreateIndexEntryForFile Source #

Arguments

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

repository: a Repository.

-> Maybe b

file: a File.

-> Maybe OId

id: a OId.

-> m (Maybe IndexEntry)

Returns: a IndexEntry or Nothing when an error occurred. (Can throw GError)

Create a new index entry. When file is not Nothing, the path of the returned entry (ggit_index_entry_get_path) is set to the path of file relative to the working directory of repository. The file must reside in the working directory of repository. The file related fields of the returned entry are also queried from this file (if the file exists).

If id is not Nothing, then the id of the returned entry is set to id (see ggit_index_entry_get_id) which could point to a blob (for a file) or a tree (for a directory).

createIndexEntryForPath

repositoryCreateIndexEntryForPath Source #

Arguments

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

repository: a Repository.

-> Maybe Text

path: a path.

-> Maybe OId

id: a OId.

-> m (Maybe IndexEntry)

Returns: a IndexEntry or Nothing when an error occurred. (Can throw GError)

Create a new index entry. When path is not Nothing, the path of the returned entry (ggit_index_entry_get_path) is set to path. The specified path can be either absolute or relative. In the case of an absolute path, the path must reside within the working directory of repository. The file related fields of the returned entry are also queried from this path (if the file exists).

If id is not Nothing, then the id of the returned entry is set to id (see ggit_index_entry_get_id) which could point to a blob (for a file) or a tree (for a directory).

createNote

repositoryCreateNote Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a, IsSignature b, IsSignature c) 
=> a

repository: a Repository.

-> Maybe Text

notesRef: canonical name of the reference to use, or Nothing to use the default ref.

-> b

author: author signature.

-> c

committer: committer signature.

-> OId

id: OID of the git object to decorate.

-> Text

note: content of the note to add for object oid.

-> Bool

force: whether to overwrite existing note.

-> m (Maybe OId)

Returns: the OID for the note or Nothing in case of error. (Can throw GError)

Adds a note for an object.

createReference

repositoryCreateReference Source #

Arguments

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

repository: a Repository.

-> Text

name: the name for the new Ref.

-> OId

oid: the OId pointed to by the reference.

-> Text

logMessage: The one line long message to be appended to the reflog.

-> m (Maybe Ref)

Returns: the newly created reference. (Can throw GError)

Creates a new object id reference.

The reference will be created in the repository and written to the disk. The returned value must be freed with objectUnref.

createRemote

repositoryCreateRemote Source #

Arguments

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

repository: a Repository.

-> Text

name: the name of the new remote.

-> Text

url: the url of the remote.

-> m (Maybe Remote)

Returns: a new Remote or Nothing if there is an error. (Can throw GError)

Adds a remote with the default fetch refspec to the repository's configuration.

createSymbolicReference

repositoryCreateSymbolicReference Source #

Arguments

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

repository: a Repository.

-> Text

name: the name for the new Ref.

-> Text

target: the full name to the reference.

-> Text

logMessage: The one line long message to be appended to the reflog.

-> m (Maybe Ref)

Returns: the newly created reference. (Can throw GError)

Creates a new symbolic reference.

The reference will be created in the repository and written to the disk. The returned value must be freed with objectUnref.

createTag

repositoryCreateTag Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a, IsObject b, IsSignature c) 
=> a

repository: a Repository.

-> Text

tagName: the tag name.

-> b

target: a Object.

-> c

tagger: a Signature.

-> Text

message: the tag message.

-> [CreateFlags]

flags: a CreateFlags.

-> m (Maybe OId)

Returns: the id to which the tag points, or Nothing in case of an error. (Can throw GError)

Create a new tag object.

createTagAnnotation

repositoryCreateTagAnnotation Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a, IsObject b, IsSignature c) 
=> a

repository: a Repository.

-> Text

tagName: the name of the tag.

-> b

target: a Object.

-> c

signature: a Object.

-> Text

message: the tag message.

-> m (Maybe OId)

Returns: the id to which the tag points, or Nothing in case of an error. (Can throw GError)

Creates a new annotated tag.

createTagFromBuffer

repositoryCreateTagFromBuffer Source #

Arguments

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

repository: a Repository.

-> Text

tag: the tag buffer.

-> [CreateFlags]

flags: a CreateFlags.

-> m (Maybe OId)

Returns: the id to which the tag points, or Nothing in case of an error. (Can throw GError)

Create a new tag from a buffer describing the tag object. The buffer must be correctly formatted.

createTagLightweight

repositoryCreateTagLightweight Source #

Arguments

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

repository: a Repository.

-> Text

tagName: the name of the tag.

-> b

target: a Object.

-> [CreateFlags]

flags: a CreateFlags.

-> m (Maybe OId)

Returns: the id to which the tag points, or Nothing in case of an error. (Can throw GError)

Creates a new lightweight tag.

createTreeBuilder

repositoryCreateTreeBuilder Source #

Arguments

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

repository: a Repository.

-> m (Maybe TreeBuilder)

Returns: a new TreeBuilder, or Nothing if there was an error. (Can throw GError)

Create a new tree builder.

createTreeBuilderFromTree

repositoryCreateTreeBuilderFromTree Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a, IsTree b) 
=> a 
-> b

tree: a Tree.

-> m (Maybe TreeBuilder)

Returns: a new TreeBuilder object, or Nothing if there was an error. (Can throw GError)

Create a tree builder for initialized with tree. To create an empty tree builder, use ggit_repository_create_tree_builder instead.

deleteTag

repositoryDeleteTag Source #

Arguments

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

repository: a Repository.

-> Text

name: the name of the tag.

-> m ()

(Can throw GError)

Delete an existing tag reference by name.

discover

repositoryDiscover Source #

Arguments

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

location: the base location where the lookup starts.

-> m (Maybe File)

Returns: the repository location. (Can throw GError)

Looks for a git repository.

The lookup starts from path and walks up the parent directories and stops when a repository is found.

discoverFull

repositoryDiscoverFull Source #

Arguments

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

location: the base location where the lookup starts.

-> Bool

acrossFs: indictaes whether lookup will work across filesystem devices.

-> Maybe [Text]

ceilingDirs: a list of absolute paths at which lookup will stop when reached, or Nothing.

-> m (Maybe File)

Returns: the repository location. (Can throw GError)

Looks for a git repository.

The lookup starts from path and walks up the parent directories and stops when a repository is found.

dropStash

repositoryDropStash Source #

Arguments

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

repository: a Repository.

-> Word64

index: the position within the stash list. 0 points to the. most recent stashed state.

-> m ()

(Can throw GError)

Removes a single stashed state from the stash list.

enumerateBranches

repositoryEnumerateBranches Source #

Arguments

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

repository: a Repository.

-> BranchType

listType: a BranchType.

-> m (Maybe BranchEnumerator)

Returns: a branch enumerator. (Can throw GError)

Get a branch enumerator to enumerate over all branches of the specified listType in repository.

fileStatus

repositoryFileStatus Source #

Arguments

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

repository: a Repository.

-> b

location: the file to retrieve status for, rooted at the repository working dir.

-> m [StatusFlags]

Returns: the status for a single file. (Can throw GError)

Gets the file status for a single file.

fileStatusForeach

repositoryFileStatusForeach Source #

Arguments

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

repository: a Repository.

-> Maybe StatusOptions

options: status options, or Nothing.

-> StatusCallback

callback: a StatusCallback.

-> m ()

(Can throw GError)

Gathers file statuses and run a callback for each one.

To the callback is passed the path of the file, the status and the data pointer passed to this function. If the callback returns something other than 0, the iteration will stop and error will be set.

Set options to Nothing to get the default status options.

getAheadBehind

repositoryGetAheadBehind Source #

Arguments

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

repository: a Repository.

-> OId

local: the commit for local.

-> OId

upstream: the commit for upstream.

-> m (Word64, Word64)

(Can throw GError)

Count the number of unique commits between two commit objects.

There is no need for branches containing the commits to have any upstream relationship, but it helps to think of one as a branch and the other as its upstream, the ahead and behind values will be what git would report for the branches.

getAttribute

repositoryGetAttribute Source #

Arguments

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

repository: a Repository.

-> Text

path: the relative path to the file.

-> Text

name: the name of the attribute.

-> [AttributeCheckFlags]

flags: a AttributeCheckFlags.

-> m (Maybe Text)

Returns: the attribute value, or Nothing. (Can throw GError)

Get the attribute value of the specified attribute for the given file.

getConfig

repositoryGetConfig Source #

Arguments

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

repository: a Repository.

-> m (Maybe Config)

Returns: a Config. (Can throw GError)

Get the config for a specific repository.

getDefaultNotesRef

repositoryGetDefaultNotesRef Source #

Arguments

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

repository: a Repository.

-> m (Maybe Text)

Returns: the default notes reference for repository. (Can throw GError)

Gets the default notes reference for repository. It defaults to "refs/notes/commits".

getDescendantOf

repositoryGetDescendantOf Source #

Arguments

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

repository: a Repository.

-> OId

commit: the commit.

-> OId

ancestor: the ancestor.

-> m ()

(Can throw GError)

Check whether com mit is a descendant of ancestor. Note that if this function returns False, an error might have occurred. If so, error will be set appropriately.

getHead

repositoryGetHead Source #

Arguments

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

repository: a Repository.

-> m (Maybe Ref)

Returns: a Ref (Can throw GError)

Get and resolves the current HEAD reference of the repository. Note that the returned ref is already resolved (if HEAD is symbolic). If you want to retrieve the symbolic ref called HEAD, then use ggit_repository_lookup_reference instead.

getIndex

repositoryGetIndex Source #

Arguments

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

repository: a Repository.

-> m (Maybe Index)

Returns: a Index. (Can throw GError)

Get the index for a specific repository.

getLocation

repositoryGetLocation Source #

Arguments

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

repository: a Repository.

-> m (Maybe File)

Returns: the location of the gitdir of the repository.

Get the gitdir location of the repository.

getSubmoduleStatus

repositoryGetSubmoduleStatus Source #

Arguments

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

repository: a Repository.

-> Text

name: the name of the submodule.

-> SubmoduleIgnore

ignore: the ignore rules to follow.

-> m [SubmoduleStatus]

Returns: the SubmoduleStatus for submodule. (Can throw GError)

Gets the status for a submodule. This looks at a submodule and tries to determine the status. It will return a combination of the GGIT_SUBMODULE_STATUS values. How deeply it examines the working directory to do this will depend on ignore.

getWorkdir

repositoryGetWorkdir Source #

Arguments

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

repository: a Repository.

-> m (Maybe File)

Returns: the location of the working directory of the repository.

Gets the working directory of the repository.

initRepository

repositoryInitRepository Source #

Arguments

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

location: the location of the repository.

-> Bool

isBare: if True, a git repository without a working directory is created at the pointed path. If False, provided path will be considered as the working directory into which the .git directory will be created.

-> m (Maybe Repository)

Returns: a newly created Repository. (Can throw GError)

Creates a new git repository in the given folder.

isBare

repositoryIsBare Source #

Arguments

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

repository: a Repository.

-> m Bool

Returns: True if the repository is empty.

Checks if repository is bare.

isEmpty

repositoryIsEmpty Source #

Arguments

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

repository: a Repository.

-> m ()

(Can throw GError)

Checks if repository is empty.

An empty repository has just been initialized and contains no commits.

isHeadDetached

repositoryIsHeadDetached Source #

Arguments

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

repository: a Repository.

-> m ()

(Can throw GError)

Checks if repository's HEAD is detached.

A repository's HEAD is detached when it points directly to a commit instead of a branch.

isHeadUnborn

repositoryIsHeadUnborn Source #

Arguments

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

repository: a Repository.

-> m ()

(Can throw GError)

Checks if repository's HEAD is an orphan.

An orphan branch is one named from HEAD but doesn't exist in the refs namespace, because it doesn't have any commit to point to.

listRemotes

repositoryListRemotes Source #

Arguments

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

repository: a Repository.

-> m (Maybe [Text])

Returns: a list with the remotes. (Can throw GError)

Fill a list with all the remotes in repository.

listTags

repositoryListTags Source #

Arguments

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

repository: a Repository.

-> m (Maybe [Text])

Returns: a list with the tags in repository. (Can throw GError)

Fill a list with all the tags in the repository.

listTagsMatch

repositoryListTagsMatch Source #

Arguments

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

repository: a Repository.

-> Maybe Text

pattern: a pattern to match.

-> m (Maybe [Text])

Returns: a list with matching tags in repository. (Can throw GError)

Fill a list with all the tags in the repository matching the provided pattern. The pattern can use standard fnmatch syntax.

lookup

repositoryLookup Source #

Arguments

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

repository: a Repository.

-> OId

oid: a OId.

-> GType

gtype: a GType.

-> m (Maybe Object)

Returns: the found Object, or Nothing on error. (Can throw GError)

Lookups a reference to one of the objects in the repository.

The generated reference must be freed with objectUnref.

The gtype must match the type of the object in the odb; the method will fail otherwise. The special value G_TYPE_NONE may be passed to let the method guess the object's type.

lookupBlob

repositoryLookupBlob Source #

Arguments

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

repository: a Repository.

-> OId

oid: a OId.

-> m (Maybe Blob)

Returns: a GgitBlog pointer. (Can throw GError)

Lookups a branch by its name in a repository.

lookupBranch

repositoryLookupBranch Source #

Arguments

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

repository: a Repository.

-> Text

branchName: the name of the branch.

-> BranchType

branchType: a BranchType.

-> m (Maybe Branch)

Returns: a branch by its name in a repository. (Can throw GError)

Lookups a branch by its name in a repository.

lookupCommit

repositoryLookupCommit Source #

Arguments

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

repository: a Repository.

-> OId

oid: a OId.

-> m (Maybe Commit)

Returns: a Commit pointer. (Can throw GError)

Lookups a branch by its name in a repository.

lookupReference

repositoryLookupReference Source #

Arguments

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

repository: a Repository.

-> Text

name: the long name for the reference (e.g. HEAD, ref/heads/master, refs/tags/v0.1.0, ...).

-> m (Maybe Ref)

Returns: the searched reference. (Can throw GError)

Lookups a reference by its name in repository. The returned Ref must be freed with objectUnref.

lookupReferenceDwim

repositoryLookupReferenceDwim Source #

Arguments

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

repository: a Repository.

-> Text

shortName: the short name for the reference (e.g. master, v0.1.0, ...).

-> m (Maybe Ref)

Returns: the searched reference. (Can throw GError)

Lookups a reference by its short name in repository applying the git precendence rules to the given shorthand to determine which reference the user is referring to. The returned Ref must be freed with objectUnref.

lookupRemote

repositoryLookupRemote Source #

Arguments

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

repository: a Repository.

-> Text

name: the remote's name.

-> m (Maybe Remote)

Returns: a new Remote or Nothing if there is an error. (Can throw GError)

Gets the remote called name.

lookupSubmodule

repositoryLookupSubmodule Source #

Arguments

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

repository: a Repository.

-> Text

name: the name of the submodule.

-> m (Maybe Submodule)

Returns: a newly-allocated Submodule. (Can throw GError)

Lookups a submodule information by name or path. If the submodule does not exist, Nothing is returned and a GGIT_ERROR_NOTFOUND error set.

lookupTag

repositoryLookupTag Source #

Arguments

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

repository: a Repository.

-> OId

oid: a OId.

-> m (Maybe Tag)

Returns: a Tag pointer. (Can throw GError)

Lookups a branch by its name in a repository.

lookupTree

repositoryLookupTree Source #

Arguments

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

repository: a Repository.

-> OId

oid: a OId.

-> m (Maybe Tree)

Returns: a Tree pointer. (Can throw GError)

Lookups a branch by its name in a repository.

merge

repositoryMerge Source #

Arguments

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

repository: a Repository.

-> [AnnotatedCommit]

theirHeads: the heads to merge into

-> MergeOptions

mergeOpts: merge options

-> b

checkoutOpts: checkout options

-> m ()

(Can throw GError)

Merges the given commit(s) into HEAD, writing the results into the working directory. Any changes are staged for commit and any conflicts are written to the index.

Callers should inspect the repository's index after this completes, resolve any conflicts and prepare a commit.

mergeBase

repositoryMergeBase Source #

Arguments

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

repository: a Repository.

-> OId

oidOne: the oid of one of the commits.

-> OId

oidTwo: the oid of the second of the commits

-> m (Maybe OId)

Returns: a new OId or Nothing if an error occurred. (Can throw GError)

Find the merge base between two commits

mergeCommits

repositoryMergeCommits Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a, IsCommit b, IsCommit c) 
=> a

repository: a Repository.

-> b

ourCommit: the commit that reflects the destination tree.

-> c

theirCommit: the commit that reflects the source tree.

-> MergeOptions

mergeOptions: the merge options.

-> m (Maybe Index)

Returns: a new Index or Nothing if an error occurred. (Can throw GError)

Merge two commits creating a Index reflecting the result of the merge.

mergeTrees

repositoryMergeTrees Source #

Arguments

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

repository: a Repository.

-> b

ancestorTree: the common ancestor between the trees, or Nothing.

-> c

ourTree: the tree that reflects the destination tree.

-> d

theirTree: the tree that reflects the source tree.

-> MergeOptions

mergeOptions: the merge options.

-> m (Maybe Index)

Returns: a new Index or Nothing if an error occurred. (Can throw GError)

Merge two trees creating a Index reflecting the result of the merge.

noteForeach

repositoryNoteForeach Source #

Arguments

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

repository: a Repository.

-> Maybe Text

notesRef: canonical name of the reference to use, or Nothing to use the default ref.

-> NoteCallback

callback: a NoteCallback.

-> m ()

(Can throw GError)

Loop over all the notes within a specified namespace and issue a callback for each one. If callback returns a non-zero value, this will stop looping.

open

repositoryOpen Source #

Arguments

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

location: the location of the repository.

-> m (Maybe Repository)

Returns: a newly created Repository. (Can throw GError)

Open a git repository.

The path must point to an existing git repository folder, e.g.

/path/to/my_repo/.git/ (normal repository) objects/ index HEAD

/path/to/bare_repo/ (bare repository) objects/ index HEAD

The method will automatically detect if path is a normal or bare repository or fail if it is neither.

pathIsIgnored

repositoryPathIsIgnored Source #

Arguments

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

repository: A Repository.

-> Text

path: A path within the repository.

-> m ()

(Can throw GError)

Tests if the ignore rules apply to the path provided.

This acts similar to filtering performed when calling "git add ." on the command line.

readNote

repositoryReadNote Source #

Arguments

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

repository: a Repository.

-> Maybe Text

notesRef: canonical name of the reference to use, or Nothing to use the default ref.

-> OId

id: OID of the git object to decorate.

-> m (Maybe Note)

Returns: the read note or Nothing in case of an error. (Can throw GError)

Reads the note for an object.

rebaseInit

repositoryRebaseInit Source #

Arguments

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

repository: a Repository.

-> Maybe AnnotatedCommit

branch: the terminal commit to rebase, or Nothing to rebase the current branch.

-> Maybe AnnotatedCommit

upstream: the commit to begin rebasing from, or Nothing to rebase all reachable commits.

-> Maybe AnnotatedCommit

onto: the branch to rebase onto, or Nothing to rebase onto the given upstream.

-> RebaseOptions

options: a RebaseOptions to specify how rebase is performed, or Nothing.

-> m (Maybe Rebase)

Returns: a newly allocated Rebase. (Can throw GError)

Initializes a rebase operation to rebase the changes in branch relative to upstream onto another branch. To begin the rebase process, call git_rebase_next(). When you have finished with this object, call objectUnref.

rebaseOpen

repositoryRebaseOpen Source #

Arguments

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

repository: a Repository.

-> RebaseOptions

options: a RebaseOptions to specify how rebase is performed, or Nothing.

-> m (Maybe Rebase)

Returns: a newly allocated Rebase. (Can throw GError)

Opens an existing rebase that was previously started by either an invocation of ggit_rebase_init() or by another client.

referencesForeach

repositoryReferencesForeach Source #

Arguments

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

repository: a Repository.

-> ReferencesCallback

callback: a ReferencesCallback.

-> m ()

(Can throw GError)

Gathers references and run a callback for each one.

To the callback is passed the reference and the data pointer passed to this function. If the callback returns something other than 0, the iteration will stop and error will be set.

referencesForeachName

repositoryReferencesForeachName Source #

Arguments

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

repository: a Repository.

-> ReferencesNameCallback

callback: a ReferencesNameCallback.

-> m ()

(Can throw GError)

Gathers reference names and run a callback for each one.

To the callback is passed the name of the reference and the data pointer passed to this function. If the callback returns something other than 0, the iteration will stop and error will be set.

removeNote

repositoryRemoveNote Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a, IsSignature b, IsSignature c) 
=> a

repository: a Repository.

-> Maybe Text

notesRef: canonical name of the reference to use, or Nothing to use the default ref.

-> b

author: author signature.

-> c

committer: committer signature.

-> OId

id: OID of the git object to decorate.

-> m ()

(Can throw GError)

Removes the note for an object.

removeRemote

repositoryRemoveRemote Source #

Arguments

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

repository: a Repository.

-> Text

name: the remote's name.

-> m ()

(Can throw GError)

Removes remote from the repository.

renameRemote

repositoryRenameRemote Source #

Arguments

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

repository: a Repository.

-> Text

name: the remote name to be renamed.

-> Text

newName: new name of the remote.

-> m (Maybe [Text])

Returns: non-default refspecs that cannot be renamed. (Can throw GError)

Rename the remote of repository from name to newName.

reset

repositoryReset Source #

Arguments

:: (HasCallStack, MonadIO m, IsRepository a, IsObject b, IsCheckoutOptions c) 
=> a

repository: a Repository.

-> b

target: the target Object which is a commit or a tag.

-> ResetType

resetType: the ResetType to perform.

-> c

checkoutOptions: the CheckoutOptions to be used for a HARD reset.

-> m ()

(Can throw GError)

Performs a reset of type resetType on repository to target, or error will be set.

resetDefault

repositoryResetDefault Source #

Arguments

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

repository: a Repository.

-> Maybe b

target: the target Object which is a commit or a tag.

-> [Text]

pathspecs: a list of file paths to reset.

-> m ()

(Can throw GError)

Update some entries in the index from the target commit tree. The scope of the updated entries is determined by the paths specified in pathspecs. Passing Nothing in target will result in removing entries in the index matching the provided pathspecs.

revert

repositoryRevert Source #

Arguments

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

repository: a Repository.

-> b

commit: a Commit.

-> RevertOptions

options: a RevertOptions.

-> m ()

(Can throw GError)

Revert the given commit on top of the current working directory.

revparse

repositoryRevparse Source #

Arguments

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

repository: a Repository.

-> Text

spec: the revision specification.

-> m (Maybe Object)

Returns: a Object or Nothing if the revision could not be found. (Can throw GError)

Find an object, as specified by a revision string. See man gitrevisions, or the documentation for git rev-parse for information on the syntax accepted.

saveStash

repositorySaveStash Source #

Arguments

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

repository: a Repository.

-> b

stasher: a Signature.

-> Text

message: description along with the stashed state or Nothing to be autogenerated.

-> [StashFlags]

flags: a StashFlags to control the stashing process.

-> m (Maybe OId)

Returns: a new object id of the commit containing the stashed state. (Can throw GError)

Saves the local modifications to a new stash. It returns the commit containing the stashed state. This commit is also the target of the direct reference refs/stash.

setHead

repositorySetHead Source #

Arguments

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

repository: a Repository.

-> Text

refName: canonical name of the reference HEAD should point to.

-> m ()

(Can throw GError)

No description available in the introspection data.

setRemoteUrl

repositorySetRemoteUrl Source #

Arguments

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

repository: a Repository.

-> Text

remote: the remote name who's url is to be set.

-> Text

url: url of the remote.

-> m ()

(Can throw GError)

Sets url for the remote from the repository.

setSubmoduleFetchRecurse

repositorySetSubmoduleFetchRecurse Source #

Arguments

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

repository: a Repository.

-> Text

name: the name of the submodule.

-> SubmoduleRecurse

fetchRecurseSubmodules: a SubmoduleRecurse.

-> m ()

(Can throw GError)

Sets the submodule.'name'.fetchRecurseSubmodules value for the submodule. This setting won't affect any existing instances..

setSubmoduleIgnore

repositorySetSubmoduleIgnore Source #

Arguments

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

repository: a Repository.

-> Text

name: the name of the submodule.

-> SubmoduleIgnore

ignore: a SubmoduleIgnore.

-> m ()

(Can throw GError)

Sets the ignore rule for the submodule in the configuration. This does not affect any currently-loaded instances..

setSubmoduleUpdate

repositorySetSubmoduleUpdate Source #

Arguments

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

repository: a Repository.

-> Text

name: the name of the submodule.

-> SubmoduleUpdate

update: a SubmoduleUpdate.

-> m ()

(Can throw GError)

Sets the update rule for the submodule in the configuration. This setting won't affect any existing instances.

setSubmoduleUrl

repositorySetSubmoduleUrl Source #

Arguments

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

repository: a Repository.

-> Text

name: the name of the submodule to configure.

-> Text

url: URL that should be used for the submodule.

-> m ()

(Can throw GError)

Sets the URL for the submodule in the configuration.

After calling this, you may wish to call submoduleSync to write the changes to the checked out submodule repository.

setWorkdir

repositorySetWorkdir Source #

Arguments

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

repository: a Repository.

-> b

workdir: the working directory.

-> Bool

updateGitlink: create/update gitlink in workdir.

-> m () 

Sets the working directory of the repository. If updateGitlink is set to True "core.worktree" will be set in the config if workdir is not the parent of the .git directory).

stashForeach

repositoryStashForeach Source #

Arguments

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

repository: a Repository.

-> StashCallback

callback: a StashCallback.

-> m ()

(Can throw GError)

Loops over all the stashed states and issue a callback for each one. If callback returns a non-zero value, this will stop looping.

submoduleForeach

repositorySubmoduleForeach Source #

Arguments

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

repository: a Repository.

-> SubmoduleCallback

callback: a StatusCallback.

-> m ()

(Can throw GError)

Gathers submodules and run a callback for each one.

To the callback is passed the submodule instance and name. If the callback returns something other than 0, the iteration will stop and error will be set.

NOTE: the submodule instance passed to the callback is only valid during the call to ggit_repository_submodule_foreach and may not be used after the call has finished.

tagForeach

repositoryTagForeach Source #

Arguments

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

repository: a Repository.

-> TagCallback

callback: a TagCallback.

-> m ()

(Can throw GError)

Get all the tags in the repository and run the provided callback on each. If the callback returns something other than 0, the iteration will stop and error will be set.

Properties

cloneOptions

No description available in the introspection data.

constructRepositoryCloneOptions :: (IsRepository o, MonadIO m, IsCloneOptions a) => a -> m (GValueConstruct o) Source #

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

getRepositoryCloneOptions :: (MonadIO m, IsRepository o) => o -> m (Maybe CloneOptions) Source #

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

get repository #cloneOptions

head

No description available in the introspection data.

getRepositoryHead :: (MonadIO m, IsRepository o) => o -> m (Maybe Ref) Source #

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

get repository #head

init

No description available in the introspection data.

constructRepositoryInit :: (IsRepository o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getRepositoryInit :: (MonadIO m, IsRepository o) => o -> m Bool Source #

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

get repository #init

isBare

No description available in the introspection data.

constructRepositoryIsBare :: (IsRepository o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getRepositoryIsBare :: (MonadIO m, IsRepository o) => o -> m Bool Source #

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

get repository #isBare

location

No description available in the introspection data.

constructRepositoryLocation :: (IsRepository o, MonadIO m, IsFile a) => a -> m (GValueConstruct o) Source #

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

getRepositoryLocation :: (MonadIO m, IsRepository o) => o -> m (Maybe File) Source #

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

get repository #location

url

No description available in the introspection data.

constructRepositoryUrl :: (IsRepository o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getRepositoryUrl :: (MonadIO m, IsRepository o) => o -> m (Maybe Text) Source #

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

get repository #url

workdir

No description available in the introspection data.

clearRepositoryWorkdir :: (MonadIO m, IsRepository o) => o -> m () Source #

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

clear #workdir

constructRepositoryWorkdir :: (IsRepository o, MonadIO m, IsFile a) => a -> m (GValueConstruct o) Source #

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

getRepositoryWorkdir :: (MonadIO m, IsRepository o) => o -> m (Maybe File) Source #

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

get repository #workdir

setRepositoryWorkdir :: (MonadIO m, IsRepository o, IsFile a) => o -> a -> m () Source #

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

set repository [ #workdir := value ]