miss-0: A Haskell git implimentation

Safe HaskellNone
LanguageHaskell2010

Data.Git.Ref

Description

A ref is a pointer to a hash (or "symref", which is a pointer to another ref). Refs are just files under .git (usually .git/refs, though HEAD is a notable exception) that contain the (40-byte) hash to which they refer. We factor refs into Refs proper and RefFiles---the former denoting a ref's name, and the latter the contents of ref file.

Synopsis

Documentation

data Ref Source #

A reference to a git hash

Constructors

HEAD 
Branch RefName

branches under refs/heads

TagRef RefName (Maybe Sha1)

tags under refs/tags, possibly peeled

RemRef RemoteName RefName

remote refs under refs/remotes

ExpRef RefName

any path under .git

Instances
Eq Ref Source # 
Instance details

Defined in Data.Git.Ref

Methods

(==) :: Ref -> Ref -> Bool #

(/=) :: Ref -> Ref -> Bool #

Ord Ref Source # 
Instance details

Defined in Data.Git.Ref

Methods

compare :: Ref -> Ref -> Ordering #

(<) :: Ref -> Ref -> Bool #

(<=) :: Ref -> Ref -> Bool #

(>) :: Ref -> Ref -> Bool #

(>=) :: Ref -> Ref -> Bool #

max :: Ref -> Ref -> Ref #

min :: Ref -> Ref -> Ref #

Show Ref Source # 
Instance details

Defined in Data.Git.Ref

Methods

showsPrec :: Int -> Ref -> ShowS #

show :: Ref -> String #

showList :: [Ref] -> ShowS #

IsString Ref Source # 
Instance details

Defined in Data.Git.Ref

Methods

fromString :: String -> Ref #

InRepo Ref Source #

The path of a Ref relative to the git directory.

Instance details

Defined in Data.Git.Ref

data RefFile Source #

The contents of a file containing a Ref. Either a Sha1 or a "Symbolic Reference" (e.g., ref: refsheadsmaster) to another Ref.

Constructors

ShaRef Sha1 
SymRef Ref 
Instances
Eq RefFile Source # 
Instance details

Defined in Data.Git.Ref

Methods

(==) :: RefFile -> RefFile -> Bool #

(/=) :: RefFile -> RefFile -> Bool #

Ord RefFile Source # 
Instance details

Defined in Data.Git.Ref

Show RefFile Source # 
Instance details

Defined in Data.Git.Ref

mkRef :: ByteString -> Maybe Ref Source #

Try to parse a Ref.

readRefFile :: RawFilePath -> IO (Maybe RefFile) Source #

Try to parse a RefFile out of an actual file.

readPackedRefsFile :: RawFilePath -> IO (Maybe [(Ref, Sha1)]) Source #

Try to parse any given packed-refs file.