unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: Leo Famulari <leo@famulari.name>
Cc: guix-devel@gnu.org
Subject: Re: pre-push signature hook error reporting [was Re: [PATCH v6] gnu: python-sphinx: Update to 1.4.8.]
Date: Tue, 17 Jan 2017 12:34:28 +0100	[thread overview]
Message-ID: <20170117123424.714a23b5@scratchpost.org> (raw)
In-Reply-To: <20170117031414.GB23513@jasmine>

Hi Leo,

On Mon, 16 Jan 2017 22:14:14 -0500
Leo Famulari <leo@famulari.name> wrote:

> In Git 2.11.0, it seems that `git verify-commit` can't tell the user
> which commits failed verification:
> 
> https://git.kernel.org/cgit/git/git.git/tree/builtin/verify-commit.c?h=v2.11.0

We should report that upstream and add the one line that does tell the user which commits failed verification upstream (for example print argv[i-1] in line 92). 

> With a warm cache and all the public keys on my machine, checking the
> signature of all 17813 commits on the master branch takes ~40 seconds
...
> Checking the commits one at a time takes ~105 seconds, using something
> like this:
> 
> for commit in $(git rev-list HEAD); do

For minimal improvement (I don't even think it's measureable), try `git rev-list HEAD` (backquotes) - it prevents having to spawn a subshell.

> We could make the hook do something like that. Thoughts? I think the
> performance regression is worth the convenience of knowing why it
> failed.

Uhhh it's already very slow... so even slower doesn't matter anymore (HIG guideline maximum duration is 2 seconds, so we are way off anyhow).

So I'd say do it your way for now and report it upstream for the future.

Depending on whether we think it will fail more often than not we could also combine it: 
- first check the fast (40 s) path
- if it fails,
  - print "Signature could not be verified to be correct. We are checking which failed..." info message
  - check the slow (105 s) path

Do we think that failures are likely?

Also, git seems to invoke the gpg executable for each and every commit. It would be interesting whether gpg-interface.c verify_signed_buffer could be adapted to either invoke gpg once or to just use a library instead (gpgme ?). 

Long term we could also cache the checking result - I think that's something more difficult in the face of keys that expire. It would have to store at least the expiration date, the public key and the list of commit hashes that were checked and validated successfully.

  reply	other threads:[~2017-01-17 11:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-05 16:14 [PATCH v6] gnu: python-sphinx: Update to 1.4.8 Danny Milosavljevic
2017-01-05 16:40 ` Marius Bakke
     [not found]   ` <8760lj5eb6.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me>
     [not found]     ` <20170113152400.GA24322@jasmine>
2017-01-17  3:14       ` pre-push signature hook error reporting [was Re: [PATCH v6] gnu: python-sphinx: Update to 1.4.8.] Leo Famulari
2017-01-17 11:34         ` Danny Milosavljevic [this message]
2017-01-17 12:56           ` Hartmut Goebel
2017-01-17 19:44             ` Leo Famulari
2017-01-17 19:38           ` Leo Famulari
2017-01-17 14:55         ` Hartmut Goebel
2017-01-17 19:39           ` Leo Famulari
2017-01-20 14:05         ` Ludovic Courtès
2017-01-21  1:39           ` Leo Famulari
2017-02-06 15:39             ` pre-push signature hook error reporting Leo Famulari
2017-02-06 16:37               ` Marius Bakke
2017-02-07 13:15                 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170117123424.714a23b5@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    --cc=leo@famulari.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).