summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-07 11:16:48 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-07 11:16:48 -0400
commit4d1c114e4d27ae339f6fb408d398945fa68c2435 (patch)
tree2d27fd4ba63047e2aae7940fa6477a3e443befba
parent8408a91082f440e139884117b2698bb8e0bd3fe9 (diff)
initremote: Automatically describe a remote when creating it.
This ensures that all special remotes show up in git annex status. Before, a special remote that was not manually described, and was not a current git remote, did not show up there, although initremote did list it.
-rw-r--r--Command/InitRemote.hs2
-rw-r--r--Remote.hs7
-rw-r--r--debian/changelog1
3 files changed, 5 insertions, 5 deletions
diff --git a/Command/InitRemote.hs b/Command/InitRemote.hs
index 698d60455..a78505a19 100644
--- a/Command/InitRemote.hs
+++ b/Command/InitRemote.hs
@@ -15,6 +15,7 @@ import qualified Remote
import qualified Logs.Remote
import qualified Types.Remote as R
import Annex.UUID
+import Logs.UUID
def :: [Command]
def = [command "initremote"
@@ -60,6 +61,7 @@ findByName name = do
where
generate = do
uuid <- liftIO genUUID
+ describeUUID uuid name
return (uuid, M.insert nameKey name M.empty)
findByName' :: String -> M.Map UUID R.RemoteConfig -> Maybe (UUID, R.RemoteConfig)
diff --git a/Remote.hs b/Remote.hs
index e9e66990c..839c6ddb0 100644
--- a/Remote.hs
+++ b/Remote.hs
@@ -54,9 +54,9 @@ remoteMap :: (Remote -> a) -> Annex (M.Map UUID a)
remoteMap c = M.fromList . map (\r -> (uuid r, c r)) .
filter (\r -> uuid r /= NoUUID) <$> remoteList
-{- Map of UUIDs and their descriptions.
+{- Map of UUIDs of remotes and their descriptions.
- The names of Remotes are added to suppliment any description that has
- - been set for a repository. -}
+ - been set for a repository. -}
uuidDescriptions :: Annex (M.Map UUID String)
uuidDescriptions = M.unionWith addName <$> uuidMap <*> remoteMap name
@@ -102,9 +102,6 @@ nameToUUID n = byName' n >>= go
{- Pretty-prints a list of UUIDs of remotes, for human display.
-
- - Shows descriptions from the uuid log, falling back to remote names,
- - as some remotes may not be in the uuid log.
- -
- When JSON is enabled, also generates a machine-readable description
- of the UUIDs. -}
prettyPrintUUIDs :: String -> [UUID] -> Annex String
diff --git a/debian/changelog b/debian/changelog
index 9a010327d..8a734e0aa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ git-annex (3.20120606) UNRELEASED; urgency=low
* add: Prevent (most) modifications from being made to a file while it
is being added to the annex.
+ * initremote: Automatically describe a remote when creating it.
-- Joey Hess <joeyh@debian.org> Tue, 05 Jun 2012 20:25:51 -0400