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

Re: [PATCH v2] gpg-interface: add function for converting trust level to string

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 10, 2022, 05:48 UTC
Message-ID
<xmqqilo5sel6.fsf@gitster.g>
In-Reply-To
<CAPig+cScKabgrh80e5rqWX8cnNEgvxP9JyVJCu+afBOJk_yopg@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 16 quoted lines
> Given the small, fixed number of trust levels, and if the list is
> unlikely to change much in the future, I might suggest simply
> initializing the fields at compile-time rather than on-demand at
> run-time:
>
>     static struct {
>         const char *key;
>         const char *display_key;
>         enum signature_trust_level value;
>     } sigcheck_gpg_trust_level[] = {
>         { "UNDEFINED", "undefined", TRUST_UNDEFINED },
>         { "NEVER", "never", TRUST_NEVER },
>         { "MARGINAL", "marginal", TRUST_MARGINAL },
>         { "FULLY", "fully", TRUST_FULLY },
>         { "ULTIMATE", "ultimate", TRUST_ULTIMATE },
>     };

Yup, that is even better. I wonder if we can upcase in C preprocessor macro? It would be wonderful if we can do so, but for just 5 entries, we can type each token three times just fine.

Previous: Eric SunshineNext: Eric Sunshine
Message 8 of 13 in “gpg-interface: add function for converting trust level to string”
  1. gpg-interface: add function for converting trust level to stringJaydeep Das via GitGitGadget, Jul 7, 2022
  2. Junio C HamanoJul 7, 2022
  3. gpg-interface: add function for converting trust level to stringJaydeep Das via GitGitGadget, Jul 8, 2022
  4. Eric SunshineJul 9, 2022
  5. jaydeepjd.8914@gmail.comJul 9, 2022
  6. Junio C HamanoJul 9, 2022
  7. Eric SunshineJul 10, 2022
  8. Junio C HamanoJul 10, 2022
  9. Eric SunshineJul 10, 2022
  10. Jaydeep DasJul 11, 2022
  11. gpg-interface: add function for converting trust level to stringJaydeep Das via GitGitGadget, Jul 9, 2022
  12. gpg-interface: add function for converting trust level to stringJaydeep Das via GitGitGadget, Jul 11, 2022
  13. Junio C HamanoJul 11, 2022

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.