git style filename quoting controlled by core.quotePath
authorJoey Hess <joeyh@joeyh.name>
Sat, 8 Apr 2023 18:20:02 +0000 (14:20 -0400)
committerJoey Hess <joeyh@joeyh.name>
Sat, 8 Apr 2023 18:52:26 +0000 (14:52 -0400)
commitd689a5b338c781a9994ee96e3d0511d303fa9a27
tree3bd5738fc66ecdca20e2227702784ba74aec828f
parent81bc57322f3450a172ec4bae9de3643b6f8bc8d8
git style filename quoting controlled by core.quotePath

This is by no means complete, but escaping filenames in actionItemDesc does
cover most commands.

Note that for ActionItemBranchFilePath, the value is branch:file, and I
choose to only quote the file part (if necessary). I considered quoting the
whole thing. But, branch names cannot contain control characters, and while
they can contain unicode, git coes not quote unicode when displaying branch
names. So, it would be surprising for git-annex to quote unicode in a
branch name.

The find command is the most obvious command that still needs to be
dealt with. There are probably other places that filenames also get
displayed, eg embedded in error messages.

Some other commands use ActionItemOther with a filename, I think that
ActionItemOther should either be pre-sanitized, or should explicitly not
be used for filenames, so that needs more work.

When --json is used, unicode does not get escaped, but control
characters were already escaped in json.

(Key escaping may turn out to be needed, but I'm ignoring that for now.)

Sponsored-by: unqueued on Patreon
Assistant/Threads/TransferWatcher.hs
Assistant/TransferQueue.hs
Assistant/TransferSlots.hs
CHANGELOG
Command/Fsck.hs
Command/Info.hs
Git/FilePath.hs
Logs/Transfer.hs
Messages.hs
Types/ActionItem.hs
Types/GitConfig.hs