Re: [PATCH v5 6/6] tag: use gpg_verify_function in tag -v call
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Apr 6, 2016, 07:09 UTC
- Message-ID
- <CAPig+cS8hc7G7gyivVFNDkpWpGu_sr1YyJUoMYUTWvigxH+U2g@mail.gmail.com>
- In-Reply-To
- <1459872449-7537-7-git-send-email-santiago@nyu.edu>
On Tue, Apr 5, 2016 at 12:07 PM, <santiago@nyu.edu> wrote:
> tag: use gpg_verify_function in tag -v call
This is a low-level description of what the patch is doing, but you normally want the subject to present a high-level overview. Perhaps something like:
tag -v: verify directly rather than exec'ing git-verify-tag
> Instead of running the verify-tag plumbing command, we use the > gpg_verify_tag() function within the verify_tag function to avoid doing > an additional fork call.
I'm a bit confused about "gpg_verify_tag() function within the verify_tag function". I *think* you can drop the "within the verify_tag function" bit.
Show 26 quoted lines
> Signed-off-by: Santiago Torres <santiago@nyu.edu>
> ---
> builtin/tag.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/builtin/tag.c b/builtin/tag.c
> index 1705c94..398c892 100644
> --- a/builtin/tag.c
> +++ b/builtin/tag.c
> @@ -104,13 +104,7 @@ static int delete_tag(const char *name, const char *ref,
> static int verify_tag(const char *name, const char *ref,
> const unsigned char *sha1)
> {
> - const char *argv_verify_tag[] = {"verify-tag",
> - "-v", "SHA1_HEX", NULL};
> - argv_verify_tag[2] = sha1_to_hex(sha1);
> -
> - if (run_command_v_opt(argv_verify_tag, RUN_GIT_CMD))
> - return error(_("could not verify the tag '%s'"), name);
> - return 0;
> + return gpg_verify_tag(sha1, GPG_VERIFY_VERBOSE);
> }
>
> static int do_sign(struct strbuf *buffer)
> --
> 2.8.0