Matheus Tavares Bernardino <matheus.bernardino@xxxxxx> writes: > Note that, differently from other Git commands, "-z" doesn't affect > quoting/escaping in git-grep. For example, while git-ls-files' man > page says: > > -z > \0 line termination on output **and do not quote filenames**. > > The git-grep one only says: > > -z, --null > Output \0 instead of the character that normally follows a file name. > > Indeed, this inconsistency might be a little confusing. The reason for > it may be ... Let me lift the need for speculation ;-) It was a simple oversight when the documentation was writte, and those "add relative with quoting" were bugs that not many people thought of testing with -z output mode. It is unfortunate, but it happens that things fall into cracks without anybody noticing X-<. The reason why we quote paths in output from various commands without -z is to make them machine parseable; there is no reason to quote if \0 delimiting is used as no paths contain NUL byte in it. > 1. Make git-grep more consistent with other Git commands by always > quoting/escaping unusual pathnames (relative or not), unless "-z" is > given or core.quotePath is set to "false". This is the only sensible way forward, I would think.