Re: [PATCH v4 4/7] builtin/verify-tag: add --format to verify-tag
- From
Jeff King <peff@peff.net>
- Date
- Oct 19, 2016, 09:04 UTC
- Message-ID
- <20161019090432.xip4r7f6xwcciqk4@sigill.intra.peff.net>
- In-Reply-To
- <20161007210721.20437-5-santiago@nyu.edu>
On Fri, Oct 07, 2016 at 05:07:18PM -0400, santiago@nyu.edu wrote:
Show 8 quoted lines
> @@ -46,12 +50,17 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix)
> if (verbose)
> flags |= GPG_VERIFY_VERBOSE;
>
> + if (fmt_pretty) {
> + verify_ref_format(fmt_pretty);
> + flags |= GPG_VERIFY_QUIET;
> + }I see why you would want to disable the normal output when there is a custom format. But it seems a shame that the GPG information cannot be retrieved as part of that format.
I think in the long run we'd want something like pretty.c's "%G" placeholders for the ref-filter pretty-printer. But I think we are OK to do this patch without it. It allows at least:
tag=v2.0.0 got=$(git verify-tag --format='%(tag)' "$tag") && test "$tag" = "$got" || echo >&2 "verification failed"
which is better than what we have now, and can be extended in the future.
-Peff