git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 2/3] log: add "--no-show-signature" command line option

From
Mehul Jain <mehul.jain2029@gmail.com>
Date
Jun 22, 2016, 16:51 UTC
Message-ID
<20160622165126.12786-3-mehul.jain2029@gmail.com>
In-Reply-To
<20160622165126.12786-1-mehul.jain2029@gmail.com>
If an user creates an alias with "--show-signature" early 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 | 5 +++++
 2 files changed, 7 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 ab66ee0..93a82e9 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -893,6 +893,11 @@ 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' '
+	git log -1 --show-signature --no-show-signature signed >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
Previous: Mehul JainNext: Mehul Jain
Message 4 of 10 in “Introduce log.showSignature config variable”
  1. 0/3 Introduce log.showSignature config variableMehul Jain, Jun 22, 2016
  2. 1/3 t4202: refactor testMehul Jain, Jun 22, 2016
  3. 1/3 t4202: refactor testMehul Jain, Jun 24, 2016
  4. 2/3 log: add "--no-show-signature" command line optionMehul Jain, Jun 22, 2016
  5. 3/3 log: add log.showSignature configuration variableMehul Jain, Jun 22, 2016
  6. Junio C HamanoJun 22, 2016
  7. Mehul JainJun 23, 2016
  8. Junio C HamanoJun 23, 2016
  9. Mehul JainJun 24, 2016
  10. Eric SunshineJun 24, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.