From 2b55a2b8820679343bd3d029cf32493be6447644 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 30 Sep 2019 14:40:46 -0400 Subject: [PATCH] remotedaemon: Don't list --stop in help since it's not supported. Also, move out of plumbing section. When using tor, the remotedaemon is part of the user's workflow, as it runs the tor hidden service. --- CHANGELOG | 1 + CmdLine/GitAnnex/Options.hs | 12 ++++++++---- Command/Assistant.hs | 2 +- Command/RemoteDaemon.hs | 4 ++-- Command/Watch.hs | 2 +- doc/bugs/remotedaemon_--stop_doesn__39__t_work.mdwn | 2 ++ ...ment_1_db0406f22cc140f9726bc9988d567c77._comment | 9 +++++++++ doc/git-annex-remotedaemon.mdwn | 13 ++++--------- doc/git-annex.mdwn | 12 ++++++------ .../wishlist__58___disable_automatic_commits.mdwn | 3 ++- 10 files changed, 36 insertions(+), 24 deletions(-) create mode 100644 doc/bugs/remotedaemon_--stop_doesn__39__t_work/comment_1_db0406f22cc140f9726bc9988d567c77._comment diff --git a/CHANGELOG b/CHANGELOG index ea922810fd..3a5a93214c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,7 @@ git-annex (7.20190913) UNRELEASED; urgency=medium * Test: Use more robust directory removal when built with directory-1.2.7. * Close sqlite databases more robustly. * adjust --lock: This enters an adjusted branch where files are locked. + * remotedaemon: Don't list --stop in help since it's not supported. -- Joey Hess Thu, 19 Sep 2019 11:11:19 -0400 diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs index a54031c0c8..ae66588d00 100644 --- a/CmdLine/GitAnnex/Options.hs +++ b/CmdLine/GitAnnex/Options.hs @@ -407,16 +407,20 @@ data DaemonOptions = DaemonOptions , stopDaemonOption :: Bool } -parseDaemonOptions :: Parser DaemonOptions -parseDaemonOptions = DaemonOptions - <$> switch +parseDaemonOptions :: Bool -> Parser DaemonOptions +parseDaemonOptions canstop + | canstop = DaemonOptions <$> foreground <*> stop + | otherwise = DaemonOptions <$> foreground <*> pure False + where + foreground = switch ( long "foreground" <> help "do not daemonize" ) - <*> switch + stop = switch ( long "stop" <> help "stop daemon" ) + completeRemotes :: HasCompleter f => Mod f a completeRemotes = completer $ mkCompleter $ \input -> do r <- maybe (pure Nothing) (Just <$$> Git.Config.read) diff --git a/Command/Assistant.hs b/Command/Assistant.hs index 21ef8a242d..9377357f2b 100644 --- a/Command/Assistant.hs +++ b/Command/Assistant.hs @@ -34,7 +34,7 @@ data AssistantOptions = AssistantOptions optParser :: CmdParamsDesc -> Parser AssistantOptions optParser _ = AssistantOptions - <$> parseDaemonOptions + <$> parseDaemonOptions True <*> switch ( long "autostart" <> help "start in known repositories" diff --git a/Command/RemoteDaemon.hs b/Command/RemoteDaemon.hs index 95fefff4d0..9f3901b12e 100644 --- a/Command/RemoteDaemon.hs +++ b/Command/RemoteDaemon.hs @@ -15,9 +15,9 @@ import Utility.Daemon cmd :: Command cmd = noCommit $ - command "remotedaemon" SectionMaintenance + command "remotedaemon" SectionCommon "persistent communication with remotes" - paramNothing (run <$$> const parseDaemonOptions) + paramNothing (run <$$> const (parseDaemonOptions False)) run :: DaemonOptions -> CommandSeek run o diff --git a/Command/Watch.hs b/Command/Watch.hs index 9cd1e6d0cd..7a613ad460 100644 --- a/Command/Watch.hs +++ b/Command/Watch.hs @@ -15,7 +15,7 @@ cmd :: Command cmd = notBareRepo $ command "watch" SectionCommon "watch for changes and autocommit" - paramNothing (seek <$$> const parseDaemonOptions) + paramNothing (seek <$$> const (parseDaemonOptions True)) seek :: DaemonOptions -> CommandSeek seek o = commandAction $ start False o Nothing diff --git a/doc/bugs/remotedaemon_--stop_doesn__39__t_work.mdwn b/doc/bugs/remotedaemon_--stop_doesn__39__t_work.mdwn index 1c857b31c6..90e137a9bd 100644 --- a/doc/bugs/remotedaemon_--stop_doesn__39__t_work.mdwn +++ b/doc/bugs/remotedaemon_--stop_doesn__39__t_work.mdwn @@ -22,3 +22,5 @@ Just `kill`ing it seems to do the job, however :-) ### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders) Yes for many years, just finally getting round to exploring the more advanced features :-) + +> [[fixed|done]] --[[Joey]] diff --git a/doc/bugs/remotedaemon_--stop_doesn__39__t_work/comment_1_db0406f22cc140f9726bc9988d567c77._comment b/doc/bugs/remotedaemon_--stop_doesn__39__t_work/comment_1_db0406f22cc140f9726bc9988d567c77._comment new file mode 100644 index 0000000000..bf2cd05946 --- /dev/null +++ b/doc/bugs/remotedaemon_--stop_doesn__39__t_work/comment_1_db0406f22cc140f9726bc9988d567c77._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2019-09-30T18:31:55Z" + content=""" +It's fine to just kill it. It doesn't write a pid file and so --stop +can't work, and my inclination is that there's no point in complicating it +with that. I've removed the --stop option. +"""]] diff --git a/doc/git-annex-remotedaemon.mdwn b/doc/git-annex-remotedaemon.mdwn index 609698e973..f5df943fae 100644 --- a/doc/git-annex-remotedaemon.mdwn +++ b/doc/git-annex-remotedaemon.mdwn @@ -9,20 +9,15 @@ git annex remotedaemon # DESCRIPTION The remotedaemon provides persistent communication with remotes. -It detects when git branches on remotes have changes, and fetches -the changes from them. - -The assistant runs the remotedaemon and communicates with it on -stdio using a simple textual protocol. Several types of remotes are supported: For ssh remotes, the remotedaemon tries to maintain a connection to the remote git repository, and uses git-annex-shell notifychanges to detect -when the remote git repository has changed. For this to work, the git -remote must have [[git-annex-shell]](1) installed, with notifychanges -support. The first version of git-annex-shell that supports it is -5.20140405. +when the remote git repository has changed, and fetches changes from it. +For this to work, the git remote must have [[git-annex-shell]](1) +installed, with notifychanges support. The first version of git-annex-shell +that supports it is 5.20140405. For tor-annex remotes, the remotedaemon runs a tor hidden service, accepting connections from other nodes and serving up the contents of the diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index ed9108966d..bea502faed 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -197,6 +197,12 @@ subdirectories). See [[git-annex-webapp]](1) for details. +* `remotedaemon` + + Persistant communication with remotes. + + See [[git-annex-remotedaemon]](1) for details. + # REPOSITORY SETUP COMMANDS * `init [description]` @@ -687,12 +693,6 @@ subdirectories). See [[git-annex-smudge]](1) for details. -* `remotedaemon` - - Detects when network remotes have received git pushes and fetches from them. - - See [[git-annex-remotedaemon]](1) for details. - * `findref [ref]` Lists files in a git ref. (deprecated) diff --git a/doc/todo/wishlist__58___disable_automatic_commits.mdwn b/doc/todo/wishlist__58___disable_automatic_commits.mdwn index 03ed40211a..ae8d6b72f5 100644 --- a/doc/todo/wishlist__58___disable_automatic_commits.mdwn +++ b/doc/todo/wishlist__58___disable_automatic_commits.mdwn @@ -33,4 +33,5 @@ detecting manual commits wouldn't be a stretch. > You can do this now by pausing committing via the webapp, > or setting `annex.autocommit=false`. > -> The assistant probably doesn't push such commits yet. +> When configured this way, the assistant doesn't push commits +> that you manually make, of course you can also manually push. --[[Joey]]