Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Cmd.SaveGit

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

Instances details
Show SaveHistory Source # 
Instance details

Defined in Cmd.SaveGitT

Pretty SaveHistory Source # 
Instance details

Defined in Cmd.SaveGitT

data LoadHistory Source #

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

Instances

Instances details
Show LoadHistory Source # 
Instance details

Defined in Cmd.SaveGit

data Commit Source #

Instances

Instances details
Show Commit Source # 
Instance details

Defined in Util.GitT

Eq Commit Source # 
Instance details

Defined in Util.GitT

Methods

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

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

Ord Commit Source # 
Instance details

Defined in Util.GitT

Pretty Commit Source # 
Instance details

Defined in Util.GitT

save point

data SavePoint Source #

Stored in reverse order as in the ref name.

Instances

Instances details
Show SavePoint Source # 
Instance details

Defined in Cmd.SaveGit

Eq SavePoint Source # 
Instance details

Defined in Cmd.SaveGit

Pretty SavePoint Source # 
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 :: SaveGitT.User -> Repo -> SaveHistory -> IO (Either.Either Text Commit) Source #

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

save :: SaveGitT.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