Avoid error about git-annex-shell not being found when syncing with -J with a git remote where git-annex-shell is not installed.
This commit was sponsored by andrea rota.
This commit is contained in:
parent
954a24b5d1
commit
e23839acf3
3 changed files with 41 additions and 5 deletions
16
Annex/Ssh.hs
16
Annex/Ssh.hs
|
@ -193,8 +193,10 @@ prepSocket socketfile gc sshparams = do
|
||||||
|
|
||||||
c <- Annex.getState Annex.concurrency
|
c <- Annex.getState Annex.concurrency
|
||||||
case c of
|
case c of
|
||||||
Concurrent {} -> makeconnection socketlock
|
Concurrent {}
|
||||||
NonConcurrent -> return ()
|
| annexUUID (remoteGitConfig gc) /= NoUUID ->
|
||||||
|
makeconnection socketlock
|
||||||
|
_ -> return ()
|
||||||
|
|
||||||
lockFileCached socketlock
|
lockFileCached socketlock
|
||||||
where
|
where
|
||||||
|
@ -207,11 +209,15 @@ prepSocket socketfile gc sshparams = do
|
||||||
-- When we can start the connection in batch mode,
|
-- When we can start the connection in batch mode,
|
||||||
-- ssh won't prompt to the console.
|
-- ssh won't prompt to the console.
|
||||||
(_, connected) <- liftIO $ processTranscript "ssh"
|
(_, connected) <- liftIO $ processTranscript "ssh"
|
||||||
(["-o", "BatchMode=true"] ++ toCommand startps)
|
(["-o", "BatchMode=true"]
|
||||||
|
++ toCommand startps)
|
||||||
Nothing
|
Nothing
|
||||||
unless connected $
|
unless connected $ do
|
||||||
prompt $ void $ liftIO $
|
ok <- prompt $ liftIO $
|
||||||
boolSystem "ssh" startps
|
boolSystem "ssh" startps
|
||||||
|
unless ok $
|
||||||
|
warning $ "Unable to run git-annex-shell on remote " ++
|
||||||
|
Git.repoDescribe (gitConfigRepo (remoteGitConfig gc))
|
||||||
|
|
||||||
-- Parameters to get ssh connected to the remote host,
|
-- Parameters to get ssh connected to the remote host,
|
||||||
-- by asking it to run a no-op command.
|
-- by asking it to run a no-op command.
|
||||||
|
|
|
@ -16,6 +16,9 @@ git-annex (6.20170520) UNRELEASED; urgency=medium
|
||||||
disable the usual automatic merge conflict resolution done by git-annex
|
disable the usual automatic merge conflict resolution done by git-annex
|
||||||
sync and the assistant.
|
sync and the assistant.
|
||||||
* sync: Added --no-resolvemerge option.
|
* sync: Added --no-resolvemerge option.
|
||||||
|
* Avoid error about git-annex-shell not being found when
|
||||||
|
syncing with -J with a git remote where git-annex-shell is not
|
||||||
|
installed.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Wed, 24 May 2017 14:03:40 -0400
|
-- Joey Hess <id@joeyh.name> Wed, 24 May 2017 14:03:40 -0400
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
[[!comment format=mdwn
|
||||||
|
username="joey"
|
||||||
|
subject="""comment 1"""
|
||||||
|
date="2017-06-06T16:21:53Z"
|
||||||
|
content="""
|
||||||
|
One of the remotes of your repository is on a host
|
||||||
|
where git-annex-shell is either not installed, or perhaps
|
||||||
|
it is installed but `ssh thehost git-annex-shell` does not
|
||||||
|
work -- eg due to the problem decribed in
|
||||||
|
[[tips/get_git-annex-shell_into_PATH]].
|
||||||
|
|
||||||
|
There was indeed a change in 6.20170519 that explains why this
|
||||||
|
only happens in -J mode. [[!commit 6992fe133b37ec6d64498f3dd2c69613c4c37469]]
|
||||||
|
made it run git-annex-shell at startup in that mode.
|
||||||
|
|
||||||
|
Hmm, I suppose one of your remotes could intentionally not have
|
||||||
|
git-annex-shell on it, and yet you'd still want `git annex sync`
|
||||||
|
to work to it, and so this message about git-annex-shell
|
||||||
|
being displayed is not ideal.
|
||||||
|
|
||||||
|
So, I've made it skip trying to run git-annex-shell in this case unless
|
||||||
|
the remote has an annex-uuid set. If the remote has never had
|
||||||
|
git-annex-shell installed, it can't have an annex-uuid set.
|
||||||
|
|
||||||
|
And, when it does fail to run git-annex-shell, I've made it say which
|
||||||
|
remote it was unable to run it on.
|
||||||
|
"""]]
|
Loading…
Reference in a new issue