added hooks corresponding to annex.*-command
* Added freezecontent-annex and thawcontent-annex hooks that correspond to the git configs annex.freezecontent and annex.thawcontent. * Added secure-erase-annex hook that corresponds to the git config annex.secure-erase-command. * Added commitmessage-annex hook that corresponds to the git config annex.commitmessage-command. * Added http-headers-annex hook that corresponds to the git config annex.http-headers-command. that correspond to the post-update-annex and pre-commit-annex hooks. The use case for these is eg, setting up a git repository that is run in a container, where the easiest way to provide a script is by putting it in .git/hooks/, rather than copying it into the container in a way that puts it in PATH. This is all the ones that make sense to add for annex.*-config git configs. annex.youtube-dl-command is not a hook, it's telling git-annex what command to run. So is annex.shared-sop-command. So omitted those. May later also want to add hooks corresponding to `remote.<name>.annex-cost-command` etc. Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
This commit is contained in:
parent
5df1b2b36e
commit
a73fa77417
11 changed files with 131 additions and 53 deletions
|
@ -521,12 +521,10 @@ createMessage :: Annex String
|
|||
createMessage = fromMaybe "branch created" <$> getCommitMessage
|
||||
|
||||
getCommitMessage :: Annex (Maybe String)
|
||||
getCommitMessage = do
|
||||
config <- Annex.getGitConfig
|
||||
case annexCommitMessageCommand config of
|
||||
Nothing -> return (annexCommitMessage config)
|
||||
Just cmd -> catchDefaultIO (annexCommitMessage config) $
|
||||
Just <$> liftIO (readProcess "sh" ["-c", cmd])
|
||||
getCommitMessage =
|
||||
outputOfAnnexHook commitMessageAnnexHook annexCommitMessageCommand
|
||||
<|>
|
||||
(annexCommitMessage <$> Annex.getGitConfig)
|
||||
|
||||
{- Stages the journal, and commits staged changes to the branch. -}
|
||||
commit :: String -> Annex ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue