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
Eric Sunshine <sunshine@sunshineco.com>
Date
Jul 9, 2022, 00:58 UTC
Message-ID
<CAPig+cTX76ZMG_S-qOX_JDxYVWXRvtP2Ref4k8uM1KJaDwX9=w@mail.gmail.com>
In-Reply-To
<pull.1281.v2.git.1657279447515.gitgitgadget@gmail.com>

On Fri, Jul 8, 2022 at 7:28 AM Jaydeep Das via GitGitGadget <gitgitgadget@gmail.com> wrote:

> Add new helper function `gpg_trust_level_to_str()` which will
> convert a given member of `enum signature_trust_level` to its
> corresponding string(in lowercase). For example, `TRUST_ULTIMATE`
s/g(/g (/
Show 15 quoted lines
> will yield the string "ultimate".
>
> This will abstract out some code in `pretty.c` relating to gpg
> signature trust levels.
>
> Signed-off-by: Jaydeep Das <jaydeepjd.8914@gmail.com>
> ---
> diff --git a/gpg-interface.h b/gpg-interface.h
> @@ -71,6 +71,14 @@ size_t parse_signed_buffer(const char *buf, size_t size);
> +/*
> + * Returns corresponding string in lowercase for a given member of
> + * enum signature_trust_level. For example, `TRUST_ULTIMATE` will
> + * return "ultimate".
> + */
> +char *gpg_trust_level_to_str(enum signature_trust_level level);

It would be a good idea to update the function documentation to mention that the caller is responsible for freeing the returned string.

Previous: Jaydeep Das via GitGitGadgetNext: jaydeepjd.8914@gmail.com
Message 4 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.