diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-08-05 13:49:54 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-08-05 13:49:58 -0400 |
commit | a43686b9847c19efebd1f15519083436ac155a8e (patch) | |
tree | 98abed3386788da3002142a1053cdce09789c023 /Remote/List.hs | |
parent | 0ad42412dbc981969e0847b498701e6b9ca6dd17 (diff) |
Simplify setup process for a ssh remote.
Now it suffices to run git remote add, followed by git-annex sync. Now the
remote is automatically initialized for use by git-annex, where before the
git-annex branch had to manually be pushed before using git-annex sync.
Note that this involved changes to git-annex-shell, so if the remote is
using an old version, the manual push is still needed.
Implementation required git-annex-shell be changed, so configlist can
autoinit a repository even when no git-annex branch has been pushed yet.
Unfortunate because we'll have to wait for it to get deployed to servers
before being able to rely on this change in the documentation.
Did consider making git-annex sync push the git-annex branch to repos that
didn't have a uuid, but this seemed difficult to do without complicating it
in messy ways.
It would be cleaner to split a command out from configlist to handle
the initialization. But this is difficult without sacrificing backwards
compatability, for users of old git-annex versions which would not use the
new command.
Diffstat (limited to 'Remote/List.hs')
-rw-r--r-- | Remote/List.hs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Remote/List.hs b/Remote/List.hs index 49b0a35f2..5472059bd 100644 --- a/Remote/List.hs +++ b/Remote/List.hs @@ -72,14 +72,19 @@ remoteList :: Annex [Remote] remoteList = do rs <- Annex.getState Annex.remotes if null rs - then do - m <- readRemoteLog - rs' <- concat <$> mapM (process m) remoteTypes - Annex.changeState $ \s -> s { Annex.remotes = rs' } - return rs' + then remoteList' False else return rs + +remoteList' :: Bool -> Annex [Remote] +remoteList' autoinit = do + m <- readRemoteLog + rs <- concat <$> mapM (process m) remoteTypes + Annex.changeState $ \s -> s { Annex.remotes = rs } + return rs where - process m t = enumerate t >>= mapM (remoteGen m t) >>= return . catMaybes + process m t = enumerate t autoinit + >>= mapM (remoteGen m t) + >>= return . catMaybes {- Forces the remoteList to be re-generated, re-reading the git config. -} remoteListRefresh :: Annex [Remote] @@ -109,7 +114,7 @@ updateRemote remote = do where updaterepo r | Git.repoIsLocal r || Git.repoIsLocalUnknown r = - Remote.Git.configRead r + Remote.Git.configRead False r | otherwise = return r {- Checks if a remote is syncable using git. -} |