Skip to content

handle spaces in filenames in file-list #10

@GochoMugo

Description

@GochoMugo

A filename with a space within, for example "spaced filename.txt" (contains a tab character in the filename),
and a hash digest, for example, "12345", would be recorded in the
file-list as:

spaced    filename.txt    12345

The current parser would determine that the <filename> is "spaced"
and the <sha> is "filename.txt". While this would not halt the
process, it would make the diffs-generation assume that the file has
been changed, which is incorrect.

We need to fix this bug:

Approach A:

An approach would be to quote the filename in the file-list. For example,

"spaced    filename.txt"    12345

But how to handle the " character in the filename? For example,

"comma\\"filename.txt"    12345

Approach B:

We could change the format, from <filename> <hash> to <hash> <filename>.
This is quite easier to implement. We are sure the <hash> can not contain
a space/tab character.

How to handle new input, with embedded space characters, being added to the
format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions