.noannex file

A top-level .noannex file will prevent git-annex init from being used in a
repository. This is useful for repositories that have a policy reason not
to use git-annex. The content of the file will be displayed to the user who
tries to run git-annex init.

This also affects git annex reinit and initialization via the webapp.
It does not affect automatic inits, when there's a sibling git-annex branch
already.

This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
Joey Hess 2017-12-13 14:34:32 -04:00
parent 95ec530324
commit 3cc94c1667
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
10 changed files with 41 additions and 12 deletions

View file

@ -45,7 +45,7 @@ findOrGenUUID = do
else ifM (Annex.Branch.hasSibling <||> (isJust <$> Fields.getField Fields.autoInit))
( do
liftIO checkNotReadOnly
initialize Nothing Nothing
initialize (AutoInit True) Nothing Nothing
getUUID
, return NoUUID
)

View file

@ -45,7 +45,7 @@ start os = do
perform :: InitOptions -> CommandPerform
perform os = do
initialize
initialize (AutoInit False)
(if null (initDesc os) then Nothing else Just (initDesc os))
(initVersion os)
Annex.SpecialRemote.autoEnable

View file

@ -36,6 +36,6 @@ perform s = do
then return $ toUUID s
else Remote.nameToUUID s
storeUUID u
initialize' Nothing
initialize' (AutoInit False) Nothing
Annex.SpecialRemote.autoEnable
next $ return True

View file

@ -25,6 +25,6 @@ start :: CommandStart
start = do
showStart' "upgrade" Nothing
whenM (isNothing <$> getVersion) $ do
initialize Nothing Nothing
initialize (AutoInit False) Nothing Nothing
r <- upgrade False latestVersion
next $ next $ return r