make sync --no-commit override annex.annex.autocommit
This commit is contained in:
parent
b77903af48
commit
c545701224
1 changed files with 9 additions and 3 deletions
|
@ -66,6 +66,7 @@ cmd = withGlobalOptions [jobsOption] $
|
||||||
data SyncOptions = SyncOptions
|
data SyncOptions = SyncOptions
|
||||||
{ syncWith :: CmdParams
|
{ syncWith :: CmdParams
|
||||||
, commitOption :: Bool
|
, commitOption :: Bool
|
||||||
|
, noCommitOption :: Bool
|
||||||
, messageOption :: Maybe String
|
, messageOption :: Maybe String
|
||||||
, pullOption :: Bool
|
, pullOption :: Bool
|
||||||
, pushOption :: Bool
|
, pushOption :: Bool
|
||||||
|
@ -80,8 +81,13 @@ optParser desc = SyncOptions
|
||||||
( metavar desc
|
( metavar desc
|
||||||
<> completeRemotes
|
<> completeRemotes
|
||||||
))
|
))
|
||||||
<*> invertableSwitch "commit" True
|
<*> switch
|
||||||
( help "avoid git commit"
|
( long "commit"
|
||||||
|
<> help "commit changes to git"
|
||||||
|
)
|
||||||
|
<*> switch
|
||||||
|
( long "no-commit"
|
||||||
|
<> help "avoid git commit"
|
||||||
)
|
)
|
||||||
<*> optional (strOption
|
<*> optional (strOption
|
||||||
( long "message" <> short 'm' <> metavar "MSG"
|
( long "message" <> short 'm' <> metavar "MSG"
|
||||||
|
@ -246,7 +252,7 @@ commit o = stopUnless shouldcommit $ next $ next $ do
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
shouldcommit = pure (commitOption o)
|
shouldcommit = pure (commitOption o)
|
||||||
<&&> getGitConfigVal annexAutoCommit
|
<||> (pure (not (noCommitOption o)) <&&> getGitConfigVal annexAutoCommit)
|
||||||
|
|
||||||
commitMsg :: Annex String
|
commitMsg :: Annex String
|
||||||
commitMsg = do
|
commitMsg = do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue