Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

Safe HaskellNone

Cmd.SaveGit

Contents

Synopsis

Documentation

data SaveHistory Source #

History to be saved to disk. The updates are post-diff to know which bits of state to write, and the commit is what commit the updates are relative to, if any. If they're Nothing, then save everything.

It's very important to bundle the commit and updates together, because without the commit to know what they are relative to, the updates don't mean anything, and if they're applied on top of the wrong commit the result will be a corrupted state.

Instances
Show SaveHistory # 
Instance details

Defined in Cmd.SaveGitTypes

Pretty SaveHistory # 
Instance details

Defined in Cmd.SaveGitTypes

data LoadHistory Source #

History loaded from disk. It only has CmdUpdates so you can feed them to diff.

Instances
Show LoadHistory # 
Instance details

Defined in Cmd.SaveGit

data Commit Source #

Instances
Eq Commit # 
Instance details

Defined in Util.GitTypes

Methods

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

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

Ord Commit # 
Instance details

Defined in Util.GitTypes

Show Commit # 
Instance details

Defined in Util.GitTypes

Pretty Commit # 
Instance details

Defined in Util.GitTypes

save point

data SavePoint Source #

Stored in reverse order as in the ref name.

Instances
Eq SavePoint # 
Instance details

Defined in Cmd.SaveGit

Show SavePoint # 
Instance details

Defined in Cmd.SaveGit

Pretty SavePoint # 
Instance details

Defined in Cmd.SaveGit

set_save_tag :: Repo -> Commit -> IO (Either.Either Text SavePoint) Source #

Add a new save point tag to the given commit, unless it already has one.

write_save_ref :: Repo -> SavePoint -> Commit -> IO () Source #

Create a tag for the given commit.

read_last_save Source #

Arguments

:: Repo 
-> Maybe.Maybe Commit

Find the last save from this commit, or HEAD if not given.

-> IO (Maybe.Maybe (SavePoint, Commit)) 

save

checkpoint :: User -> Repo -> SaveHistory -> IO (Either.Either Text Commit) Source #

Checkpoint the given SaveHistory. If it has no previous commit, create a new repo.

save :: User -> Repo -> Ui.State -> [Text] -> IO Commit Source #

Create a new repo, or throw if it already exists.

should_record :: Update.UiUpdate -> Bool Source #

True if this update is interesting enough to record a checkpoint for.

load

load Source #

Arguments

:: Repo 
-> Maybe.Maybe Commit 
-> IO (Either.Either Text (Ui.State, Commit, [Text]))

(state, commit, name of the cmd this is a checkpoint of)

load_previous_history :: Repo -> Ui.State -> Commit -> IO (Either.Either Text (Maybe.Maybe LoadHistory)) Source #

Try to go get the previous history entry.

load_next_history :: Repo -> Ui.State -> Commit -> IO (Either.Either Text (Maybe.Maybe LoadHistory)) Source #

Try to a commits that has this one as a parent.

views

util

infer_commit :: Repo -> String -> IO (Maybe.Maybe Commit) Source #

If a string looks like a commit hash, return the commit, otherwise look for a ref in tags/.

User

data User Source #

Git wants these fields for commits. It probably doesn't matter much what they are, but they might as well be accurate.

Constructors

User 

Fields

Instances
Show User # 
Instance details

Defined in Cmd.SaveGit

Methods

showsPrec :: Int -> User -> ShowS #

show :: User -> String #

showList :: [User] -> ShowS #