| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
VCSWrapper.Git.Safe
Description
- initDB :: Bool -> Ctx (Either VCSException ())
- add :: [FilePath] -> Ctx (Either VCSException ())
- rm :: [FilePath] -> Ctx (Either VCSException ())
- commit :: [FilePath] -> Maybe (Text, Text) -> Text -> [Text] -> Ctx (Either VCSException ())
- checkout :: Maybe Text -> Maybe Text -> Ctx (Either VCSException ())
- status :: Ctx (Either VCSException [Status])
- simpleLog :: Maybe Text -> Ctx (Either VCSException [LogEntry])
- localBranches :: Ctx (Either VCSException (Text, [Text]))
- revparse :: Text -> Ctx (Either VCSException Text)
- remote :: Ctx (Either VCSException [Text])
- pull :: Ctx (Either VCSException (Maybe Text))
- push :: Ctx (Either VCSException ())
- runVcs :: Config -> Ctx t -> IO t
- data VCSType
- type IsLocked = Bool
- data LogEntry = LogEntry {}
- newtype Ctx a = Ctx (ReaderT Config IO a)
- data Config = Config {
- configCwd :: Maybe FilePath
- configPath :: Maybe FilePath
- configAuthor :: Maybe Author
- configEnvironment :: [(Text, Text)]
- data Author = Author {
- authorName :: Text
- authorEmail :: Maybe Text
- data VCSException = VCSException Int Text Text FilePath [Text]
- data Status
- data Modification
- makeConfig :: Maybe FilePath -> Maybe FilePath -> Maybe Author -> Config
- makeConfigWithEnvironment :: Maybe FilePath -> Maybe FilePath -> Maybe Author -> [(Text, Text)] -> Config
- filePath :: Status -> FilePath
- modification :: Status -> Modification
- isLocked :: Status -> IsLocked
Documentation
Arguments
| :: Bool | if |
| -> Ctx (Either VCSException ()) |
Initialize a new git repository. Executes git init.
Arguments
| :: [FilePath] |
|
| -> Ctx (Either VCSException ()) |
Add files to the index. Executes git add.
Arguments
| :: [FilePath] |
|
| -> Ctx (Either VCSException ()) |
Remove files from the index and the working directory. Executes git rm.
Arguments
| :: [FilePath] |
|
| -> Maybe (Text, Text) | (Author name, email) |
| -> Text | Commit message. Don't leave this empty. |
| -> [Text] | Options to be passed to the git executable. |
| -> Ctx (Either VCSException ()) |
Commit the current index or the specified files to the repository. Executes git commit.
Arguments
| :: Maybe Text | Commit ID |
| -> Maybe Text | Branchname. If specified, |
| -> Ctx (Either VCSException ()) |
Checkout the index to some commit ID. Executes git checkout.
status :: Ctx (Either VCSException [Status]) Source #
Return status of the repository as a list of Status. Executes git status.
Arguments
| :: Maybe Text | The branch from which to get the commit messages. (If |
| -> Ctx (Either VCSException [LogEntry]) |
Get all commit messages. Executes git log.
Arguments
| :: Ctx (Either VCSException (Text, [Text])) | (currently checked out branch, list of all other branches) |
Get all local branches. Executes git branch.
Arguments
| :: Text | Revision to pass to rev-parse. |
| -> Ctx (Either VCSException Text) |
Rev-parse a revision. Executes git rev-parse.
pull :: Ctx (Either VCSException (Maybe Text)) Source #
Pull changes from the remote as configured in the git configuration. If a merge conflict
is detected, the error message is returned, otherwise 'Right ()' is returned.
Executes git pull.
push :: Ctx (Either VCSException ()) Source #
Push changes to the remote as configured in the git configuration. Executes git push.
Available VCS types implemented in this package.
Represents a log entry in the history managed by the VCS.
Constructors
| LogEntry | |
Context for all VCS commands.
E.g. to create a new Git repository use something like this:
import VCSWrapper.Git
myInitRepoFn = do
let config = makeConfig "path/to/repo" Nothing Nothing
runVcs config $ initDB FalseConfiguration of the Ctx the VCS commands will be executed in.
Constructors
| Config | |
Fields
| |
Author to be passed to VCS commands where applicable.
Constructors
| Author | |
Fields
| |
data VCSException Source #
This Exception-type will be thrown if a VCS command fails unexpectedly.
Constructors
| VCSException Int Text Text FilePath [Text] | Exit code -> stdout -> errout -> |
Instances
Status of a file managed by the respective VCS.
Constructors
| SVNStatus FilePath Modification IsLocked | |
| GITStatus FilePath Modification |
data Modification Source #
Flags to describe the state of a file.
Constructors
| None | File hasn't been modified. |
| Added | File has been selected to be managed by the respective VCS. |
| Conflicting | File is in conflicting state. Manually resolving the conflict may be necessary. |
| Deleted | File has been deleted. |
| Modified | File has been modified since last commit. |
| Replaced | File has been replaced by a different file. |
| Untracked | File is currently not known by the VCS. |
| Unknown | State of file is unknown. |
| Ignored | File is ignored by VCS. |
| Missing | File is missing. |
Instances
Arguments
| :: Maybe FilePath | Path to the main directory of the repository. E.g. for Git: the directory of the repository containing the |
| -> Maybe FilePath | Path to the vcs executable. If |
| -> Maybe Author | Author to be used for different VCS actions. If |
| -> Config |
Creates a new Config.
makeConfigWithEnvironment Source #
Arguments
| :: Maybe FilePath | Path to the main directory of the repository. E.g. for Git: the directory of the repository containing the |
| -> Maybe FilePath | Path to the vcs executable. If |
| -> Maybe Author | Author to be used for different VCS actions. If |
| -> [(Text, Text)] | List of environment variables mappings passed to the underlying VCS executable. |
| -> Config |
Creates a new Config with a list of environment variables.
modification :: Status -> Modification Source #
Retrieve the Modification of any VCS Status.