From: Jeff King Date: Tue, 17 Jan 2017 15:30:19 GMT Subject: Re: [PATCH v5 3/7] tag: add format specifier to gpg_verify_tag Message-ID: <20170117153019.gujiruwghkwfklgv@sigill.intra.peff.net> In-Reply-To: <20170117152455.k6zkeclsyawzpl2n@sigill.intra.peff.net> On Tue, Jan 17, 2017 at 10:24:55AM -0500, Jeff King wrote: > On Sun, Jan 15, 2017 at 01:47:01PM -0500, santiago@nyu.edu wrote: > > > From: Lukas Puehringer > > > > Calling functions for gpg_verify_tag() may desire to print relevant > > information about the header for further verification. Add an optional > > format argument to print any desired information after GPG verification. > > Hrm. Maybe I am missing something, but what does: > > verify_and_format_tag(sha1, name, fmt, flags); > > get you over: > > gpg_verify_tag(sha1, name, flags); > pretty_print_ref(name, sha1, fmt); > > ? The latter seems much more flexible, and I do not see how the > verification step impacts the printing at all (or vice versa). > > I could understand it more if there were patches later in the series > that somehow used the format and verification results together. But I > didn't see that. Having read through the rest of the series, it looks like you'd sometimes have to do: int ret; ret = gpg_verify_tag(sha1, name, flags); pretty_print_ref(name, sha1, fmt); if (ret) ... do something ... and this function lets you do it in a single line. Still, I think I'd rather see it done as a wrapper than modifying gpg_verify_tag(). -Peff