Support newlines in filenames.
Work around git cat-file --batch's protocol not supporting newlines by running git cat-file not batched and passing the filename as a parameter. Of course this is quite a lot less efficient, especially because it currently runs it multiple times to query for different pieces of information. Also, it has subtly different behavior when the batch process was started and then some changes were made, in which case the batch process sees the old index but this workaround sees the current index. Since that batch behavior is mostly a problem that affects the assistant and has to be worked around in it, I think I can get away with this difference. I don't know of any other problems with newlines in filenames, everything else in git I can think of supports -z. And git-annex's json output supports newlines in filenames so downstream parsers from git-annex will be ok. git-annex commands that use --batch themselves don't support newlines in input filenames; using --json --batch is currently a way around that problem. This commit was sponsored by Ewen McNeill on Patreon.
This commit is contained in:
parent
f22289e90f
commit
2aae6e84af
5 changed files with 88 additions and 15 deletions
|
@ -45,3 +45,6 @@ foo
|
|||
|
||||
[[!tag confirmed git-bug]]
|
||||
[[!title git limitations prevent using git-annex on filenames containing newlines]]
|
||||
|
||||
> [[fixed|done]] with a workaround that is less efficient at handling such
|
||||
> filenames, but does work at least as far as I've tested it. --[[Joey]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue