summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-09-30 15:02:08 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-09-30 15:02:29 -0400
commit29032cb70e66d18f25b9b942eb01dceeeb8aa300 (patch)
treeae8887cccb688b310b489924e3a3a2f0b311fbf2
parentf88738223ee5156baac8f0fa0bde6d701f1fdd07 (diff)
When displaying a list of repositories, show git remote names in addition to their descriptions.
-rw-r--r--Remote.hs21
-rw-r--r--debian/changelog2
-rw-r--r--doc/forum/tips:_special__95__remotes__47__hook_with_tahoe-lafs.mdwn2
-rw-r--r--doc/walkthrough/automatically_managing_content.mdwn4
4 files changed, 19 insertions, 10 deletions
diff --git a/Remote.hs b/Remote.hs
index 87fd8aab6..83a593dd5 100644
--- a/Remote.hs
+++ b/Remote.hs
@@ -136,18 +136,25 @@ nameToUUID n = do
prettyPrintUUIDs :: String -> [UUID] -> Annex String
prettyPrintUUIDs desc uuids = do
here <- getUUID =<< Annex.gitRepo
- m <- M.union <$> uuidMap <*> availMap
+ m <- M.unionWith addname <$> uuidMap <*> remoteMap
maybeShowJSON [(desc, map (jsonify m here) uuids)]
return $ unwords $ map (\u -> "\t" ++ prettify m here u ++ "\n") uuids
where
- availMap = M.fromList . map (\r -> (uuid r, name r)) <$> genList
+ addname d n
+ | d == n = d
+ | otherwise = n ++ " (" ++ d ++ ")"
+ remoteMap = M.fromList . map (\r -> (uuid r, name r)) <$> genList
findlog m u = M.findWithDefault "" u m
- prettify m here u = base ++ ishere
+ prettify m here u
+ | not (null d) = u ++ " -- " ++ d
+ | otherwise = u
where
- base = if not $ null $ findlog m u
- then u ++ " -- " ++ findlog m u
- else u
- ishere = if here == u then " <-- here" else ""
+ ishere = here == u
+ n = findlog m u
+ d
+ | null n && ishere = "here"
+ | ishere = addname n "here"
+ | otherwise = n
jsonify m here u = toJSObject
[ ("uuid", toJSON u)
, ("description", toJSON $ findlog m u)
diff --git a/debian/changelog b/debian/changelog
index 3bdd04451..bf41f553d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ git-annex (3.20110929) UNRELEASED; urgency=low
* Various speed improvements gained by using ByteStrings.
* Fix referring to remotes by uuid.
* status: List all known repositories.
+ * When displaying a list of repositories, show git remote names
+ in addition to their descriptions.
-- Joey Hess <joeyh@debian.org> Thu, 29 Sep 2011 18:58:53 -0400
diff --git a/doc/forum/tips:_special__95__remotes__47__hook_with_tahoe-lafs.mdwn b/doc/forum/tips:_special__95__remotes__47__hook_with_tahoe-lafs.mdwn
index 4f5f089a8..8981200d8 100644
--- a/doc/forum/tips:_special__95__remotes__47__hook_with_tahoe-lafs.mdwn
+++ b/doc/forum/tips:_special__95__remotes__47__hook_with_tahoe-lafs.mdwn
@@ -12,7 +12,7 @@ The only quirk I've noticed is this...
<pre>
$ git annex whereis .
whereis frink.jar (2 copies)
- 084603a8-7243-11e0-b1f5-83102bcd7953 -- testtest <-- here
+ 084603a8-7243-11e0-b1f5-83102bcd7953 -- here (testtest)
1d1bc312-7243-11e0-a9ce-5f10c0ce9b0a
ok
</pre>
diff --git a/doc/walkthrough/automatically_managing_content.mdwn b/doc/walkthrough/automatically_managing_content.mdwn
index ba0cad609..ef883efef 100644
--- a/doc/walkthrough/automatically_managing_content.mdwn
+++ b/doc/walkthrough/automatically_managing_content.mdwn
@@ -13,7 +13,7 @@ file.
0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
whereis other_file (3 copies)
0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
- 62b39bbe-4149-11e0-af01-bb89245a1e61 -- usb drive <-- here
+ 62b39bbe-4149-11e0-af01-bb89245a1e61 -- here (usb drive)
7570b02e-15e9-11e0-adf0-9f3f94cb2eaa -- backup drive
What would be handy is some automated versions of get and drop, that only
@@ -31,7 +31,7 @@ work toward having two copies of your files.
# git annex whereis
whereis my_cool_big_file (2 copies)
0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
- 62b39bbe-4149-11e0-af01-bb89245a1e61 -- usb drive <-- here
+ 62b39bbe-4149-11e0-af01-bb89245a1e61 -- here (usb drive)
whereis other_file (2 copies)
0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
7570b02e-15e9-11e0-adf0-9f3f94cb2eaa -- backup drive