From: Jeff King <peff@peff.net>
To: Laurent Arnoud <laurent@spkdev.net>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH v3] Add the tag.gpgsign option to sign annotated tags
Date: Mon, 21 Mar 2016 15:42:38 -0400 [thread overview]
Message-ID: <20160321194237.GA28301@sigill.intra.peff.net> (raw)
In-Reply-To: <20160321193207.GD20083@spk-laptop>
On Mon, Mar 21, 2016 at 08:32:07PM +0100, Laurent Arnoud wrote:
> The `tag.gpgsign` config option allows to sign all
> annotated tags automatically.
>
> Support `--no-sign` option to countermand configuration `tag.gpgsign`.
>
> Signed-off-by: Laurent Arnoud <laurent@spkdev.net>
> Reviewed-by: Jeff King <peff@peff.net>
The meaning of "Reviewed-by" in this project is generally that the
mentioned person has read and approved of the change. But in this case,
I have not seen v3 at all yet, and I am also not sure that the ones I
_did_ review are ready for merging.
So you should probably drop that.
> +tag.gpgSign::
> + A boolean to specify whether annotated tags created should be GPG signed.
> + If `--no-sign` is specified on the command line, it takes
> + precedence over this option.
I take this to mean that we _only_ kick in signing if the created tag
would otherwise be annotated (and I thought that's what you meant in
your other mail, too). But that's not what happens with this patch, and
your tests check for the opposite:
> +get_tag_header config-implied-annotate $commit commit $time >expect
> +./fakeeditor >>expect
> +echo '-----BEGIN PGP SIGNATURE-----' >>expect
> +git config tag.gpgsign true
> +test_expect_success GPG \
> + 'git tag -s implied if configured with tag.gpgsign' \
> + 'GIT_EDITOR=./fakeeditor git tag config-implied-annotate &&
> + get_tag_msg config-implied-annotate >actual &&
> + test_cmp expect actual
> +'
> +git config --unset tag.gpgsign
That's a lightweight tag that becomes an annotated one due to the config
variable.
So I think there may be some design-level issues to work out here, but
I'll comment on a few more code-specific things, in case that code does
get carried through:
> + if (!strcmp(var, "tag.gpgsign")) {
> + sign_tag_config = git_config_bool(var, value) ? 1 : 0;
> + return 0;
> + }
git_config_bool() already converts to 0/1, you can just say:
sign_tag_config = git_config_bool(var, value);
> +get_tag_header config-implied-annotate-disabled $commit commit $time >expect
> +echo "A message" >>expect
> +git config tag.gpgsign true
> +test_expect_success GPG \
> + 'git tag --no-sign disable configured tag.gpgsign' \
> + 'git tag --no-sign -m "A message" config-implied-annotate-disabled &&
> + get_tag_msg config-implied-annotate-disabled >actual &&
> + test_cmp expect actual &&
> + test_must_fail git tag -v config-implied-annotate-disabled
> +'
> +git config --unset tag.gpgsign
Here (and in the other tests), you can use:
test_config tag.gpgsign true &&
...
inside the test_expect_success block. That has two advantages:
1. If setting the config fails for some reason, we'll notice and the
test will fail.
2. At the end of the test block, it will automatically clean up the
variable for us.
-Peff
next prev parent reply other threads:[~2016-03-21 19:42 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-19 18:23 [PATCH] Add the tag.gpgsign option to sign all created tags Laurent Arnoud
2016-03-20 4:29 ` Jeff King
2016-03-20 12:20 ` Laurent Arnoud
2016-03-20 16:52 ` Jeff King
2016-03-20 17:44 ` Laurent Arnoud
2016-03-20 15:07 ` [PATCH v2] " Laurent Arnoud
2016-03-20 16:38 ` Ramsay Jones
2016-03-21 5:50 ` Junio C Hamano
2016-03-21 19:29 ` Laurent Arnoud
2016-03-21 19:43 ` Junio C Hamano
2016-03-21 20:01 ` Laurent Arnoud
2016-03-21 20:04 ` Jeff King
2016-03-21 20:50 ` [PATCH v4] Add the tag.gpgsign option to sign annotated tags Laurent Arnoud
2016-03-21 21:26 ` Junio C Hamano
2016-03-22 19:36 ` [PATCH v5] Add the option to force " Laurent Arnoud
2016-03-22 19:48 ` Junio C Hamano
2016-03-22 20:07 ` Laurent Arnoud
2016-03-22 20:41 ` [PATCH v6] " Laurent Arnoud
2016-03-21 22:06 ` [PATCH v2] Add the tag.gpgsign option to sign all created tags Junio C Hamano
2016-03-21 19:32 ` [PATCH v3] Add the tag.gpgsign option to sign annotated tags Laurent Arnoud
2016-03-21 19:42 ` Jeff King [this message]
2016-03-21 19:53 ` [PATCH v2] Add the tag.gpgsign option to sign all created tags Jeff King
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160321194237.GA28301@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=laurent@spkdev.net \
/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.
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 NNTP newsgroup(s).