initremote --private
This commit is contained in:
parent
141a4e9750
commit
2b264b3edf
2 changed files with 12 additions and 1 deletions
|
@ -1,5 +1,9 @@
|
|||
git-annex (8.20210331) UNRELEASED; urgency=medium
|
||||
|
||||
* New annex.private and remote.name.annex-private configs that can
|
||||
prevent storing information about a repository and remotes in the
|
||||
git-annex branch.
|
||||
* initremote: Added --private option to set up a private special remote.
|
||||
* Fix build with persistent-2.12.0.1
|
||||
* Avoid excess commits to the git-annex branch when stall detection is
|
||||
enabled.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{- git-annex command
|
||||
-
|
||||
- Copyright 2011-2020 Joey Hess <id@joeyh.name>
|
||||
- Copyright 2011-2021 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
@ -34,6 +34,7 @@ data InitRemoteOptions = InitRemoteOptions
|
|||
{ cmdparams :: CmdParams
|
||||
, sameas :: Maybe (DeferredParse UUID)
|
||||
, whatElse :: Bool
|
||||
, privateRemote :: Bool
|
||||
}
|
||||
|
||||
optParser :: CmdParamsDesc -> Parser InitRemoteOptions
|
||||
|
@ -45,6 +46,10 @@ optParser desc = InitRemoteOptions
|
|||
<> short 'w'
|
||||
<> help "describe other configuration parameters for a special remote"
|
||||
)
|
||||
<*> switch
|
||||
( long "private"
|
||||
<> help "keep special remote information out of git-annex branch"
|
||||
)
|
||||
|
||||
parseSameasOption :: Parser (DeferredParse UUID)
|
||||
parseSameasOption = parseUUIDOption <$> strOption
|
||||
|
@ -85,6 +90,8 @@ start o (name:ws) = ifM (isJust <$> findExisting name)
|
|||
|
||||
perform :: RemoteType -> String -> R.RemoteConfig -> InitRemoteOptions -> CommandPerform
|
||||
perform t name c o = do
|
||||
when (privateRemote o) $
|
||||
setConfig (remoteAnnexConfig c "private") (boolConfig True)
|
||||
dummycfg <- liftIO dummyRemoteGitConfig
|
||||
let c' = M.delete uuidField c
|
||||
(c'', u) <- R.setup t R.Init (sameasu <|> uuidfromuser) Nothing c' dummycfg
|
||||
|
|
Loading…
Reference in a new issue