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

Description

Represents a diff list.

Synopsis

Exported types

newtype Diff Source #

Memory-managed wrapper type.

Constructors

Diff (ManagedPtr Diff) 

Instances

Instances details
Eq Diff Source # 
Instance details

Defined in GI.Ggit.Objects.Diff

Methods

(==) :: Diff -> Diff -> Bool

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

GObject Diff Source # 
Instance details

Defined in GI.Ggit.Objects.Diff

ManagedPtrNewtype Diff Source # 
Instance details

Defined in GI.Ggit.Objects.Diff

Methods

toManagedPtr :: Diff -> ManagedPtr Diff

TypedObject Diff Source # 
Instance details

Defined in GI.Ggit.Objects.Diff

Methods

glibType :: IO GType

IsGValue Diff Source #

Convert Diff to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Ggit.Objects.Diff

Methods

toGValue :: Diff -> IO GValue

fromGValue :: GValue -> IO Diff

HasParentTypes Diff Source # 
Instance details

Defined in GI.Ggit.Objects.Diff

type ParentTypes Diff Source # 
Instance details

Defined in GI.Ggit.Objects.Diff

type ParentTypes Diff = '[Native, ObjectFactoryBase, Object]

class (GObject o, IsDescendantOf Diff o) => IsDiff o Source #

Type class for types which can be safely cast to Diff, for instance with toDiff.

Instances

Instances details
(GObject o, IsDescendantOf Diff o) => IsDiff o Source # 
Instance details

Defined in GI.Ggit.Objects.Diff

toDiff :: (MonadIO m, IsDiff o) => o -> m Diff Source #

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

Methods

Overloaded methods

findSimilar

diffFindSimilar Source #

Arguments

:: (HasCallStack, MonadIO m, IsDiff a, IsDiffFindOptions b) 
=> a

diff: a Diff.

-> Maybe b

options: a DiffFindOptions or Nothing.

-> m ()

(Can throw GError)

Transform diff marking file renames, copies, etc.. If options is set to Nothing, then the default options will be used.

formatEmail

diffFormatEmail Source #

Arguments

:: (HasCallStack, MonadIO m, IsDiff a, IsDiffFormatEmailOptions b) 
=> a

diff: a Diff.

-> b

options: a DiffFormatEmailOptions.

-> m (Maybe Text)

Returns: the patch or Nothing if an error occurred. (Can throw GError)

Create an e-mail ready patch from a diff.

getDelta

diffGetDelta Source #

Arguments

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

diff: a Diff.

-> Word64

index: the index.

-> m (Maybe DiffDelta)

Returns: a DiffDelta or Nothing.

Get the delta at the specified index.

getNumDeltas

diffGetNumDeltas Source #

Arguments

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

diff: a Diff.

-> m Word64

Returns: the number of deltas.

Get the number of deltas in the diff.

merge

diffMerge Source #

Arguments

:: (HasCallStack, MonadIO m, IsDiff a, IsDiff b) 
=> a

onto: the Diff to merge into.

-> b

from: the Diff to merge.

-> m ()

(Can throw GError)

Merges from into onto unless error is set.

newBuffers

diffNewBuffers Source #

Arguments

:: (HasCallStack, MonadIO m, IsDiffOptions a) 
=> Maybe ByteString

buffer1: a buffer to diff from.

-> Maybe Text

buffer1AsPath: treat buffer1 as if it had this filename, or Nothing,

-> Maybe ByteString

buffer2: a buffer to diff to.

-> Maybe Text

buffer2AsPath: treat buffer2 as if it had this filename, or Nothing,

-> Maybe a

diffOptions: a DiffOptions, or Nothing.

-> m (Maybe Diff)

Returns: a newly allocated Diff if there was no error, Nothing otherwise. (Can throw GError)

Same as diffBlobs but using a buffers. Creates a Diff which compares buffer1 and buffer2.

If diffOptions is Nothing then the defaults specified in diffOptionsNew are used.

newIndexToWorkdir

diffNewIndexToWorkdir Source #

Arguments

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

repository: a Repository.

-> Maybe b

index: a Index, or Nothing.

-> Maybe c

diffOptions: a DiffOptions, or Nothing.

-> m (Maybe Diff)

Returns: a newly allocated Diff if there was no error, Nothing otherwise. (Can throw GError)

Creates a Diff which compares the working directory and the index.

If index is Nothing then repository index is used. If diffOptions is Nothing then the defaults specified in diffOptionsNew are used.

newTreeToIndex

diffNewTreeToIndex Source #

Arguments

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

repository: a Repository.

-> Maybe b

oldTree: a Tree to diff from.

-> Maybe c

index: a Index, or Nothing.

-> Maybe d

diffOptions: a DiffOptions, or Nothing.

-> m (Maybe Diff)

Returns: a newly allocated Diff if there was no error, Nothing otherwise. (Can throw GError)

Creates a Diff which compares oldTree and the index.

If index is Nothing then repository index is used. If diffOptions is Nothing then the defaults specified in diffOptionsNew are used.

newTreeToTree

diffNewTreeToTree Source #

Arguments

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

repository: a Repository.

-> Maybe b

oldTree: a Tree to diff from.

-> Maybe c

newTree: a Tree to diff to.

-> Maybe d

diffOptions: a DiffOptions, or Nothing.

-> m (Maybe Diff)

Returns: a newly allocated Diff if there was no error, Nothing otherwise. (Can throw GError)

Creates a Diff which compares oldTree and newTree.

If diffOptions is Nothing then the defaults specified in diffOptionsNew are used.

newTreeToWorkdir

diffNewTreeToWorkdir Source #

Arguments

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

repository: a Repository.

-> Maybe b

oldTree: a Tree to diff from.

-> Maybe c

diffOptions: a DiffOptions, or Nothing.

-> m (Maybe Diff)

Returns: a newly allocated Diff if there was no error, Nothing otherwise. (Can throw GError)

Creates a Diff which compares the working directory and oldTree.

If diffOptions is Nothing then the defaults specified in diffOptionsNew are used.

print

diffPrint Source #

Arguments

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

diff: a Diff.

-> DiffFormatType

type: a DiffFormatType.

-> DiffLineCallback

printCb: a DiffLineCallback.

-> m ()

(Can throw GError)

Iterates over diff generating text output like "git diff".

Properties

repository

No description available in the introspection data.

constructDiffRepository :: (IsDiff o, MonadIO m, IsRepository a) => a -> m (GValueConstruct o) Source #

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

getDiffRepository :: (MonadIO m, IsDiff o) => o -> m (Maybe Repository) Source #

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

get diff #repository