Re: [PATCH] gpg-interface: Add some output from gpg when it errors out.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 25, 2017, 23:04 UTC
- Message-ID
- <xmqqtw8m7ncp.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170125030434.26448-1-mh@glandium.org>
Mike Hommey <mh@glandium.org> writes:
Show 9 quoted lines
> For instance, after changing my laptop for a new one, I copied my > configs, but had some environment differences that broke gpg. > With this change applied, the output becomes, on this new machine: > gpg: keyblock resource '/usr/share/keyrings/debian-keyring.gpg': No > such file or directory > error: gpg failed to sign the data > error: unable to sign the tag > > which makes it clearer what's wrong.
Overall I think this is a good thing to do. Instead of eating the status output, showing what we got, especially when we know the command failed, would make the bug-hunting of user's environment easier, like you showed above.
The only thing in the design that makes me wonder is the filtering out based on "[GNUPG:]" prefix. Why do we need to filter them out?
Implementation-wise, I'd be happier if we do not add any new callsites of strbuf_split(), which is a horrible interface. But that is a minor detail.
Thanks.