From: Joey Hess Date: Fri, 3 Feb 2017 18:36:14 +0000 (-0400) Subject: make sync --no-commit override annex.annex.autocommit X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~275^2~682 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c545701224cddfea80b103ce5eab570df33b711a;p=git-annex.git make sync --no-commit override annex.annex.autocommit --- diff --git a/Command/Sync.hs b/Command/Sync.hs index 581cad5620..37fc343e7f 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -66,6 +66,7 @@ cmd = withGlobalOptions [jobsOption] $ data SyncOptions = SyncOptions { syncWith :: CmdParams , commitOption :: Bool + , noCommitOption :: Bool , messageOption :: Maybe String , pullOption :: Bool , pushOption :: Bool @@ -80,8 +81,13 @@ optParser desc = SyncOptions ( metavar desc <> completeRemotes )) - <*> invertableSwitch "commit" True - ( help "avoid git commit" + <*> switch + ( long "commit" + <> help "commit changes to git" + ) + <*> switch + ( long "no-commit" + <> help "avoid git commit" ) <*> optional (strOption ( long "message" <> short 'm' <> metavar "MSG" @@ -246,7 +252,7 @@ commit o = stopUnless shouldcommit $ next $ next $ do ) where shouldcommit = pure (commitOption o) - <&&> getGitConfigVal annexAutoCommit + <||> (pure (not (noCommitOption o)) <&&> getGitConfigVal annexAutoCommit) commitMsg :: Annex String commitMsg = do