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, 23:03 UTC
Message-ID
<loom.20140215T000328-538@post.gmane.org>
In-Reply-To
<xmqq38jlk6a1.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster <at> pobox.com> writes:
Show 5 quoted lines
> 
> I very well understand that.  All other commands that support "-z"
> to give you NUL terminated output do not consider that a downside.
> Why should for-each-ref be special?
> 

After I discovered log also has this there is nothing special about for-each-ref any longer, so my patch as-is would only make things less consistent. What is "special" is that they give you the option of supplying a format string.

ls-files, diff and others print a specific list of items (paths, shas, ...) and there's no question about how they are presented other than the delimiter between each item, to which a selection of either a newline or a null byte is plenty.

With log, for-each-ref and rev-list (any others?) that sort of breaks down. With the format string you're given the power to make the command print basically anything you like, however you like; no longer only a question of mere delimiters. It only makes sense then (to me, at least) that the command does not meddle with the format the user has chosen.

Maybe it's all subjective... I'm okay with just leaving things as they are. There are ways around it.

Previous: Junio C HamanoNext: Junio C Hamano
Message 6 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.