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

Re: [PATCH] pretty: add %r format specifier for showing refs

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jul 12, 2023, 16:56 UTC
Message-ID
<CAPig+cT3tWnSfk+ZoRWU=JTGctMiE38fH5V1ebpP7L1bGsfU4Q@mail.gmail.com>
In-Reply-To
<20230712110732.8274-1-andy.koppe@gmail.com>
Not a proper review... just running my eye quickly over the patch...
On Wed, Jul 12, 2023 at 7:17 AM Andy Koppe <andy.koppe@gmail.com> wrote:
Show 16 quoted lines
> This lists refs similarly to the %D decoration format, but separates
> the refs with spaces only and omits "tag:" annotations. It's intended
> primarily for color output, where tags are already distinguished by
> color.
>
> Refactor format_decorations() to take an enum decoration_format argument
> that determines the prefix, separator and suffix as well as the tag
> annotation.
>
> For %d and %D, wrap the "tag:" annotation and the actual tag in separate
> color controls, because otherwise the tag ends up uncolored when %w
> width formatting breaks a line between the annotation and tag.
>
> Amend t4207-log-decoration-colors.sh to reflect the added color
> controls, and t4202-log.sh to test the %r format.
> ---
Missing sign-off.
Show 7 quoted lines
> diff --git a/log-tree.h b/log-tree.h
> @@ -13,17 +13,18 @@ struct decoration_filter {
> +enum decoration_format {
> +  DECO_FMT_BARE = 0,
> +  DECO_FMT_UNWRAPPED,
> +  DECO_FMT_WRAPPED,
> +};
Indent with TAB, not spaces.

Is this enum name a bit too generic for a public header? A quick scan of other enums in the project shows that they usually incorporate the "subsystem" into their names somehow (often as a prefix); for instance, "enum apply_ws_ignore", "enum bisect_error".

Previous: Andy KoppeNext: Junio C Hamano
Message 2 of 5 in “pretty: add %r format specifier for showing refs”
  1. pretty: add %r format specifier for showing refsAndy Koppe, Jul 12, 2023
  2. Eric SunshineJul 12, 2023
  3. Junio C HamanoJul 12, 2023
  4. Andy KoppeJul 12, 2023
  5. pretty: add %r format specifier for showing refsAndy Koppe, Jul 12, 2023

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.