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

Re: [PATCH 2/6] gpg-interface: add GPG_VERIFY_QUIET flag

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 22, 2016, 20:44 UTC
Message-ID
<xmqqzimz3brm.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160922185317.349-3-santiago@nyu.edu>
santiago@nyu.edu writes:
> From: Lukas P <luk.puehringer@gmail.com>
Please match this with S-o-b: below.
Show 25 quoted lines
>
> Functions that print git object information may require that the
> gpg-interface functions be silent. Add a GPG_VERIFY_QUIET to prevent
> functions such as `print_signature_buffer` from printing any output and
> only return whether signature verification passed or not.
>
> Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
> ---
>  gpg-interface.c | 3 +++
>  gpg-interface.h | 1 +
>  2 files changed, 4 insertions(+)
>
> diff --git a/gpg-interface.c b/gpg-interface.c
> index 8672eda..b82bc50 100644
> --- a/gpg-interface.c
> +++ b/gpg-interface.c
> @@ -88,6 +88,9 @@ int check_signature(const char *payload, size_t plen, const char *signature,
>  
>  void print_signature_buffer(const struct signature_check *sigc, unsigned flags)
>  {
> +	if (flags & GPG_VERIFY_QUIET)
> +		return;
> +
>  	const char *output = flags & GPG_VERIFY_RAW ?
>  		sigc->gpg_status : sigc->gpg_output;

This has only two callsites, which both know what flags they are passing. Doesn't it make more sense to drop this patch (and possibly addition of GPG_VERIFY_QUIET flag as well) and teach them not to call this function in the first place?

Show 12 quoted lines
> diff --git a/gpg-interface.h b/gpg-interface.h
> index ea68885..85dc982 100644
> --- a/gpg-interface.h
> +++ b/gpg-interface.h
> @@ -3,6 +3,7 @@
>  
>  #define GPG_VERIFY_VERBOSE	1
>  #define GPG_VERIFY_RAW		2
> +#define GPG_VERIFY_QUIET	4
>  
>  struct signature_check {
>  	char *payload;
Previous: Junio C HamanoNext: santiago@nyu.edu
Message 9 of 19 in “Add --format to tag verification”
  1. 0/6 Add --format to tag verificationsantiago@nyu.edu, Sep 22, 2016
  2. 3/6 ref-filter: Expose wrappers for ref_item functionssantiago@nyu.edu, Sep 22, 2016
  3. Junio C HamanoSep 22, 2016
  4. 6/6 builtin/tag: add --format argument for tag -vsantiago@nyu.edu, Sep 22, 2016
  5. Junio C HamanoSep 22, 2016
  6. Santiago TorresSep 23, 2016
  7. 2/6 gpg-interface: add GPG_VERIFY_QUIET flagsantiago@nyu.edu, Sep 22, 2016
  8. Junio C HamanoSep 22, 2016
  9. Junio C HamanoSep 22, 2016
  10. 4/6 tag: add format specifier to gpg_verify_tagsantiago@nyu.edu, Sep 22, 2016
  11. Junio C HamanoSep 22, 2016
  12. Santiago TorresSep 23, 2016
  13. 1/6 builtin/tag: move format specifier to global varsantiago@nyu.edu, Sep 22, 2016
  14. Junio C HamanoSep 22, 2016
  15. 5/6 builtin/verify-tag: Add --format to verify-tagsantiago@nyu.edu, Sep 22, 2016
  16. Junio C HamanoSep 22, 2016
  17. Santiago TorresSep 23, 2016
  18. Stefan BellerSep 22, 2016
  19. Jakub NarębskiSep 24, 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.