When displaying a list of repositories, show git remote names in addition to their descriptions.
This commit is contained in:
parent
f88738223e
commit
29032cb70e
4 changed files with 19 additions and 10 deletions
21
Remote.hs
21
Remote.hs
|
@ -136,18 +136,25 @@ nameToUUID n = do
|
||||||
prettyPrintUUIDs :: String -> [UUID] -> Annex String
|
prettyPrintUUIDs :: String -> [UUID] -> Annex String
|
||||||
prettyPrintUUIDs desc uuids = do
|
prettyPrintUUIDs desc uuids = do
|
||||||
here <- getUUID =<< Annex.gitRepo
|
here <- getUUID =<< Annex.gitRepo
|
||||||
m <- M.union <$> uuidMap <*> availMap
|
m <- M.unionWith addname <$> uuidMap <*> remoteMap
|
||||||
maybeShowJSON [(desc, map (jsonify m here) uuids)]
|
maybeShowJSON [(desc, map (jsonify m here) uuids)]
|
||||||
return $ unwords $ map (\u -> "\t" ++ prettify m here u ++ "\n") uuids
|
return $ unwords $ map (\u -> "\t" ++ prettify m here u ++ "\n") uuids
|
||||||
where
|
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
|
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
|
where
|
||||||
base = if not $ null $ findlog m u
|
ishere = here == u
|
||||||
then u ++ " -- " ++ findlog m u
|
n = findlog m u
|
||||||
else u
|
d
|
||||||
ishere = if here == u then " <-- here" else ""
|
| null n && ishere = "here"
|
||||||
|
| ishere = addname n "here"
|
||||||
|
| otherwise = n
|
||||||
jsonify m here u = toJSObject
|
jsonify m here u = toJSObject
|
||||||
[ ("uuid", toJSON u)
|
[ ("uuid", toJSON u)
|
||||||
, ("description", toJSON $ findlog m u)
|
, ("description", toJSON $ findlog m u)
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -3,6 +3,8 @@ git-annex (3.20110929) UNRELEASED; urgency=low
|
||||||
* Various speed improvements gained by using ByteStrings.
|
* Various speed improvements gained by using ByteStrings.
|
||||||
* Fix referring to remotes by uuid.
|
* Fix referring to remotes by uuid.
|
||||||
* status: List all known repositories.
|
* 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
|
-- Joey Hess <joeyh@debian.org> Thu, 29 Sep 2011 18:58:53 -0400
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ The only quirk I've noticed is this...
|
||||||
<pre>
|
<pre>
|
||||||
$ git annex whereis .
|
$ git annex whereis .
|
||||||
whereis frink.jar (2 copies)
|
whereis frink.jar (2 copies)
|
||||||
084603a8-7243-11e0-b1f5-83102bcd7953 -- testtest <-- here
|
084603a8-7243-11e0-b1f5-83102bcd7953 -- here (testtest)
|
||||||
1d1bc312-7243-11e0-a9ce-5f10c0ce9b0a
|
1d1bc312-7243-11e0-a9ce-5f10c0ce9b0a
|
||||||
ok
|
ok
|
||||||
</pre>
|
</pre>
|
||||||
|
|
|
@ -13,7 +13,7 @@ file.
|
||||||
0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
|
0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
|
||||||
whereis other_file (3 copies)
|
whereis other_file (3 copies)
|
||||||
0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
|
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
|
7570b02e-15e9-11e0-adf0-9f3f94cb2eaa -- backup drive
|
||||||
|
|
||||||
What would be handy is some automated versions of get and drop, that only
|
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
|
# git annex whereis
|
||||||
whereis my_cool_big_file (2 copies)
|
whereis my_cool_big_file (2 copies)
|
||||||
0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
|
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)
|
whereis other_file (2 copies)
|
||||||
0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
|
0c443de8-e644-11df-acbf-f7cd7ca6210d -- laptop
|
||||||
7570b02e-15e9-11e0-adf0-9f3f94cb2eaa -- backup drive
|
7570b02e-15e9-11e0-adf0-9f3f94cb2eaa -- backup drive
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue