diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-08-17 16:08:35 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-08-17 16:18:34 -0400 |
commit | e50372f632de988bbe48173081ba0367d7790193 (patch) | |
tree | efb793295959a8a82fe5b3d600dc17d795b85971 /doc/bugs/external_special_remote_protocol_broken_by_key_with_spaces.mdwn | |
parent | 186832323027f71ebf4a2691b4ace0f182585474 (diff) |
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.
Diffstat (limited to 'doc/bugs/external_special_remote_protocol_broken_by_key_with_spaces.mdwn')
-rw-r--r-- | doc/bugs/external_special_remote_protocol_broken_by_key_with_spaces.mdwn | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/bugs/external_special_remote_protocol_broken_by_key_with_spaces.mdwn b/doc/bugs/external_special_remote_protocol_broken_by_key_with_spaces.mdwn index a5e45b108..4180678c9 100644 --- a/doc/bugs/external_special_remote_protocol_broken_by_key_with_spaces.mdwn +++ b/doc/bugs/external_special_remote_protocol_broken_by_key_with_spaces.mdwn @@ -3,3 +3,14 @@ external special remote protocol, which uses whitespace to separate the key parameter from subsequent parameters. I think that this only causes problems for WORM keys. --[[Joey]] + +> Ok, went with my last approach, rather than complicating all special +> remotes due to this problem, we'll deprecate WORM keys with spaces in +> their name, and provide a migratipon path. +> +> The error message looks like this: + +> > Sorry, this file cannot be stored on an external special remote because its key's name contains a space. To avoid this problem, you can run: git-annex migrate --backend=WORM + +> This is fixed as well as is feasible, so while that kind of sucks, +> calling it [[done]]. --[[Joey]] |