From: Mehul Jain <mehul.jain2029@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Mehul Jain <mehul.jain2029@gmail.com>
Subject: [PATCH v2 1/2] log: add "--no-show-signature" command line option
Date: Sat, 18 Jun 2016 17:55:09 +0530 [thread overview]
Message-ID: <20160618122510.5105-2-mehul.jain2029@gmail.com> (raw)
In-Reply-To: <20160618122510.5105-1-mehul.jain2029@gmail.com>
If an user creates an alias with "--show-signature" in command line,
e.g.
[alias] logss = log --show-signature
then there is no way to countermand it through command line.
Teach git-log and related commands about "--no-show-signature" command
line option. This will make "git logss --no-show-signature" run
without showing GPG signature.
Signed-off-by: Mehul Jain <mehul.jain2029@gmail.com>
---
revision.c | 2 ++
t/t4202-log.sh | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/revision.c b/revision.c
index d30d1c4..3546ff9 100644
--- a/revision.c
+++ b/revision.c
@@ -1871,6 +1871,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->notes_opt.use_default_notes = 1;
} else if (!strcmp(arg, "--show-signature")) {
revs->show_signature = 1;
+ } else if (!strcmp(arg, "--no-show-signature")) {
+ revs->show_signature = 0;
} else if (!strcmp(arg, "--show-linear-break") ||
starts_with(arg, "--show-linear-break=")) {
if (starts_with(arg, "--show-linear-break="))
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 128ba93..02384a3 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -890,6 +890,16 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '
grep "^| | gpg: Good signature" actual
'
+test_expect_success GPG '--no-show-signature overrides --show-signature' '
+ test_when_finished "git reset --hard && git checkout master" &&
+ git checkout -b nosign master &&
+ echo foo >foo &&
+ git add foo &&
+ git commit -S -m signed_commit &&
+ git log -1 --show-signature --no-show-signature nosign >actual &&
+ ! grep "^gpg:" actual
+'
+
test_expect_success 'log --graph --no-walk is forbidden' '
test_must_fail git log --graph --no-walk
'
--
2.9.0.rc0.dirty
next prev parent reply other threads:[~2016-06-18 12:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-18 12:25 [PATCH v2 0/2] Introduce log.showSignature config variable Mehul Jain
2016-06-18 12:25 ` Mehul Jain [this message]
2016-06-18 12:25 ` [PATCH v2 2/2] log: add log.showSignature configuration variable Mehul Jain
2016-06-19 6:59 ` Eric Sunshine
2016-06-19 11:30 ` Mehul Jain
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=20160618122510.5105-2-mehul.jain2029@gmail.com \
--to=mehul.jain2029@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).