Re: [PATCHv3] gpg-interface: check gpg signature creation status

2016-06-16 Thread Michael J Gruber
Jeff King venit, vidit, dixit 16.06.2016 11:25: > On Wed, Jun 15, 2016 at 09:17:54AM +0200, Michael J Gruber wrote: > >> As for the flexibility: >> We do code specifically for gpg, which happens to work for gpg2 also. >> The patch doesn't add any gpg ui requirements that we don't require >> elsewh

Re: [PATCHv3] gpg-interface: check gpg signature creation status

2016-06-16 Thread Jeff King
On Wed, Jun 15, 2016 at 09:17:54AM +0200, Michael J Gruber wrote: > As for the flexibility: > We do code specifically for gpg, which happens to work for gpg2 also. > The patch doesn't add any gpg ui requirements that we don't require > elsewhere already. > More flexibility requires a completely pl

Re: [PATCHv3] gpg-interface: check gpg signature creation status

2016-06-15 Thread Michael J Gruber
Jeff King venit, vidit, dixit 15.06.2016 02:56: > On Tue, Jun 14, 2016 at 04:47:35PM -0700, Junio C Hamano wrote: > >> Jeff King writes: >> >>> I'm still undecided on whether it is a better approach than making >>> sure the stdout we got looks sane. In particular I'd worry that it >>> would make

Re: [PATCHv3] gpg-interface: check gpg signature creation status

2016-06-14 Thread Jeff King
On Tue, Jun 14, 2016 at 06:26:33PM -0400, Jeff King wrote: > > > > bottom = signature->len; > > > > - len = strbuf_read(signature, gpg.out, 1024); > > > > + strbuf_read(signature, gpg.out, 1024); > > > > + strbuf_read(&err, gpg.err, 0); > > > > > > H, isn't this aski

Re: [PATCHv3] gpg-interface: check gpg signature creation status

2016-06-14 Thread Jeff King
On Tue, Jun 14, 2016 at 04:47:35PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > I'm still undecided on whether it is a better approach than making > > sure the stdout we got looks sane. In particular I'd worry that it > > would make things harder for somebody trying to plug in somethin

Re: [PATCHv3] gpg-interface: check gpg signature creation status

2016-06-14 Thread Junio C Hamano
Jeff King writes: > I'm still undecided on whether it is a better approach than making > sure the stdout we got looks sane. In particular I'd worry that it > would make things harder for somebody trying to plug in something > gpg-like (e.g., if you wanted to do something exotic like call a > prog

Re: [PATCHv3] gpg-interface: check gpg signature creation status

2016-06-14 Thread Jeff King
On Tue, Jun 14, 2016 at 05:50:19PM -0400, Jeff King wrote: > On Tue, Jun 14, 2016 at 11:13:54AM -0700, Junio C Hamano wrote: > > > Michael J Gruber writes: > > > > > bottom = signature->len; > > > - len = strbuf_read(signature, gpg.out, 1024); > > > + strbuf_read(signature, gpg.out, 1024); >

Re: [PATCHv3] gpg-interface: check gpg signature creation status

2016-06-14 Thread Jeff King
On Tue, Jun 14, 2016 at 11:13:54AM -0700, Junio C Hamano wrote: > Michael J Gruber writes: > > > bottom = signature->len; > > - len = strbuf_read(signature, gpg.out, 1024); > > + strbuf_read(signature, gpg.out, 1024); > > + strbuf_read(&err, gpg.err, 0); > > H, isn't this asking f

Re: [PATCHv3] gpg-interface: check gpg signature creation status

2016-06-14 Thread Junio C Hamano
Michael J Gruber writes: > bottom = signature->len; > - len = strbuf_read(signature, gpg.out, 1024); > + strbuf_read(signature, gpg.out, 1024); > + strbuf_read(&err, gpg.err, 0); H, isn't this asking for a deadlock? When GPG spews more than what would fit in a pipe buffer

[PATCHv3] gpg-interface: check gpg signature creation status

2016-06-14 Thread Michael J Gruber
When we create a signature, it may happen that gpg returns with "success" but not with an actual detached signature on stdout. Check for the correct signature creation status to catch these cases better. Really, --status-fd parsing is the only way to check gpg status reliably. We do the same for v