From a22eaaae27339346ca50422aafdae3829b2609eb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 9 Feb 2015 14:16:42 -0400 Subject: [PATCH] comment --- Assistant.hs | 1 + Remote/Git.hs | 2 +- ..._cc3ea43301cd17b55794f9b9dd1e91cf._comment | 27 +++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 doc/bugs/git_annex_wont_work_with_git-dir_and_work-tree/comment_1_cc3ea43301cd17b55794f9b9dd1e91cf._comment diff --git a/Assistant.hs b/Assistant.hs index e49924928c..eb01bb9b97 100644 --- a/Assistant.hs +++ b/Assistant.hs @@ -73,6 +73,7 @@ stopDaemon = liftIO . Utility.Daemon.stopDaemon =<< fromRepo gitAnnexPidFile - stdout and stderr descriptors. -} startDaemon :: Bool -> Bool -> Maybe Duration -> Maybe String -> Maybe HostName -> Maybe (Maybe Handle -> Maybe Handle -> String -> FilePath -> IO ()) -> Annex () startDaemon assistant foreground startdelay cannotrun listenhost startbrowser = do + Annex.changeState $ \s -> s { Annex.daemon = True } pidfile <- fromRepo gitAnnexPidFile logfile <- fromRepo gitAnnexLogFile diff --git a/Remote/Git.hs b/Remote/Git.hs index 328e391110..01fc0d6636 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -506,7 +506,7 @@ fsckOnRemote r params [ ("GIT_WORK_TREE", Git.repoPath r') , ("GIT_DIR", Git.localGitDir r') ] environ - batchCommandEnv program (Param "fsck" : params) $ Just environ' + batchCommandEnv program (Param "fsck" : params) (Just environ') {- The passed repair action is run in the Annex monad of the remote. -} repairRemote :: Git.Repo -> Annex Bool -> Annex (IO Bool) diff --git a/doc/bugs/git_annex_wont_work_with_git-dir_and_work-tree/comment_1_cc3ea43301cd17b55794f9b9dd1e91cf._comment b/doc/bugs/git_annex_wont_work_with_git-dir_and_work-tree/comment_1_cc3ea43301cd17b55794f9b9dd1e91cf._comment new file mode 100644 index 0000000000..2e76dda05b --- /dev/null +++ b/doc/bugs/git_annex_wont_work_with_git-dir_and_work-tree/comment_1_cc3ea43301cd17b55794f9b9dd1e91cf._comment @@ -0,0 +1,27 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2015-02-09T17:54:00Z" + content=""" +I've confirmed this behavior. Normally git-annex propigates --git-dir +to git commands it runs, but this is not done in a few cases in the +assistant, including when it starts `git-annex remotedaemon` but also +`git-annex fsck`, `git annex unused`, and `git annex transferkeys`. + +(Just search for readProgramFile; Remote.Git.fsckOnRemote is the only +place outside the assistant that uses it, and it does take care to +propigate --git-dir and --work-tree.) + +Also, restarting the assistant, either in the web ui or automatically due to +an upgrade also doesn't propigate --git-dir. + +And, the assistant's autostart file doesn't support --git-dir. + +All of which could be fixed, but I have to wonder, why? What's the use case +for a separate --git-dir with the assistant? I guess not vcsh because the +assistant would watch for all changes to the home directory, and add them, +and that's not how vcsh is used. + +I'm tempted to just make the assistant refuse to start when given a +nonstandard --git-dir.. +"""]]