Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type CommitId = Text
- gitProc :: FilePath -> [String] -> ProcessSpec
- ensureCleanGitRepo :: (MonadIO m, MonadLog Output m, MonadError e m, AsProcessFailure e, MonadFail m, AsUnstructuredError e, HasCliConfig e m, MonadMask m) => FilePath -> Bool -> Text -> m ()
- readGitProcess :: (MonadIO m, MonadLog Output m, MonadError e m, AsProcessFailure e, MonadFail m, MonadMask m) => FilePath -> [String] -> m Text
- isolateGitProc :: ProcessSpec -> ProcessSpec
- gitProcNoRepo :: [String] -> ProcessSpec
- gitLsRemote :: (MonadIO m, MonadLog Output m, MonadError e m, AsProcessFailure e, MonadFail m, AsUnstructuredError e) => String -> Maybe GitRef -> Maybe String -> m (ExitCode, GitLsRemoteMaps)
- gitLookupDefaultBranch :: GitLsRemoteMaps -> Either Text Text
- gitLookupCommitForRef :: GitLsRemoteMaps -> GitRef -> Either Text CommitId
- data GitRef
Documentation
gitProc :: FilePath -> [String] -> ProcessSpec Source #
Create a ProcessSpec
for invoking git
in a specified repository
path, using the given arguments.
:: (MonadIO m, MonadLog Output m, MonadError e m, AsProcessFailure e, MonadFail m, AsUnstructuredError e, HasCliConfig e m, MonadMask m) | |
=> FilePath | The repository |
-> Bool | Should ignored files be considered? |
-> Text | The error message which should be thrown when the repository is unclean. |
-> m () |
Ensure that the given directory is a clean git repository. If the repository has changes, throw an error.
readGitProcess :: (MonadIO m, MonadLog Output m, MonadError e m, AsProcessFailure e, MonadFail m, MonadMask m) => FilePath -> [String] -> m Text Source #
Call git
in the specified directory with the given arguments and
return its standard output stream. Error messages from git
, if any,
are printed with Notice
verbosity.
isolateGitProc :: ProcessSpec -> ProcessSpec Source #
Modify the ProcessSpec
to apply environment flags which ensure
git
has no dependency on external information. Specifically:
- The
HOME
directory is unset GIT_CONFIG_NOSYSTEM
is set to 1GIT_TERMINAL_PROMPT
is set to 0 andGIT_ASKPASS
is set toecho
, so that password prompts will not pop up- The SSH command used is
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no -o GSSAPIAuthentication=no
gitProcNoRepo :: [String] -> ProcessSpec Source #
Create a ProcessSpec
for invoking git
without a specified
repository, using the given arguments.
gitLsRemote :: (MonadIO m, MonadLog Output m, MonadError e m, AsProcessFailure e, MonadFail m, AsUnstructuredError e) => String -> Maybe GitRef -> Maybe String -> m (ExitCode, GitLsRemoteMaps) Source #