Re: [regression] Re: git-cat-file --batch reversion; cannot query filenames with spaces
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Aug 2, 2013, 20:05 UTC
- Message-ID
- <20130802200529.GA2963@elie.Belkin>
- In-Reply-To
- <7vmwp0osic.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Here is what is on top of the revert that has been pushed out on > 'pu'.
For what it's worth, Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
[...]
> To remain backwards compatible, we cannot split on whitespace by > default, hence we will ship 1.8.4 with the commit reverted.
[...]
Show 5 quoted lines
> It might be more robust to have something like "-z" to separate the > input elements. But this patch is still a reasonable step before > having that. It makes the easy cases easy; people who do not care > about %(rest) do not have to consider it, and the %(rest) code > handles the spaces and newlines of "rev-list --objects" correctly.
Another idea for the future might be to start rejecting refnames starting with a double-quote '"', which would make it safe to treat a leading quote-mark as the start of a C-style quoted string. But currently that would technically be a breaking change, making "-z" more useful in the meantime.
I think several commands already don't deal well with filenames with newlines. I hope POSIX forbids them (with some suitable migration plan) soonish and even wouldn't mind if git were taught to refuse to track them.
Thanks, Jonathan