From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff King Subject: Re: [RFC/PATCH 1/2] log: add "log.showsignature" configuration variable Date: Thu, 26 May 2016 12:59:46 -0400 Message-ID: <20160526165946.GA18383@sigill.intra.peff.net> References: <20160526130647.27001-1-mehul.jain2029@gmail.com> <20160526130647.27001-2-mehul.jain2029@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: git@vger.kernel.org, Austin English To: Mehul Jain X-From: git-owner@vger.kernel.org Thu May 26 18:59:54 2016 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b5ydV-00019o-Vs for gcvg-git-2@plane.gmane.org; Thu, 26 May 2016 18:59:54 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753544AbcEZQ7u (ORCPT ); Thu, 26 May 2016 12:59:50 -0400 Received: from cloud.peff.net ([50.56.180.127]:44708 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751113AbcEZQ7t (ORCPT ); Thu, 26 May 2016 12:59:49 -0400 Received: (qmail 6228 invoked by uid 102); 26 May 2016 16:59:48 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.84) with SMTP; Thu, 26 May 2016 12:59:48 -0400 Received: (qmail 20417 invoked by uid 107); 26 May 2016 16:59:54 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) by peff.net (qpsmtpd/0.84) with SMTP; Thu, 26 May 2016 12:59:54 -0400 Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Thu, 26 May 2016 12:59:46 -0400 Content-Disposition: inline In-Reply-To: <20160526130647.27001-2-mehul.jain2029@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Thu, May 26, 2016 at 06:36:46PM +0530, Mehul Jain wrote: > diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt > index 03f9580..f39f800 100644 > --- a/Documentation/git-log.txt > +++ b/Documentation/git-log.txt > @@ -196,6 +196,10 @@ log.showRoot:: > `git log -p` output would be shown without a diff attached. > The default is `true`. > > +log.showSignature:: > + If `true`, `git log` and `git show` will act as if `--show-signature` > + option was passed to them. This should be: ...if the `--show-signature` option was... or: ...if `--show-signature` was... Either is correct; you just need an article when not referring directly to the option by its name. The documentation here mentions "log" and "show". But I think this will affect other programs, too, including "whatchanged" and "reflog". Those ones are probably good, but the documentation is a little misleading (I think other options just say "git-log and related commands" or something). I thought at first it would affect format-patch, too, which would be weird. But in that command we _do_ parse the variable and end up setting default_show_signature, but we never call cmd_log_init_defaults(), which is what copies that value into the rev_info struct. That's kind of a weird way to split it, but it's certainly not something you introduced here. > diff --git a/t/t4202-log.sh b/t/t4202-log.sh > index 128ba93..36be9a1 100755 > --- a/t/t4202-log.sh > +++ b/t/t4202-log.sh > @@ -890,6 +890,25 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' ' > grep "^| | gpg: Good signature" actual > ' > > +test_expect_success GPG 'log.showsignature=true behaves like --show-signature' ' > + git checkout -b test_sign master && > + echo foo >foo && > + git add foo && > + git commit -S -m signed_commit && > + test_config log.showsignature true && > + git log -1 signed >actual && > + test_i18ngrep "gpg: Signature made" actual && > + test_i18ngrep "gpg: Good signature" actual > +' You can see in the context that we do not use test_i18ngrep for finding gpg output in existing tests. I'm not sure if the new tests should be consistent, or if they should be changed to use test_i18ngrep. I don't think it's actually doing anything here, though. It's used with a git-specific GETTEXT_POISON flag that tweaks the output generated by git, but not by sub-programs like gpg. > +test_expect_success GPG '--show-signature overrides log.showsignature=false' ' > + test_when_finished "git reset --hard && git checkout master" && > + git config log.showsignature false && Should this be test_config? > +test_expect_success GPG 'log.showsignature behaves like --show-signature' ' > + git config log.showsignature true && Ditto here. -Peff