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

Re: Two bugs in --pretty with %C(auto)

From
René Scharfe <l.s.r@web.de>
Date
Sep 18, 2016, 13:21 UTC
Message-ID
<bddd85de-76d1-fbd1-06f5-4ced57879f2c@web.de>
In-Reply-To
<CACNzp2mkD7Se9R=SVwXhyRstkGAs1N9YbNgaZRQYKkpPM1kj8A@mail.gmail.com>
Am 18.09.2016 um 14:30 schrieb Anatoly Borodin:
Show 5 quoted lines
> On Sat, Sep 17, 2016 at 8:25 PM, René Scharfe <l.s.r@web.de> wrote:
>> I'm not sure how just how automatic %C(auto) is supposed to be, but you
>> expected it do emit the reset for you, right?  Sounds reasonable to me.
>
> I don't see a good reason not to do so. Spare some bytes?..

The states for colors and attributes are separate; that's how the bold attribute bled into your the auto-colored parts of your output. You could use that property to specify e.g. "give me automatic coloring, but reverse it".

This only works by accident now, I think. Full resets are emitted after many placeholders, so attributes don't reach very far in practice. We'd have to be more careful with these full resets if we'd want attributes to cover multiple placeholders. An automatic reset at the start of %C(auto) would go into the opposite direction.

René
Previous: Anatoly BorodinNext: Duy Nguyen
Message 4 of 7 in “Two bugs in --pretty with %C(auto)”
  1. Anatoly BorodinSep 17, 2016
  2. René ScharfeSep 17, 2016
  3. Anatoly BorodinSep 18, 2016
  4. René ScharfeSep 18, 2016
  5. Duy NguyenSep 19, 2016
  6. René ScharfeSep 29, 2016
  7. Anatoly BorodinOct 1, 2016

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.