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

Re: [PATCH] builtin/config.c: don't print a newline with --color

From
Taylor Blau <me@ttaylorr.com>
Date
Mar 6, 2019, 23:42 UTC
Message-ID
<20190306234236.GE27082@Taylors-MBP.hsd1.wa.comcast.net>
In-Reply-To
<xmqqva0xvp6b.fsf@gitster-ct.c.googlers.com>
On Tue, Mar 05, 2019 at 02:57:32PM +0900, Junio C Hamano wrote:
Show 8 quoted lines
> Yup, that would be a very sensible first step, regardless of what
> the next step is.
>
> After that, choices are
>
>  (1) we'd introduce new inconsistency among --type=<type> by
>      matching what --type=color does to what --get-color does, to
>      allow us to revert that documentation update, or

I suppose... though I think that if others agree, I'd rather update the documentation instead of introduce some inconsistency.

Yes, there's an argument to be made that if we're encouraging users to go from '--get-color' -> '--type=color', that the two should behave the same, but I don't think the cost we pay for behavioral equivalence between the two is worth inconsistency among '--type=color' and all the rest.

>  (2) we'd drop LF from all --type=<type>, that makes everything
>      consistent and risk breaking a few existing scripts while doing
>      so, and get yelled at by end users, or

As you indicate, I think that this option is one we should _not_ do. In the interpolation example you shared earlier in the thread, script writers most likely want and expect a trailing LF after each invocation of 'git config'.

I'd argue that this case is more common than not wanting a LF when interpolating with `--type=color`, so I agree it seems the tradeoff here is not a good one.

>  (3) we stop at this documentation update and do nothing else.

To restate my response to (1), I think that the documentation update in isolation makes the most sense here. I, too, was surprised in the same way that Peff was when we stumbled upon this, but I think that ultimately the consistency is most favorable.

Thanks all for your discussion and feedback.

Thanks, Taylor

Previous: Junio C HamanoNext: Junio C Hamano
Message 13 of 18 in “builtin/config.c: don't print a newline with --color”
  1. builtin/config.c: don't print a newline with --colorTaylor Blau, Mar 2, 2019
  2. Eric SunshineMar 2, 2019
  3. Johannes SchindelinMar 2, 2019
  4. Jeff KingMar 3, 2019
  5. Johannes SchindelinMar 5, 2019
  6. Taylor BlauMar 6, 2019
  7. Junio C HamanoMar 3, 2019
  8. Jeff KingMar 3, 2019
  9. Junio C HamanoMar 4, 2019
  10. Junio C HamanoMar 4, 2019
  11. Jeff KingMar 5, 2019
  12. Junio C HamanoMar 5, 2019
  13. Taylor BlauMar 6, 2019
  14. Junio C HamanoMar 7, 2019
  15. Jeff KingMar 7, 2019
  16. Documentation/config: note trailing newline with --type=colorTaylor Blau, Mar 6, 2019
  17. Jeff KingMar 7, 2019
  18. Junio C HamanoMar 7, 2019

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.