hit-0.6.0: Git operations in haskell

Portabilityunix
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>
Safe HaskellNone

Data.Git.Repository

Contents

Description

 

Synopsis

Documentation

data Git Source

represent a git repo, with possibly already opened filereaders for indexes and packs

Config

configRead :: Git -> IO ConfigSource

Read the Config

newtype Config Source

Constructors

Config [Section] 

Instances

data Section Source

Constructors

Section 

Instances

Trees

data HTreeEnt Source

hierarchy tree, either a reference to a blob (file) or a tree (directory).

Constructors

TreeDir Ref HTree 
TreeFile Ref 

newtype RefName Source

Constructors

RefName 

Fields

refNameRaw :: String
 

getCommitMaybe :: Git -> Ref -> IO (Maybe Commit)Source

get a specified commit

getCommit :: Git -> Ref -> IO CommitSource

get a specified commit but raises an exception if doesn't exists or type is not appropriate

getTreeMaybe :: Git -> Ref -> IO (Maybe Tree)Source

get a specified tree

getTree :: Git -> Ref -> IO TreeSource

get a specified tree but raise

rewriteSource

Arguments

:: Git

Repository

-> (Commit -> IO Commit)

Mapping function

-> Revision

revision to start from

-> Int

the number of parents to map

-> IO Ref

return the new head REF

Rewrite a set of commits from a revision and returns the new ref.

If during revision traversal (diving) there's a commit with zero or multiple parents then the traversal will stop regardless of the amount of parent requested.

calling rewrite f 2 (revisionOf d) on the following tree:

a <-- b <-- c <-- d

result in the following tree after mapping with f:

a <-- f(b) <-- f(c) <-- f(d)

buildHTree :: Git -> Tree -> IO HTreeSource

build a hierarchy tree from a tree object

resolvePathSource

Arguments

:: Git

repository

-> Ref

commit reference

-> [ByteString]

paths

-> IO (Maybe Ref) 

resolve the ref (tree or blob) related to a path at a specific commit ref

resolveTreeish :: Git -> Ref -> IO (Maybe Tree)Source

returns a tree from a ref that might be either a commit, a tree or a tag.

resolveRevision :: Git -> Revision -> IO (Maybe Ref)Source

try to resolve a string to a specific commit ref for example: HEAD, HEAD^, master~3, shortRef

initRepo :: FilePath -> IO ()Source

initialize a new repository at a specific location.

isRepo :: FilePath -> IO BoolSource

basic checks to see if a specific path looks like a git repo.

named refs manipulation

branchWriteSource

Arguments

:: Git

repository

-> RefName

the name of the branch to write

-> Ref

the reference to set

-> IO () 

Write a branch to point to a specific reference

branchList :: Git -> IO (Set RefName)Source

Return the list of branches

tagWriteSource

Arguments

:: Git

repository

-> RefName

the name of the tag to write

-> Ref

the reference to set

-> IO () 

Write a tag to point to a specific reference

tagList :: Git -> IO (Set RefName)Source

Return the list of branches

headSetSource

Arguments

:: Git

repository

-> Either Ref RefName

either a raw reference or a branch name

-> IO () 

Set head to point to either a reference or a branch name.

headGet :: Git -> IO (Either Ref RefName)Source

Get what the head is pointing to, or the reference otherwise