git-annex/Remote
Joey Hess dafafad115
external: nice error message for keys with spaces in their name
External special remotes will refuse to operate on keys with spaces in
their names. That has never worked correctly due to the design of the
external special remote protocol. Display an error message suggesting
migration.

Not super happy with this, but it's a pragmatic solution. Better than
complicating the external special remote interface and all external special
remotes.

Note that I only made it use SafeKey in Request, not Response. git-annex
does not construct a Response, so that would not add any safety. And
presumably, if git-annex avoids feeding any such keys to an external
special remote, it will never have a reason to make a Response using such a
key. If it did, it would result in a protocol error anyway.

There's still a Serializeable instance for Key; it's used by P2P.Protocol.
There, the Key is always in the final position, so it's ok if it contains
spaces.

Note that the protocol documentation has been fixed to say that the File
may contain spaces. One way that can happen, even though the Key can't,
is when using direct mode, and the work tree filename contains spaces.
When sending such a file to the external special remote the worktree
filename is used.

This commit was sponsored by Thom May on Patreon.
2017-08-17 16:18:34 -04:00
..
Directory remove 163 lines of code without changing anything except imports 2016-01-20 16:36:33 -04:00
External external: nice error message for keys with spaces in their name 2017-08-17 16:18:34 -04:00
Helper adeiu, MissingH 2017-05-16 01:03:52 -04:00
Rsync adeiu, MissingH 2017-05-16 01:03:52 -04:00
WebDAV adeiu, MissingH 2017-05-16 01:03:52 -04:00
BitTorrent.hs Some optimisations to string splitting code. 2017-01-31 19:06:22 -04:00
Bup.hs Support GIT_SSH and GIT_SSH_COMMAND 2017-03-17 16:20:37 -04:00
Ddar.hs Support GIT_SSH and GIT_SSH_COMMAND 2017-03-17 16:20:37 -04:00
Directory.hs add SetupStage parameter to RemoteType.setup 2017-02-07 14:55:58 -04:00
External.hs external: nice error message for keys with spaces in their name 2017-08-17 16:18:34 -04:00
GCrypt.hs add annex-ignore-command and annex-sync-command configs 2017-08-17 13:54:14 -04:00
Git.hs add annex-ignore-command and annex-sync-command configs 2017-08-17 13:54:14 -04:00
Glacier.hs add SetupStage parameter to RemoteType.setup 2017-02-07 14:55:58 -04:00
Hook.hs add SetupStage parameter to RemoteType.setup 2017-02-07 14:55:58 -04:00
List.hs stub Remote.P2P 2016-12-06 12:27:58 -04:00
P2P.hs de-Maybe remoteGitConfig 2017-05-11 16:05:01 -04:00
Rsync.hs Support GIT_SSH and GIT_SSH_COMMAND 2017-03-17 16:20:37 -04:00
S3.hs fix build with old http-client versions 2017-08-17 11:00:48 -04:00
Tahoe.hs add SetupStage parameter to RemoteType.setup 2017-02-07 14:55:58 -04:00
Web.hs Avoid backtraces on expected failures when built with ghc 8; only use backtraces for unexpected errors. 2016-11-15 21:29:54 -04:00
WebDAV.hs add SetupStage parameter to RemoteType.setup 2017-02-07 14:55:58 -04:00