git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

Previous: Junio C HamanoNext: Jeff King
Message 9 of 11 in “[regression] Re: git-cat-file --batch reversion; cannot query filenames with spaces”
  1. Jonathan NiederAug 2, 2013
  2. Jeff KingAug 2, 2013
  3. Jeff KingAug 2, 2013
  4. Joey HessAug 2, 2013
  5. Brandon CaseyAug 2, 2013
  6. Junio C HamanoAug 2, 2013
  7. Jeff KingAug 2, 2013
  8. Junio C HamanoAug 2, 2013
  9. Jonathan NiederAug 2, 2013
  10. Jeff KingAug 3, 2013
  11. Junio C HamanoAug 2, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.