From 61a0be4fb0b1ea394b7615cbe87a55b388b42db4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Nov 2016 12:46:44 -0400 Subject: [PATCH 1/2] supposedly unused import was used --- Assistant/WebApp/Notifications.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/Assistant/WebApp/Notifications.hs b/Assistant/WebApp/Notifications.hs index 9d20773c09..8d4a86cc7b 100644 --- a/Assistant/WebApp/Notifications.hs +++ b/Assistant/WebApp/Notifications.hs @@ -16,6 +16,7 @@ import Assistant.DaemonStatus import Assistant.Types.Buddies import Utility.NotificationBroadcaster import Utility.Yesod +import Utility.WebApp import Data.Text (Text) import qualified Data.Text as T From 8354612131df127729545fcefde5e4f8aa0d7851 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Nov 2016 12:50:49 -0400 Subject: [PATCH 2/2] prefer xdot over dot * map: Run xdot if it's available in PATH. On OSX, the dot command does not support graphical display, while xdot does. * Debian: xdot is a better interactive viewer than dot, so Suggest xdot, rather than graphviz. --- CHANGELOG | 4 ++++ Command/Map.hs | 24 +++++++++++++++++------- debian/control | 2 +- doc/git-annex-map.mdwn | 6 +++--- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1e108d4a0b..76da79eaaf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,10 @@ git-annex (6.20161119) UNRELEASED; urgency=medium largerthan, mimetype, and smallerthan; the first two always failed to match, and the latter always matched. * Relicense 5 source files that are not part of the webapp from AGPL to GPL. + * map: Run xdot if it's available in PATH. On OSX, the dot command + does not support graphical display, while xdot does. + * Debian: xdot is a better interactive viewer than dot, so Suggest + xdot, rather than graphviz. -- Joey Hess Mon, 21 Nov 2016 11:27:50 -0400 diff --git a/Command/Map.hs b/Command/Map.hs index 2b21c40ba5..43c00d2572 100644 --- a/Command/Map.hs +++ b/Command/Map.hs @@ -47,15 +47,25 @@ start = do liftIO $ writeFile file (drawMap rs trustmap umap) next $ next $ ifM (Annex.getState Annex.fast) - ( do - showLongNote $ "left map in " ++ file - return True - , do - showLongNote $ "running: dot -Tx11 " ++ file - showOutput - liftIO $ boolSystem "dot" [Param "-Tx11", File file] + ( runViewer file [] + , runViewer file + [ ("xdot", [File file]) + , ("dot", [Param "-Tx11", File file]) + ] ) +runViewer :: FilePath -> [(String, [CommandParam])] -> Annex Bool +runViewer file [] = do + showLongNote $ "left map in " ++ file + return True +runViewer file ((c, ps):rest) = ifM (liftIO $ inPath c) + ( do + showLongNote $ "running: " ++ c ++ unwords (toCommand ps) + showOutput + liftIO $ boolSystem c ps + , runViewer file rest + ) + {- Generates a graph for dot(1). Each repository, and any other uuids - (except for dead ones), are displayed as a node, and each of its - remotes is represented as an edge pointing at the node for the remote. diff --git a/debian/control b/debian/control index ec77a2946e..a07797462d 100644 --- a/debian/control +++ b/debian/control @@ -110,7 +110,7 @@ Recommends: nocache, aria2, Suggests: - graphviz, + xdot, bup, tahoe-lafs, libnss-mdns, diff --git a/doc/git-annex-map.mdwn b/doc/git-annex-map.mdwn index cf28a958e0..ece26b3672 100644 --- a/doc/git-annex-map.mdwn +++ b/doc/git-annex-map.mdwn @@ -10,8 +10,8 @@ git annex map Helps you keep track of your repositories, and the connections between them, by going out and looking at all the ones it can get to, and generating a -Graphviz file displaying it all. If the `dot` command is available, it is -used to display the file to your screen (using x11 backend). +Graphviz file displaying it all. If the `xdot` or `dot` command is available, +it is used to display the file to your screen. This command only connects to hosts that the host it's run on can directly connect to. It does not try to tunnel through intermediate hosts. @@ -37,7 +37,7 @@ on that host. * `--fast` - Disable using `dot` to display the generated Graphviz file. + Don't display the generated Graphviz file, but save it for later use. # SEE ALSO