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

Re: [PATCH] for-each-ref: add option to omit newlines

From
Øystein Walle <oystwa@gmail.com>
Date
Feb 14, 2014, 08:11 UTC
Message-ID
<loom.20140214T085928-630@post.gmane.org>
In-Reply-To
<xmqq38jmlqo6.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster <at> pobox.com> writes:
Show 5 quoted lines
> 
> I would rather see us go in the direction to add "-z" output option,
> which is what everybody else that produces NUL terminated entries in
> our suite of subcommands does.
> 

I agree that -z would help in this case and I very much appreciate that option when using diff --name-only, ls-files, etc.

However, when specifying a format string it's just a matter of ending the format string in '%00' and you're good to go. But then you get the null byte *and* a newline. And with your proposal there would be no way of saying you want neither.

I expected the output to be formatted according to a (repetition of) the format string, not some variation of it that I couldn't opt out of. But I see that git-log also shows this behavior and already has a -z option, so I guess that's fairly ingrained.

Maybe it's just me? In that case I've no problem with throwing in the towel.

Øsse
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 7 in “for-each-ref: add option to omit newlines”
  1. for-each-ref: add option to omit newlinesØystein Walle, Feb 13, 2014
  2. Øystein WalleFeb 13, 2014
  3. Junio C HamanoFeb 13, 2014
  4. Øystein WalleFeb 14, 2014
  5. Junio C HamanoFeb 14, 2014
  6. Øystein WalleFeb 14, 2014
  7. Junio C HamanoFeb 14, 2014

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.