| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.Ggit.Objects.Repository
Contents
- Exported types
- Methods
- addRemoteFetch
- addRemotePush
- blameFile
- checkoutHead
- checkoutIndex
- checkoutTree
- cherryPick
- cherryPickCommit
- clone
- createBlob
- createBlobFromBuffer
- createBlobFromFile
- createBlobFromPath
- createBranch
- createCommit
- createCommitFromIds
- createIndexEntryForFile
- createIndexEntryForPath
- createNote
- createReference
- createRemote
- createSymbolicReference
- createTag
- createTagAnnotation
- createTagFromBuffer
- createTagLightweight
- createTreeBuilder
- createTreeBuilderFromTree
- deleteTag
- discover
- discoverFull
- dropStash
- enumerateBranches
- fileStatus
- fileStatusForeach
- getAheadBehind
- getAttribute
- getConfig
- getDefaultNotesRef
- getDescendantOf
- getHead
- getIndex
- getLocation
- getSubmoduleStatus
- getWorkdir
- initRepository
- isBare
- isEmpty
- isHeadDetached
- isHeadUnborn
- listRemotes
- listTags
- listTagsMatch
- lookup
- lookupBranch
- lookupReference
- lookupReferenceDwim
- lookupRemote
- lookupSubmodule
- mergeCommits
- mergeTrees
- noteForeach
- open
- pathIsIgnored
- readNote
- rebaseInit
- rebaseOpen
- referencesForeach
- referencesForeachName
- removeNote
- reset
- resetDefault
- revert
- revparse
- saveStash
- setHead
- setSubmoduleFetchRecurse
- setSubmoduleIgnore
- setSubmoduleUpdate
- setSubmoduleUrl
- setWorkdir
- stashForeach
- submoduleForeach
- tagForeach
- Properties
Description
Represents an existing git repository including all of it's object contents.
- newtype Repository = Repository (ManagedPtr Repository)
- class GObject o => IsRepository o
- toRepository :: (MonadIO m, IsRepository o) => o -> m Repository
- noRepository :: Maybe Repository
- repositoryAddRemoteFetch :: (HasCallStack, MonadIO m, IsRepository a, IsRemote b) => a -> b -> Text -> m ()
- repositoryAddRemotePush :: (HasCallStack, MonadIO m, IsRepository a, IsRemote b) => a -> b -> Text -> m ()
- repositoryBlameFile :: (HasCallStack, MonadIO m, IsRepository a, IsFile b) => a -> b -> Maybe BlameOptions -> m Blame
- repositoryCheckoutHead :: (HasCallStack, MonadIO m, IsRepository a, IsCheckoutOptions b) => a -> Maybe b -> m ()
- repositoryCheckoutIndex :: (HasCallStack, MonadIO m, IsRepository a, IsIndex b, IsCheckoutOptions c) => a -> Maybe b -> Maybe c -> m ()
- repositoryCheckoutTree :: (HasCallStack, MonadIO m, IsRepository a, IsObject b, IsCheckoutOptions c) => a -> Maybe b -> Maybe c -> m ()
- repositoryCherryPick :: (HasCallStack, MonadIO m, IsRepository a, IsCommit b, IsCherryPickOptions c) => a -> b -> c -> m ()
- repositoryCherryPickCommit :: (HasCallStack, MonadIO m, IsRepository a, IsCommit b, IsCommit c) => a -> b -> c -> Word32 -> Maybe MergeOptions -> m Index
- repositoryClone :: (HasCallStack, MonadIO m, IsFile a, IsCloneOptions b) => Text -> a -> Maybe b -> m Repository
- repositoryCreateBlob :: (HasCallStack, MonadIO m, IsRepository a) => a -> m BlobOutputStream
- repositoryCreateBlobFromBuffer :: (HasCallStack, MonadIO m, IsRepository a) => a -> ByteString -> m OId
- repositoryCreateBlobFromFile :: (HasCallStack, MonadIO m, IsRepository a, IsFile b) => a -> b -> m OId
- repositoryCreateBlobFromPath :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m OId
- repositoryCreateBranch :: (HasCallStack, MonadIO m, IsRepository a, IsObject b) => a -> Text -> b -> [CreateFlags] -> m (Maybe Branch)
- repositoryCreateCommit :: (HasCallStack, MonadIO m, IsRepository a, IsSignature b, IsSignature c, IsTree d) => a -> Maybe Text -> b -> c -> Maybe Text -> Text -> d -> [Commit] -> m OId
- repositoryCreateCommitFromIds :: (HasCallStack, MonadIO m, IsRepository a, IsSignature b, IsSignature c) => a -> Maybe Text -> b -> c -> Maybe Text -> Text -> OId -> [OId] -> m OId
- repositoryCreateIndexEntryForFile :: (HasCallStack, MonadIO m, IsRepository a, IsFile b) => a -> Maybe b -> Maybe OId -> m IndexEntry
- repositoryCreateIndexEntryForPath :: (HasCallStack, MonadIO m, IsRepository a) => a -> Maybe Text -> Maybe OId -> m IndexEntry
- repositoryCreateNote :: (HasCallStack, MonadIO m, IsRepository a, IsSignature b, IsSignature c) => a -> Maybe Text -> b -> c -> OId -> Text -> Bool -> m OId
- repositoryCreateReference :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> OId -> Text -> m Ref
- repositoryCreateRemote :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> Text -> m (Maybe Remote)
- repositoryCreateSymbolicReference :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> Text -> Text -> m Ref
- repositoryCreateTag :: (HasCallStack, MonadIO m, IsRepository a, IsObject b, IsSignature c) => a -> Text -> b -> c -> Text -> [CreateFlags] -> m (Maybe OId)
- repositoryCreateTagAnnotation :: (HasCallStack, MonadIO m, IsRepository a, IsObject b, IsSignature c) => a -> Text -> b -> c -> Text -> m (Maybe OId)
- repositoryCreateTagFromBuffer :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> [CreateFlags] -> m (Maybe OId)
- repositoryCreateTagLightweight :: (HasCallStack, MonadIO m, IsRepository a, IsObject b) => a -> Text -> b -> [CreateFlags] -> m (Maybe OId)
- repositoryCreateTreeBuilder :: (HasCallStack, MonadIO m, IsRepository a) => a -> m TreeBuilder
- repositoryCreateTreeBuilderFromTree :: (HasCallStack, MonadIO m, IsRepository a, IsTree b) => a -> b -> m TreeBuilder
- repositoryDeleteTag :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m ()
- repositoryDiscover :: (HasCallStack, MonadIO m, IsFile a) => a -> m File
- repositoryDiscoverFull :: (HasCallStack, MonadIO m, IsFile a) => a -> Bool -> Maybe [Text] -> m File
- repositoryDropStash :: (HasCallStack, MonadIO m, IsRepository a) => a -> Word64 -> m ()
- repositoryEnumerateBranches :: (HasCallStack, MonadIO m, IsRepository a) => a -> BranchType -> m BranchEnumerator
- repositoryFileStatus :: (HasCallStack, MonadIO m, IsRepository a, IsFile b) => a -> b -> m [StatusFlags]
- repositoryFileStatusForeach :: (HasCallStack, MonadIO m, IsRepository a) => a -> Maybe StatusOptions -> StatusCallback -> m ()
- repositoryGetAheadBehind :: (HasCallStack, MonadIO m, IsRepository a) => a -> OId -> OId -> m (Word64, Word64)
- repositoryGetAttribute :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> Text -> [AttributeCheckFlags] -> m Text
- repositoryGetConfig :: (HasCallStack, MonadIO m, IsRepository a) => a -> m Config
- repositoryGetDefaultNotesRef :: (HasCallStack, MonadIO m, IsRepository a) => a -> m Text
- repositoryGetDescendantOf :: (HasCallStack, MonadIO m, IsRepository a) => a -> OId -> OId -> m ()
- repositoryGetHead :: (HasCallStack, MonadIO m, IsRepository a) => a -> m Ref
- repositoryGetIndex :: (HasCallStack, MonadIO m, IsRepository a) => a -> m Index
- repositoryGetLocation :: (HasCallStack, MonadIO m, IsRepository a) => a -> m File
- repositoryGetSubmoduleStatus :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> SubmoduleIgnore -> m [SubmoduleStatus]
- repositoryGetWorkdir :: (HasCallStack, MonadIO m, IsRepository a) => a -> m File
- repositoryInitRepository :: (HasCallStack, MonadIO m, IsFile a) => a -> Bool -> m Repository
- repositoryIsBare :: (HasCallStack, MonadIO m, IsRepository a) => a -> m Bool
- repositoryIsEmpty :: (HasCallStack, MonadIO m, IsRepository a) => a -> m ()
- repositoryIsHeadDetached :: (HasCallStack, MonadIO m, IsRepository a) => a -> m ()
- repositoryIsHeadUnborn :: (HasCallStack, MonadIO m, IsRepository a) => a -> m ()
- repositoryListRemotes :: (HasCallStack, MonadIO m, IsRepository a) => a -> m (Maybe [Text])
- repositoryListTags :: (HasCallStack, MonadIO m, IsRepository a) => a -> m (Maybe [Text])
- repositoryListTagsMatch :: (HasCallStack, MonadIO m, IsRepository a) => a -> Maybe Text -> m (Maybe [Text])
- repositoryLookup :: (HasCallStack, MonadIO m, IsRepository a) => a -> OId -> GType -> m Object
- repositoryLookupBranch :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> BranchType -> m (Maybe Branch)
- repositoryLookupReference :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m Ref
- repositoryLookupReferenceDwim :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m Ref
- repositoryLookupRemote :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m (Maybe Remote)
- repositoryLookupSubmodule :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m (Maybe Submodule)
- repositoryMergeCommits :: (HasCallStack, MonadIO m, IsRepository a, IsCommit b, IsCommit c) => a -> b -> c -> MergeOptions -> m Index
- repositoryMergeTrees :: (HasCallStack, MonadIO m, IsRepository a, IsTree b, IsTree c, IsTree d) => a -> b -> c -> d -> MergeOptions -> m Index
- repositoryNoteForeach :: (HasCallStack, MonadIO m, IsRepository a) => a -> Maybe Text -> NoteCallback -> m ()
- repositoryOpen :: (HasCallStack, MonadIO m, IsFile a) => a -> m Repository
- repositoryPathIsIgnored :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m ()
- repositoryReadNote :: (HasCallStack, MonadIO m, IsRepository a) => a -> Maybe Text -> OId -> m Note
- repositoryRebaseInit :: (HasCallStack, MonadIO m, IsRepository a) => a -> Maybe AnnotatedCommit -> Maybe AnnotatedCommit -> Maybe AnnotatedCommit -> RebaseOptions -> m Rebase
- repositoryRebaseOpen :: (HasCallStack, MonadIO m, IsRepository a) => a -> RebaseOptions -> m Rebase
- repositoryReferencesForeach :: (HasCallStack, MonadIO m, IsRepository a) => a -> ReferencesCallback -> m ()
- repositoryReferencesForeachName :: (HasCallStack, MonadIO m, IsRepository a) => a -> ReferencesNameCallback -> m ()
- repositoryRemoveNote :: (HasCallStack, MonadIO m, IsRepository a, IsSignature b, IsSignature c) => a -> Maybe Text -> b -> c -> OId -> m ()
- repositoryReset :: (HasCallStack, MonadIO m, IsRepository a, IsObject b, IsCheckoutOptions c) => a -> b -> ResetType -> c -> m ()
- repositoryResetDefault :: (HasCallStack, MonadIO m, IsRepository a, IsObject b) => a -> Maybe b -> [Text] -> m ()
- repositoryRevert :: (HasCallStack, MonadIO m, IsRepository a, IsCommit b) => a -> b -> RevertOptions -> m ()
- repositoryRevparse :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m Object
- repositorySaveStash :: (HasCallStack, MonadIO m, IsRepository a, IsSignature b) => a -> b -> Text -> [StashFlags] -> m OId
- repositorySetHead :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> m ()
- repositorySetSubmoduleFetchRecurse :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> SubmoduleRecurse -> m ()
- repositorySetSubmoduleIgnore :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> SubmoduleIgnore -> m ()
- repositorySetSubmoduleUpdate :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> SubmoduleUpdate -> m ()
- repositorySetSubmoduleUrl :: (HasCallStack, MonadIO m, IsRepository a) => a -> Text -> Text -> m ()
- repositorySetWorkdir :: (HasCallStack, MonadIO m, IsRepository a, IsFile b) => a -> b -> Bool -> m ()
- repositoryStashForeach :: (HasCallStack, MonadIO m, IsRepository a) => a -> StashCallback -> m ()
- repositorySubmoduleForeach :: (HasCallStack, MonadIO m, IsRepository a) => a -> SubmoduleCallback -> m ()
- repositoryTagForeach :: (HasCallStack, MonadIO m, IsRepository a) => a -> TagCallback -> m ()
- constructRepositoryCloneOptions :: (IsRepository o, IsCloneOptions a) => a -> IO (GValueConstruct o)
- getRepositoryCloneOptions :: (MonadIO m, IsRepository o) => o -> m (Maybe CloneOptions)
- getRepositoryHead :: (MonadIO m, IsRepository o) => o -> m (Maybe Ref)
- constructRepositoryInit :: IsRepository o => Bool -> IO (GValueConstruct o)
- getRepositoryInit :: (MonadIO m, IsRepository o) => o -> m Bool
- constructRepositoryIsBare :: IsRepository o => Bool -> IO (GValueConstruct o)
- getRepositoryIsBare :: (MonadIO m, IsRepository o) => o -> m Bool
- constructRepositoryLocation :: (IsRepository o, IsFile a) => a -> IO (GValueConstruct o)
- getRepositoryLocation :: (MonadIO m, IsRepository o) => o -> m (Maybe File)
- constructRepositoryUrl :: IsRepository o => Text -> IO (GValueConstruct o)
- getRepositoryUrl :: (MonadIO m, IsRepository o) => o -> m (Maybe Text)
- clearRepositoryWorkdir :: (MonadIO m, IsRepository o) => o -> m ()
- constructRepositoryWorkdir :: (IsRepository o, IsFile a) => a -> IO (GValueConstruct o)
- getRepositoryWorkdir :: (MonadIO m, IsRepository o) => o -> m (Maybe File)
- setRepositoryWorkdir :: (MonadIO m, IsRepository o, IsFile a) => o -> a -> m ()
Exported types
newtype Repository Source #
Constructors
| Repository (ManagedPtr Repository) |
class GObject o => IsRepository o Source #
Instances
toRepository :: (MonadIO m, IsRepository o) => o -> m Repository Source #
Methods
addRemoteFetch
repositoryAddRemoteFetch Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsRemote b) | |
| => a |
|
| -> b |
|
| -> Text |
|
| -> m () | (Can throw |
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 |
|
| -> b |
|
| -> Text |
|
| -> m () | (Can throw |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsFile b) | |
| => a |
|
| -> b |
|
| -> Maybe BlameOptions |
|
| -> m Blame |
Get a blame for a single file.
checkoutHead
repositoryCheckoutHead Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsCheckoutOptions b) | |
| => a |
|
| -> Maybe b |
|
| -> m () | (Can throw |
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 |
|
| -> Maybe b | |
| -> Maybe c |
|
| -> m () | (Can throw |
checkoutTree
repositoryCheckoutTree Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsObject b, IsCheckoutOptions c) | |
| => a |
|
| -> Maybe b | |
| -> Maybe c |
|
| -> m () | (Can throw |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsCommit b, IsCherryPickOptions c) | |
| => a |
|
| -> b |
|
| -> c |
|
| -> m () | (Can throw |
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 |
|
| -> b |
|
| -> c |
|
| -> Word32 |
|
| -> Maybe MergeOptions |
|
| -> m Index |
Cherry-picks the given commit against the provided ourCommit, producing
and index that reflects the result of the cherry-pick.
clone
Arguments
| :: (HasCallStack, MonadIO m, IsFile a, IsCloneOptions b) | |
| => Text |
|
| -> a |
|
| -> Maybe b |
|
| -> m Repository | Returns: a newly created |
Clones a new git repository in the given folder.
createBlob
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> m BlobOutputStream | Returns: a |
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 |
|
| -> ByteString |
|
| -> m OId | Returns: the new |
Write an in-memory buffer to the object database as a blob.
createBlobFromFile
repositoryCreateBlobFromFile Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsFile b) | |
| => a |
|
| -> b |
|
| -> m OId | Returns: the new |
Write a file to the object database as a blob.
createBlobFromPath
repositoryCreateBlobFromPath Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Text |
|
| -> m OId | Returns: the new |
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 |
|
| -> Text |
|
| -> b |
|
| -> [CreateFlags] |
|
| -> m (Maybe Branch) | Returns: the reference to which the branch
points, or |
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 |
|
| -> Maybe Text |
|
| -> b |
|
| -> c |
|
| -> Maybe Text |
|
| -> Text |
|
| -> d |
|
| -> [Commit] |
|
| -> m OId | Returns: the |
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 |
|
| -> Maybe Text |
|
| -> b |
|
| -> c |
|
| -> Maybe Text |
|
| -> Text |
|
| -> OId |
|
| -> [OId] |
|
| -> m OId | Returns: the |
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 |
|
| -> Maybe b |
|
| -> Maybe OId |
|
| -> m IndexEntry | Returns: a |
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 |
|
| -> Maybe Text |
|
| -> Maybe OId |
|
| -> m IndexEntry | Returns: a |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsSignature b, IsSignature c) | |
| => a |
|
| -> Maybe Text |
|
| -> b |
|
| -> c |
|
| -> OId |
|
| -> Text |
|
| -> Bool |
|
| -> m OId | Returns: the OID for the note or |
Adds a note for an object.
createReference
repositoryCreateReference Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Text |
|
| -> OId |
|
| -> Text |
|
| -> m Ref | Returns: the newly created reference. (Can throw |
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 |
|
| -> Text |
|
| -> Text |
|
| -> m (Maybe Remote) | Returns: a new |
Adds a remote with the default fetch refspec to the repository's configuration.
createSymbolicReference
repositoryCreateSymbolicReference Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Text |
|
| -> Text |
|
| -> Text |
|
| -> m Ref | Returns: the newly created reference. (Can throw |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsObject b, IsSignature c) | |
| => a |
|
| -> Text |
|
| -> b |
|
| -> c |
|
| -> Text |
|
| -> [CreateFlags] |
|
| -> m (Maybe OId) | Returns: the id to which the tag points, or
|
Create a new tag object.
createTagAnnotation
repositoryCreateTagAnnotation Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsObject b, IsSignature c) | |
| => a |
|
| -> Text |
|
| -> b |
|
| -> c |
|
| -> Text |
|
| -> m (Maybe OId) | Returns: the id to which the tag points, or
|
Creates a new annotated tag.
createTagFromBuffer
repositoryCreateTagFromBuffer Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Text |
|
| -> [CreateFlags] |
|
| -> m (Maybe OId) | Returns: the id to which the tag points, or
|
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 |
|
| -> Text |
|
| -> b |
|
| -> [CreateFlags] |
|
| -> m (Maybe OId) | Returns: the id to which the tag points, or
|
Creates a new lightweight tag.
createTreeBuilder
repositoryCreateTreeBuilder Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> m TreeBuilder | Returns: a new |
Create a new tree builder.
createTreeBuilderFromTree
repositoryCreateTreeBuilderFromTree Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsTree b) | |
| => a | |
| -> b |
|
| -> m TreeBuilder | Returns: a new |
Create a tree builder for initialized with tree. To create an empty
tree builder, use ggit_repository_create_tree_builder instead.
deleteTag
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Text |
|
| -> m () | (Can throw |
Delete an existing tag reference by name.
discover
Arguments
| :: (HasCallStack, MonadIO m, IsFile a) | |
| => a |
|
| -> m File | Returns: the repository location. (Can throw |
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 |
|
| -> Bool |
|
| -> Maybe [Text] |
|
| -> m File | Returns: the repository location. (Can throw |
Looks for a git repository.
The lookup starts from path and walks up the parent directories
and stops when a repository is found.
dropStash
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Word64 |
|
| -> m () | (Can throw |
Removes a single stashed state from the stash list.
enumerateBranches
repositoryEnumerateBranches Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> BranchType |
|
| -> m BranchEnumerator | Returns: a branch enumerator. (Can throw |
Get a branch enumerator to enumerate over all branches of the specified
listType in repository.
fileStatus
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsFile b) | |
| => a |
|
| -> b |
|
| -> m [StatusFlags] | Returns: the status for a single file. (Can throw |
Gets the file status for a single file.
fileStatusForeach
repositoryFileStatusForeach Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Maybe StatusOptions |
|
| -> StatusCallback |
|
| -> m () | (Can throw |
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 |
|
| -> OId |
|
| -> OId |
|
| -> m (Word64, Word64) | (Can throw |
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 |
|
| -> Text |
|
| -> Text |
|
| -> [AttributeCheckFlags] |
|
| -> m Text | Returns: the attribute value, or |
Get the attribute value of the specified attribute for the given file.
getConfig
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> m Config |
Get the config for a specific repository.
getDefaultNotesRef
repositoryGetDefaultNotesRef Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> m Text | Returns: the default notes reference for |
Gets the default notes reference for repository. It defaults to
"refs/notes/commits".
getDescendantOf
repositoryGetDescendantOf Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> OId |
|
| -> OId |
|
| -> m () | (Can throw |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> m Ref |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> m Index |
Get the index for a specific repository.
getLocation
repositoryGetLocation Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> m 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 |
|
| -> Text |
|
| -> SubmoduleIgnore |
|
| -> m [SubmoduleStatus] | Returns: the |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> m 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 |
|
| -> Bool |
|
| -> m Repository | Returns: a newly created |
Creates a new git repository in the given folder.
isBare
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> m Bool | Returns: |
Checks if repository is bare.
isEmpty
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> m () | (Can throw |
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 |
|
| -> m () | (Can throw |
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 |
|
| -> m () | (Can throw |
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 |
|
| -> m (Maybe [Text]) | Returns: a list with the remotes. (Can throw |
Fill a list with all the remotes in repository.
listTags
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> m (Maybe [Text]) | Returns: a list with the tags in |
Fill a list with all the tags in the repository.
listTagsMatch
repositoryListTagsMatch Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Maybe Text |
|
| -> m (Maybe [Text]) | Returns: a list with matching tags in |
Fill a list with all the tags in the repository matching the provided
pattern. The pattern can use standard fnmatch syntax.
lookup
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> OId |
|
| -> GType |
|
| -> m Object | Returns: the found |
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.
lookupBranch
repositoryLookupBranch Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Text |
|
| -> BranchType |
|
| -> m (Maybe Branch) | Returns: a branch by its name in a repository. (Can throw |
Lookups a branch by its name in a repository.
lookupReference
repositoryLookupReference Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Text |
|
| -> m Ref | Returns: the searched reference. (Can throw |
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 |
|
| -> Text |
|
| -> m Ref | Returns: the searched reference. (Can throw |
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 |
|
| -> Text |
|
| -> m (Maybe Remote) | Returns: a new |
Gets the remote called name.
lookupSubmodule
repositoryLookupSubmodule Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Text |
|
| -> m (Maybe Submodule) |
Lookups a submodule information by name or path. If the submodule
does not exist, Nothing is returned and a GGIT_ERROR_NOTFOUND error set.
mergeCommits
repositoryMergeCommits Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsCommit b, IsCommit c) | |
| => a |
|
| -> b |
|
| -> c |
|
| -> MergeOptions |
|
| -> m Index | Returns: a new |
Merge two commits creating a Index reflecting the result of the merge.
mergeTrees
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsTree b, IsTree c, IsTree d) | |
| => a |
|
| -> b |
|
| -> c |
|
| -> d |
|
| -> MergeOptions |
|
| -> m Index | Returns: a new |
Merge two trees creating a Index reflecting the result of the merge.
noteForeach
repositoryNoteForeach Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Maybe Text |
|
| -> NoteCallback |
|
| -> m () | (Can throw |
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
Arguments
| :: (HasCallStack, MonadIO m, IsFile a) | |
| => a |
|
| -> m Repository | Returns: a newly created |
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 |
|
| -> Text |
|
| -> m () | (Can throw |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Maybe Text |
|
| -> OId |
|
| -> m Note | Returns: the read note or |
Reads the note for an object.
rebaseInit
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Maybe AnnotatedCommit |
|
| -> Maybe AnnotatedCommit |
|
| -> Maybe AnnotatedCommit |
|
| -> RebaseOptions |
|
| -> m Rebase |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> RebaseOptions |
|
| -> m Rebase |
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 |
|
| -> ReferencesCallback |
|
| -> m () | (Can throw |
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 |
|
| -> ReferencesNameCallback |
|
| -> m () | (Can throw |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsSignature b, IsSignature c) | |
| => a |
|
| -> Maybe Text |
|
| -> b |
|
| -> c |
|
| -> OId |
|
| -> m () | (Can throw |
Removes the note for an object.
reset
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsObject b, IsCheckoutOptions c) | |
| => a |
|
| -> b |
|
| -> ResetType |
|
| -> c |
|
| -> m () | (Can throw |
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 |
|
| -> Maybe b |
|
| -> [Text] |
|
| -> m () | (Can throw |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsCommit b) | |
| => a |
|
| -> b |
|
| -> RevertOptions |
|
| -> m () | (Can throw |
Revert the given commit on top of the current working directory.
revparse
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Text |
|
| -> m Object | Returns: a |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsSignature b) | |
| => a |
|
| -> b |
|
| -> Text |
|
| -> [StashFlags] |
|
| -> m OId | Returns: a new object id of the commit containing the stashed state. (Can throw |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Text |
|
| -> m () | (Can throw |
No description available in the introspection data.
setSubmoduleFetchRecurse
repositorySetSubmoduleFetchRecurse Source #
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> Text |
|
| -> SubmoduleRecurse |
|
| -> m () | (Can throw |
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 |
|
| -> Text |
|
| -> SubmoduleIgnore |
|
| -> m () | (Can throw |
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 |
|
| -> Text |
|
| -> SubmoduleUpdate |
|
| -> m () | (Can throw |
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 |
|
| -> Text |
|
| -> Text |
|
| -> m () | (Can throw |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a, IsFile b) | |
| => a |
|
| -> b |
|
| -> Bool |
|
| -> 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 |
|
| -> StashCallback |
|
| -> m () | (Can throw |
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 |
|
| -> SubmoduleCallback |
|
| -> m () | (Can throw |
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
Arguments
| :: (HasCallStack, MonadIO m, IsRepository a) | |
| => a |
|
| -> TagCallback |
|
| -> m () | (Can throw |
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
constructRepositoryCloneOptions :: (IsRepository o, IsCloneOptions a) => a -> IO (GValueConstruct o) Source #
getRepositoryCloneOptions :: (MonadIO m, IsRepository o) => o -> m (Maybe CloneOptions) Source #
head
getRepositoryHead :: (MonadIO m, IsRepository o) => o -> m (Maybe Ref) Source #
init
constructRepositoryInit :: IsRepository o => Bool -> IO (GValueConstruct o) Source #
getRepositoryInit :: (MonadIO m, IsRepository o) => o -> m Bool Source #
isBare
constructRepositoryIsBare :: IsRepository o => Bool -> IO (GValueConstruct o) Source #
getRepositoryIsBare :: (MonadIO m, IsRepository o) => o -> m Bool Source #
location
constructRepositoryLocation :: (IsRepository o, IsFile a) => a -> IO (GValueConstruct o) Source #
getRepositoryLocation :: (MonadIO m, IsRepository o) => o -> m (Maybe File) Source #
url
constructRepositoryUrl :: IsRepository o => Text -> IO (GValueConstruct o) Source #
getRepositoryUrl :: (MonadIO m, IsRepository o) => o -> m (Maybe Text) Source #
workdir
clearRepositoryWorkdir :: (MonadIO m, IsRepository o) => o -> m () Source #
constructRepositoryWorkdir :: (IsRepository o, IsFile a) => a -> IO (GValueConstruct o) Source #
getRepositoryWorkdir :: (MonadIO m, IsRepository o) => o -> m (Maybe File) Source #
setRepositoryWorkdir :: (MonadIO m, IsRepository o, IsFile a) => o -> a -> m () Source #