{"thread":{"id":"42457","subject":"[RFC/PATCH 1/2] log: add \"log.showsignature\" configuration variable","startedAt":"2016-05-26T13:06:45Z","lastAt":"2016-05-27T17:48:08Z","messageCount":18,"participants":["Mehul Jain","Remi Galan Alfonso","Jeff King","Junio C Hamano","Austin English","Pranit Bauva"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"287570","messageId":"20160526130647.27001-1-mehul.jain2029@gmail.com","threadId":"42457","inReplyTo":null,"subject":"[RFC/PATCH 0/2] Introduce \"log.showSignature\" config variable","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-05-26T13:06:45Z","receivedAt":"2016-05-26T13:06:45Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"Add a new configuratation variable \"log.showSignature\" for git-log and\ngit-show. \"log.showSignature=true\" will enable user to see GPG signature\nby default while using git-log and git-show.\n\n[Patch 1/2] introduce the config variable along with some tests.\n[Patch 2/2] tackles the problem: what if user wants to disable the\n\t    setting of \"log.showSignature=true\" using a command line\n\t    switch.\n\nPrevious discussion on this: http://thread.gmane.org/gmane.comp.version-control.git/295405\n\nMehul Jain (2):\n  log: add \"log.showsignature\" configuration variable\n  log: add \"--no-show-signature\" command line option\n\n Documentation/git-log.txt |  4 ++++\n builtin/log.c             |  6 ++++++\n revision.c                |  2 ++\n t/t4202-log.sh            | 26 ++++++++++++++++++++++++++\n t/t7510-signed-commit.sh  |  7 +++++++\n 5 files changed, 45 insertions(+)\n\n-- \n2.9.0.rc0.dirty\n"},{"id":"287569","messageId":"20160526130647.27001-2-mehul.jain2029@gmail.com","threadId":"42457","inReplyTo":"20160526130647.27001-1-mehul.jain2029@gmail.com","subject":"[RFC/PATCH 1/2] log: add \"log.showsignature\" configuration variable","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-05-26T13:06:46Z","receivedAt":"2016-05-26T13:06:46Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"People may want to always use \"--show-signature\" while using \"git log\"\nor \"git show\".\n\nWhen log.showsignature set true, \"git log\" and \"git show\" will behave\nas \"--show-signature\" was given to them.\n\nSigned-off-by: Mehul Jain <mehul.jain2029@gmail.com>\n---\n Documentation/git-log.txt |  4 ++++\n builtin/log.c             |  6 ++++++\n t/t4202-log.sh            | 19 +++++++++++++++++++\n t/t7510-signed-commit.sh  |  7 +++++++\n 4 files changed, 36 insertions(+)\n\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex 03f9580..f39f800 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -196,6 +196,10 @@ log.showRoot::\n \t`git log -p` output would be shown without a diff attached.\n \tThe default is `true`.\n \n+log.showSignature::\n+\tIf `true`, `git log` and `git show` will act as if `--show-signature`\n+\toption was passed to them.\n+\n mailmap.*::\n \tSee linkgit:git-shortlog[1].\n \ndiff --git a/builtin/log.c b/builtin/log.c\nindex 099f4f7..7103217 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -33,6 +33,7 @@ static const char *default_date_mode = NULL;\n static int default_abbrev_commit;\n static int default_show_root = 1;\n static int default_follow;\n+static int default_show_signature;\n static int decoration_style;\n static int decoration_given;\n static int use_mailmap_config;\n@@ -119,6 +120,7 @@ static void cmd_log_init_defaults(struct rev_info *rev)\n \trev->abbrev_commit = default_abbrev_commit;\n \trev->show_root_diff = default_show_root;\n \trev->subject_prefix = fmt_patch_subject_prefix;\n+\trev->show_signature = default_show_signature;\n \tDIFF_OPT_SET(&rev->diffopt, ALLOW_TEXTCONV);\n \n \tif (default_date_mode)\n@@ -409,6 +411,10 @@ static int git_log_config(const char *var, const char *value, void *cb)\n \t\tuse_mailmap_config = git_config_bool(var, value);\n \t\treturn 0;\n \t}\n+\tif (!strcmp(var, \"log.showsignature\")) {\n+\t\tdefault_show_signature = git_config_bool(var, value);\n+\t\treturn 0;\n+\t}\n \n \tif (grep_config(var, value, cb) < 0)\n \t\treturn -1;\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 128ba93..36be9a1 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -890,6 +890,25 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '\n \tgrep \"^| | gpg: Good signature\" actual\n '\n \n+test_expect_success GPG 'log.showsignature=true behaves like --show-signature' '\n+\tgit checkout -b test_sign master &&\n+\techo foo >foo &&\n+\tgit add foo &&\n+\tgit commit -S -m signed_commit &&\n+\ttest_config log.showsignature true &&\n+\tgit log -1 signed >actual &&\n+\ttest_i18ngrep \"gpg: Signature made\" actual &&\n+\ttest_i18ngrep \"gpg: Good signature\" actual\n+'\n+\n+test_expect_success GPG '--show-signature overrides log.showsignature=false' '\n+\ttest_when_finished \"git reset --hard && git checkout master\" &&\n+\tgit config log.showsignature false &&\n+\tgit log -1 --show-signature signed >actual &&\n+\ttest_i18ngrep \"gpg: Signature made\" actual &&\n+\ttest_i18ngrep \"gpg: Good signature\" actual\n+'\n+\n test_expect_success 'log --graph --no-walk is forbidden' '\n \ttest_must_fail git log --graph --no-walk\n '\ndiff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh\nindex 4177a86..326dcc8 100755\n--- a/t/t7510-signed-commit.sh\n+++ b/t/t7510-signed-commit.sh\n@@ -210,4 +210,11 @@ test_expect_success GPG 'show lack of signature with custom format' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success GPG 'log.showsignature behaves like --show-signature' '\n+\tgit config log.showsignature true &&\n+\tgit show initial > actual &&\n+\ttest_i18ngrep \"gpg: Signature made\" actual &&\n+\ttest_i18ngrep \"gpg: Good signature\" actual\n+'\n+\n test_done\n-- \n2.9.0.rc0.dirty\n"},{"id":"287571","messageId":"20160526130647.27001-3-mehul.jain2029@gmail.com","threadId":"42457","inReplyTo":"20160526130647.27001-1-mehul.jain2029@gmail.com","subject":"[RFC/PATCH 2/2] log: add \"--no-show-signature\" command line option","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-05-26T13:06:47Z","receivedAt":"2016-05-26T13:06:47Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"If \"log.showsignature=true\", then there is no way to override it using\ncommand line switch.\n\nTeach \"git log\" and \"git show\" about \"--no-show-signature\" command line\noption.\n\nSigned-off-by: Mehul Jain <mehul.jain2029@gmail.com>\n---\n revision.c     | 2 ++\n t/t4202-log.sh | 7 +++++++\n 2 files changed, 9 insertions(+)\n\ndiff --git a/revision.c b/revision.c\nindex d30d1c4..3546ff9 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -1871,6 +1871,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg\n \t\trevs->notes_opt.use_default_notes = 1;\n \t} else if (!strcmp(arg, \"--show-signature\")) {\n \t\trevs->show_signature = 1;\n+\t} else if (!strcmp(arg, \"--no-show-signature\")) {\n+\t\trevs->show_signature = 0;\n \t} else if (!strcmp(arg, \"--show-linear-break\") ||\n \t\t   starts_with(arg, \"--show-linear-break=\")) {\n \t\tif (starts_with(arg, \"--show-linear-break=\"))\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 36be9a1..ea24259 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -901,6 +901,13 @@ test_expect_success GPG 'log.showsignature=true behaves like --show-signature' '\n \ttest_i18ngrep \"gpg: Good signature\" actual\n '\n \n+test_expect_success GPG '--no-show-signature overrides log.showsignature=true' '\n+\tgit config log.showsignature true &&\n+\tgit log -1 --no-show-signature signed >actual &&\n+\ttest \"$(test_i18ngrep \"gpg: Signature made\" actual)\" = \"\" &&\n+\ttest \"$(test_i18ngrep \"gpg: Good signature\" actual)\" = \"\"\n+'\n+\n test_expect_success GPG '--show-signature overrides log.showsignature=false' '\n \ttest_when_finished \"git reset --hard && git checkout master\" &&\n \tgit config log.showsignature false &&\n-- \n2.9.0.rc0.dirty\n"},{"id":"287575","messageId":"156149583.51074.1464270131166.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"42457","inReplyTo":"20160526130647.27001-2-mehul.jain2029@gmail.com","subject":"Re: [RFC/PATCH 1/2] log: add \"log.showsignature\" configuration variable","fromName":"Remi Galan Alfonso","fromEmail":"remi.galan-alfonso@ensimag.grenoble-inp.fr","sentAt":"2016-05-26T13:42:11Z","receivedAt":"2016-05-26T13:42:11Z","isPatch":true,"sender":{"key":"remi.galan-alfonso@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/12509162?v=4"},"body":"Hi Mehul,\n\nMehul Jain <mehul.jain2029@gmail.com> writes:\n> People may want to always use \"--show-signature\" while using \"git log\"\n> or \"git show\".\n> \n> When log.showsignature set true, \"git log\" and \"git show\" will behave\n\n'When log.showsignature is set to true' ?\n\n> as \"--show-signature\" was given to them.\n\ns/as/as if\n\n> Signed-off-by: Mehul Jain <mehul.jain2029@gmail.com>\n> ---\n>  Documentation/git-log.txt |  4 ++++\n>  builtin/log.c             |  6 ++++++\n>  t/t4202-log.sh            | 19 +++++++++++++++++++\n>  t/t7510-signed-commit.sh  |  7 +++++++\n>  4 files changed, 36 insertions(+)\n> [...]\n> [...]\n> +test_expect_success GPG 'log.showsignature=true behaves like --show-signature' '\n> +        git checkout -b test_sign master &&\n> +        echo foo >foo &&\n> +        git add foo &&\n> +        git commit -S -m signed_commit &&\n> +        test_config log.showsignature true &&\n> +        git log -1 signed >actual &&\n> +        test_i18ngrep \"gpg: Signature made\" actual &&\n> +        test_i18ngrep \"gpg: Good signature\" actual\n> +'\n> +\n> +test_expect_success GPG '--show-signature overrides log.showsignature=false' '\n> +        test_when_finished \"git reset --hard && git checkout master\" &&\n> +        git config log.showsignature false &&\n\nAny specific reason as to why you don't use test_config like in the\nfirst test?\n\n> +        git log -1 --show-signature signed >actual &&\n> +        test_i18ngrep \"gpg: Signature made\" actual &&\n> +        test_i18ngrep \"gpg: Good signature\" actual\n> +'\n> +\n>  test_expect_success 'log --graph --no-walk is forbidden' '\n>          test_must_fail git log --graph --no-walk\n>  '\n> diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh\n> index 4177a86..326dcc8 100755\n> --- a/t/t7510-signed-commit.sh\n> +++ b/t/t7510-signed-commit.sh\n> @@ -210,4 +210,11 @@ test_expect_success GPG 'show lack of signature with custom format' '\n>          test_cmp expect actual\n>  '\n>  \n> +test_expect_success GPG 'log.showsignature behaves like --show-signature' '\n> +        git config log.showsignature true &&\n\nSame here.\n\n> +        git show initial > actual &&\n\nStyle: no space after redirection.\n\nThanks,\nRémi\n"},{"id":"287579","messageId":"CA+DCAeSYr-q-0uSeDymJPHZwVZDZhh4yHH48peLOKodbxW1N7A@mail.gmail.com","threadId":"42457","inReplyTo":"156149583.51074.1464270131166.JavaMail.zimbra@ensimag.grenoble-inp.fr","subject":"Re: [RFC/PATCH 1/2] log: add \"log.showsignature\" configuration variable","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-05-26T15:04:16Z","receivedAt":"2016-05-26T15:04:16Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"Hi Remi,\n\nThanks for your input.\n\nOn Thu, May 26, 2016 at 7:12 PM, Remi Galan Alfonso\n<remi.galan-alfonso@ensimag.grenoble-inp.fr> wrote:\n> Hi Mehul,\n>\n> Mehul Jain <mehul.jain2029@gmail.com> writes:\n>> When log.showsignature set true, \"git log\" and \"git show\" will behave\n>\n> 'When log.showsignature is set to true' ?\n\nPardon me, but I don't understand your question.\nI think you are suggesting me to write\n\"When log.showsignature is set to true\"\ninstead of\n\"When log.showsignature set true\".\n\n>> +test_expect_success GPG '--show-signature overrides log.showsignature=false' '\n>> +        test_when_finished \"git reset --hard && git checkout master\" &&\n>> +        git config log.showsignature false &&\n>\n> Any specific reason as to why you don't use test_config like in the\n> first test?\n\nNone, actually. It was just that I forgot to use test_config while\nwriting the tests. I will make changes  accordingly as test_config\nautomatically unset the config variable, which is necessary.\n\nThanks,\nMehul\n"},{"id":"287580","messageId":"393273591.80027.1464277402819.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"42457","inReplyTo":"CA+DCAeSYr-q-0uSeDymJPHZwVZDZhh4yHH48peLOKodbxW1N7A@mail.gmail.com","subject":"Re: [RFC/PATCH 1/2] log: add \"log.showsignature\" configuration variable","fromName":"Remi Galan Alfonso","fromEmail":"remi.galan-alfonso@ensimag.grenoble-inp.fr","sentAt":"2016-05-26T15:43:22Z","receivedAt":"2016-05-26T15:43:22Z","isPatch":true,"sender":{"key":"remi.galan-alfonso@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/12509162?v=4"},"body":"Mehul Jain <mehul.jain2029@gmail.com> writes:\n> Hi Remi,\n> \n> Thanks for your input.\n> \n> On Thu, May 26, 2016 at 7:12 PM, Remi Galan Alfonso\n> <remi.galan-alfonso@ensimag.grenoble-inp.fr> wrote:\n> > Hi Mehul,\n> >\n> > Mehul Jain <mehul.jain2029@gmail.com> writes:\n> >> When log.showsignature set true, \"git log\" and \"git show\" will behave\n> >\n> > 'When log.showsignature is set to true' ?\n> \n> Pardon me, but I don't understand your question.\n> I think you are suggesting me to write\n> \"When log.showsignature is set to true\"\n> instead of\n> \"When log.showsignature set true\".\n\nSorry, I should have made explicit what went through my mind.\n\"When log.showsignature set true\" doesn't sound right to me, while\n\"When log.showsignature is set to true\" sounds better, however not\nbeing a native english speaker maybe it's just me being wrong.\n\nThanks,\nRémi\n"},{"id":"287581","messageId":"CA+DCAeS4gP=n2s_dfNAQyZz7G38End3U5xM6b-VKu82UNf9f7w@mail.gmail.com","threadId":"42457","inReplyTo":"393273591.80027.1464277402819.JavaMail.zimbra@ensimag.grenoble-inp.fr","subject":"Re: [RFC/PATCH 1/2] log: add \"log.showsignature\" configuration variable","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-05-26T16:06:34Z","receivedAt":"2016-05-26T16:06:34Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"On Thu, May 26, 2016 at 9:13 PM, Remi Galan Alfonso\n<remi.galan-alfonso@ensimag.grenoble-inp.fr> wrote:\n> Sorry, I should have made explicit what went through my mind.\n> \"When log.showsignature set true\" doesn't sound right to me, while\n> \"When log.showsignature is set to true\" sounds better, however not\n> being a native english speaker maybe it's just me being wrong.\n\nI think \"When log.showsignature is set to true\" is better.\nThe one that I phrased does sound bit strange. I also\nnot being a native English speaker, have a history of making\ngrammatical mistakes. :)\n\nThanks,\nMehul\n"},{"id":"287585","messageId":"20160526163241.GC18210@sigill.intra.peff.net","threadId":"42457","inReplyTo":"20160526130647.27001-3-mehul.jain2029@gmail.com","subject":"Re: [RFC/PATCH 2/2] log: add \"--no-show-signature\" command line option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-05-26T16:32:42Z","receivedAt":"2016-05-26T16:32:42Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 26, 2016 at 06:36:47PM +0530, Mehul Jain wrote:\n\n> If \"log.showsignature=true\", then there is no way to override it using\n> command line switch.\n> \n> Teach \"git log\" and \"git show\" about \"--no-show-signature\" command line\n> option.\n\nI think this is teaching all of the revision machinery about it (which\nis a good thing).\n\n> diff --git a/t/t4202-log.sh b/t/t4202-log.sh\n> index 36be9a1..ea24259 100755\n> --- a/t/t4202-log.sh\n> +++ b/t/t4202-log.sh\n> @@ -901,6 +901,13 @@ test_expect_success GPG 'log.showsignature=true behaves like --show-signature' '\n>  \ttest_i18ngrep \"gpg: Good signature\" actual\n>  '\n>  \n> +test_expect_success GPG '--no-show-signature overrides log.showsignature=true' '\n> +\tgit config log.showsignature true &&\n> +\tgit log -1 --no-show-signature signed >actual &&\n> +\ttest \"$(test_i18ngrep \"gpg: Signature made\" actual)\" = \"\" &&\n> +\ttest \"$(test_i18ngrep \"gpg: Good signature\" actual)\" = \"\"\n> +'\n\nPerhaps it would be more robust to simply grep for \"gpg:\". We should not\nbe seeing any gpg-related lines in the output. It probably isn't that\nbig a deal in practice, though. If the output from gpg changes, this\ntest could report a false success, but all of the other nearby tests\nwould show a breakage, so somebody would probably notice.\n\n-Peff\n"},{"id":"287588","messageId":"CA+DCAeRRunqgbbbpDDK6gA-cXYrPtkmAuX-ERvtDtXsD2Z=xkw@mail.gmail.com","threadId":"42457","inReplyTo":"20160526163241.GC18210@sigill.intra.peff.net","subject":"Re: [RFC/PATCH 2/2] log: add \"--no-show-signature\" command line option","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-05-26T16:42:30Z","receivedAt":"2016-05-26T16:42:30Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"Hi,\n\nThanks for your input.\n\nOn Thu, May 26, 2016 at 10:02 PM, Jeff King <peff@peff.net> wrote:\n> On Thu, May 26, 2016 at 06:36:47PM +0530, Mehul Jain wrote:\n>> diff --git a/t/t4202-log.sh b/t/t4202-log.sh\n>> index 36be9a1..ea24259 100755\n>> --- a/t/t4202-log.sh\n>> +++ b/t/t4202-log.sh\n>> @@ -901,6 +901,13 @@ test_expect_success GPG 'log.showsignature=true behaves like --show-signature' '\n>>       test_i18ngrep \"gpg: Good signature\" actual\n>>  '\n>>\n>> +test_expect_success GPG '--no-show-signature overrides log.showsignature=true' '\n>> +     git config log.showsignature true &&\n>> +     git log -1 --no-show-signature signed >actual &&\n>> +     test \"$(test_i18ngrep \"gpg: Signature made\" actual)\" = \"\" &&\n>> +     test \"$(test_i18ngrep \"gpg: Good signature\" actual)\" = \"\"\n>> +'\n>\n> Perhaps it would be more robust to simply grep for \"gpg:\". We should not\n> be seeing any gpg-related lines in the output. It probably isn't that\n> big a deal in practice, though. If the output from gpg changes, this\n> test could report a false success, but all of the other nearby tests\n> would show a breakage, so somebody would probably notice.\n\nThat's a very good point. I will make the changes accordingly.\n\nThanks,\nMehul\n"},{"id":"287592","messageId":"20160526165946.GA18383@sigill.intra.peff.net","threadId":"42457","inReplyTo":"20160526130647.27001-2-mehul.jain2029@gmail.com","subject":"Re: [RFC/PATCH 1/2] log: add \"log.showsignature\" configuration variable","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-05-26T16:59:46Z","receivedAt":"2016-05-26T16:59:46Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 26, 2016 at 06:36:46PM +0530, Mehul Jain wrote:\n\n> diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\n> index 03f9580..f39f800 100644\n> --- a/Documentation/git-log.txt\n> +++ b/Documentation/git-log.txt\n> @@ -196,6 +196,10 @@ log.showRoot::\n>  \t`git log -p` output would be shown without a diff attached.\n>  \tThe default is `true`.\n>  \n> +log.showSignature::\n> +\tIf `true`, `git log` and `git show` will act as if `--show-signature`\n> +\toption was passed to them.\n\nThis should be:\n\n  ...if the `--show-signature` option was...\n\nor:\n\n  ...if `--show-signature` was...\n\nEither is correct; you just need an article when not referring directly\nto the option by its name.\n\nThe documentation here mentions \"log\" and \"show\". But I think this will\naffect other programs, too, including \"whatchanged\" and \"reflog\". Those\nones are probably good, but the documentation is a little misleading (I\nthink other options just say \"git-log and related commands\" or\nsomething).\n\nI thought at first it would affect format-patch, too, which would be\nweird. But in that command we _do_ parse the variable and end up setting\ndefault_show_signature, but we never call cmd_log_init_defaults(), which\nis what copies that value into the rev_info struct. That's kind of a\nweird way to split it, but it's certainly not something you introduced\nhere.\n\n> diff --git a/t/t4202-log.sh b/t/t4202-log.sh\n> index 128ba93..36be9a1 100755\n> --- a/t/t4202-log.sh\n> +++ b/t/t4202-log.sh\n> @@ -890,6 +890,25 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '\n>  \tgrep \"^| | gpg: Good signature\" actual\n>  '\n>  \n> +test_expect_success GPG 'log.showsignature=true behaves like --show-signature' '\n> +\tgit checkout -b test_sign master &&\n> +\techo foo >foo &&\n> +\tgit add foo &&\n> +\tgit commit -S -m signed_commit &&\n> +\ttest_config log.showsignature true &&\n> +\tgit log -1 signed >actual &&\n> +\ttest_i18ngrep \"gpg: Signature made\" actual &&\n> +\ttest_i18ngrep \"gpg: Good signature\" actual\n> +'\n\nYou can see in the context that we do not use test_i18ngrep for finding\ngpg output in existing tests. I'm not sure if the new tests should be\nconsistent, or if they should be changed to use test_i18ngrep. I don't\nthink it's actually doing anything here, though. It's used with a\ngit-specific GETTEXT_POISON flag that tweaks the output generated by\ngit, but not by sub-programs like gpg.\n\n> +test_expect_success GPG '--show-signature overrides log.showsignature=false' '\n> +\ttest_when_finished \"git reset --hard && git checkout master\" &&\n> +\tgit config log.showsignature false &&\n\nShould this be test_config?\n\n> +test_expect_success GPG 'log.showsignature behaves like --show-signature' '\n> +\tgit config log.showsignature true &&\n\nDitto here.\n\n-Peff\n"},{"id":"287593","messageId":"20160526170107.GA20677@sigill.intra.peff.net","threadId":"42457","inReplyTo":"CA+DCAeRRunqgbbbpDDK6gA-cXYrPtkmAuX-ERvtDtXsD2Z=xkw@mail.gmail.com","subject":"Re: [RFC/PATCH 2/2] log: add \"--no-show-signature\" command line option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-05-26T17:01:07Z","receivedAt":"2016-05-26T17:01:07Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 26, 2016 at 10:12:30PM +0530, Mehul Jain wrote:\n\n> On Thu, May 26, 2016 at 10:02 PM, Jeff King <peff@peff.net> wrote:\n> > On Thu, May 26, 2016 at 06:36:47PM +0530, Mehul Jain wrote:\n> >> diff --git a/t/t4202-log.sh b/t/t4202-log.sh\n> >> index 36be9a1..ea24259 100755\n> >> --- a/t/t4202-log.sh\n> >> +++ b/t/t4202-log.sh\n> >> @@ -901,6 +901,13 @@ test_expect_success GPG 'log.showsignature=true behaves like --show-signature' '\n> >>       test_i18ngrep \"gpg: Good signature\" actual\n> >>  '\n> >>\n> >> +test_expect_success GPG '--no-show-signature overrides log.showsignature=true' '\n> >> +     git config log.showsignature true &&\n> >> +     git log -1 --no-show-signature signed >actual &&\n> >> +     test \"$(test_i18ngrep \"gpg: Signature made\" actual)\" = \"\" &&\n> >> +     test \"$(test_i18ngrep \"gpg: Good signature\" actual)\" = \"\"\n> >> +'\n> >\n> > Perhaps it would be more robust to simply grep for \"gpg:\". We should not\n> > be seeing any gpg-related lines in the output. It probably isn't that\n> > big a deal in practice, though. If the output from gpg changes, this\n> > test could report a false success, but all of the other nearby tests\n> > would show a breakage, so somebody would probably notice.\n> \n> That's a very good point. I will make the changes accordingly.\n\nWhile you are here, note that test_i18ngrep can already do the\n\"negative\" grep, like:\n\n  test_i18ngrep ! \"^gpg:\" actual\n\nThough see my comments in the other part of the thread; I'm not sure\nit's worth using i18ngrep at all.\n\n-Peff\n"},{"id":"287597","messageId":"xmqqiny0wx8m.fsf@gitster.mtv.corp.google.com","threadId":"42457","inReplyTo":"20160526163241.GC18210@sigill.intra.peff.net","subject":"Re: [RFC/PATCH 2/2] log: add \"--no-show-signature\" command line option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-26T17:22:01Z","receivedAt":"2016-05-26T17:22:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Thu, May 26, 2016 at 06:36:47PM +0530, Mehul Jain wrote:\n>\n>> If \"log.showsignature=true\", then there is no way to override it using\n>> command line switch.\n>> \n>> Teach \"git log\" and \"git show\" about \"--no-show-signature\" command line\n>> option.\n>\n> I think this is teaching all of the revision machinery about it (which\n> is a good thing).\n\nI agree that the proposed commit log message should be updated to\nsay so.\n\nBecause we do not want .showsignature configuration to affect\nrev-list nor format-patch, and we will not make \"--show-sig\" the\ndefault for them either.  From that point of view, there is no\nreason for them to know about the \"--no-show-signature\" option.\n\nThe only reason why teaching the \"--no-show-signature\" option to\nthese commands is a good idea is because it would help people who\ncreate an alias with \"--show-sig\" in early part of the command line,\ne.g.\n\n\t[alias] fp = format-patch --show-signature\n\nby allowing them to countermand with --no-show-signature, i.e.\n\n\t$ git fp --no-show-signature ...\n\nIf we are updating the log message in the final submission of this\npatch, we'd want it to be clear that the presence of this option is\nnot an excuse to introduce .showsignature that affects rev-list\nlater to make sure we do not have to waste our time rejecting such a\npatch in the future.\n"},{"id":"287640","messageId":"CACC5Q1dLZ1qyQ-WDjMC=_-sEr5WZD3Kdv7n=Cd0vzzbsYYpx1A@mail.gmail.com","threadId":"42457","inReplyTo":"20160526130647.27001-1-mehul.jain2029@gmail.com","subject":"Re: [RFC/PATCH 0/2] Introduce \"log.showSignature\" config variable","fromName":"Austin English","fromEmail":"austinenglish@gmail.com","sentAt":"2016-05-27T02:55:30Z","receivedAt":"2016-05-27T02:55:30Z","isPatch":true,"sender":{"key":"austinenglish@gmail.com","avatar":null},"body":"On Thu, May 26, 2016 at 8:06 AM, Mehul Jain <mehul.jain2029@gmail.com> wrote:\n> Add a new configuratation variable \"log.showSignature\" for git-log and\n> git-show. \"log.showSignature=true\" will enable user to see GPG signature\n> by default while using git-log and git-show.\n>\n> [Patch 1/2] introduce the config variable along with some tests.\n> [Patch 2/2] tackles the problem: what if user wants to disable the\n>             setting of \"log.showSignature=true\" using a command line\n>             switch.\n>\n> Previous discussion on this: http://thread.gmane.org/gmane.comp.version-control.git/295405\n>\n> Mehul Jain (2):\n>   log: add \"log.showsignature\" configuration variable\n>   log: add \"--no-show-signature\" command line option\n>\n>  Documentation/git-log.txt |  4 ++++\n>  builtin/log.c             |  6 ++++++\n>  revision.c                |  2 ++\n>  t/t4202-log.sh            | 26 ++++++++++++++++++++++++++\n>  t/t7510-signed-commit.sh  |  7 +++++++\n>  5 files changed, 45 insertions(+)\n>\n> --\n> 2.9.0.rc0.dirty\n>\n\nHi Mehul,\n\nThanks for working on this. With your patch and git config\nlog.showsignature = true, git log and git show now display signatures\nfor me:\n\naustin@debian-laptop:~/src/winetricks$ ~/src/git/git config\nlog.showsignature true\naustin@debian-laptop:~/src/winetricks$ ~/src/git/git log -n 1\ncommit 3399c38411259bf171fc32a3e145bc49fee2291e\ngpg: Signature made Tue 10 May 2016 01:04:14 AM CDT using RSA key ID A041937B\ngpg: Good signature from \"Austin English (Austin English personal\ngmail key) <austinenglish@gmail.com>\"\nAuthor: Austin English <austinenglish@gmail.com>\nDate:   Tue May 10 01:04:14 2016 -0500\n\n    release.sh: allow overridding version\n\naustin@debian-laptop:~/src/winetricks$ ~/src/git/git show\ncommit 3399c38411259bf171fc32a3e145bc49fee2291e\ngpg: Signature made Tue 10 May 2016 01:04:14 AM CDT using RSA key ID A041937B\ngpg: Good signature from \"Austin English (Austin English personal\ngmail key) <austinenglish@gmail.com>\"\nAuthor: Austin English <austinenglish@gmail.com>\nDate:   Tue May 10 01:04:14 2016 -0500\n\n    release.sh: allow overridding version\n\ndiff --git a/src/release.sh b/src/release.sh\nindex 442df33..03a9462 100755\n--- a/src/release.sh\n+++ b/src/release.sh\n@@ -1,6 +1,8 @@\n #!/bin/sh\n # Trivial release helper for winetricks\n #\n+# Usage: $0 optional_version_name\n+#\n # Copyright (C) 2016 Austin English\n #\n # This software comes with ABSOLUTELY NO WARRANTY.\n@@ -19,7 +21,7 @@ if [ ! -f Makefile ] ; then\n     exit 1\n fi\n\n-version=\"$(date +%Y%m%d)\"\n+version=\"${1:-$(date +%Y%m%d)}\"\n\n if git tag | grep ${version} ; then\n     echo \"A tag for ${version} already exists!\"\n\n\nPlease CC me on future patches if you'd like me to test them. Thanks\nagain for your help!\n\n-- \n-Austin\n"},{"id":"287648","messageId":"CAFZEwPOajimmwh9DW=zbacqLYh1mREii8QGWTMiMQFg0TsdVQQ@mail.gmail.com","threadId":"42457","inReplyTo":"CA+DCAeSYr-q-0uSeDymJPHZwVZDZhh4yHH48peLOKodbxW1N7A@mail.gmail.com","subject":"Re: [RFC/PATCH 1/2] log: add \"log.showsignature\" configuration variable","fromName":"Pranit Bauva","fromEmail":"pranit.bauva@gmail.com","sentAt":"2016-05-27T04:01:39Z","receivedAt":"2016-05-27T04:01:39Z","isPatch":true,"sender":{"key":"pranit.bauva@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2959938?v=4"},"body":"Hey Mehul,\n\nOn Thu, May 26, 2016 at 8:34 PM, Mehul Jain <mehul.jain2029@gmail.com> wrote:\n> Hi Remi,\n>\n> Thanks for your input.\n>\n> On Thu, May 26, 2016 at 7:12 PM, Remi Galan Alfonso\n> <remi.galan-alfonso@ensimag.grenoble-inp.fr> wrote:\n>> Hi Mehul,\n>>\n>> Mehul Jain <mehul.jain2029@gmail.com> writes:\n>>> +test_expect_success GPG '--show-signature overrides log.showsignature=false' '\n>>> +        test_when_finished \"git reset --hard && git checkout master\" &&\n>>> +        git config log.showsignature false &&\n>>\n>> Any specific reason as to why you don't use test_config like in the\n>> first test?\n>\n> None, actually. It was just that I forgot to use test_config while\n> writing the tests. I will make changes  accordingly as test_config\n> automatically unset the config variable, which is necessary.\n\nOr you could probably use 'git -c' which makes it all the more compact.\n\nRegards,\nPranit Bauva\n"},{"id":"287654","messageId":"CA+DCAeTtKcCJOmDykErE_6JSJF+9FEdKs=qVQkP8DGCYKOyh_Q@mail.gmail.com","threadId":"42457","inReplyTo":"20160526165946.GA18383@sigill.intra.peff.net","subject":"Re: [RFC/PATCH 1/2] log: add \"log.showsignature\" configuration variable","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-05-27T06:04:34Z","receivedAt":"2016-05-27T06:04:34Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"On Thu, May 26, 2016 at 10:29 PM, Jeff King <peff@peff.net> wrote:\n> On Thu, May 26, 2016 at 06:36:46PM +0530, Mehul Jain wrote:\n> The documentation here mentions \"log\" and \"show\". But I think this will\n> affect other programs, too, including \"whatchanged\" and \"reflog\". Those\n> ones are probably good, but the documentation is a little misleading (I\n> think other options just say \"git-log and related commands\" or\n> something).\n\nYes, the documentation is misleading. As you have mentioned, this\nconfig variable will affect git-log, git-show, git-whatchanged and git-reflog.\nI will mention them in the documentation.\n\n>> diff --git a/t/t4202-log.sh b/t/t4202-log.sh\n>> index 128ba93..36be9a1 100755\n>> --- a/t/t4202-log.sh\n>> +++ b/t/t4202-log.sh\n>> @@ -890,6 +890,25 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '\n>>       grep \"^| | gpg: Good signature\" actual\n>>  '\n>>\n>> +test_expect_success GPG 'log.showsignature=true behaves like --show-signature' '\n>> +     git checkout -b test_sign master &&\n>> +     echo foo >foo &&\n>> +     git add foo &&\n>> +     git commit -S -m signed_commit &&\n>> +     test_config log.showsignature true &&\n>> +     git log -1 signed >actual &&\n>> +     test_i18ngrep \"gpg: Signature made\" actual &&\n>> +     test_i18ngrep \"gpg: Good signature\" actual\n>> +'\n>\n> You can see in the context that we do not use test_i18ngrep for finding\n> gpg output in existing tests. I'm not sure if the new tests should be\n> consistent, or if they should be changed to use test_i18ngrep. I don't\n> think it's actually doing anything here, though. It's used with a\n> git-specific GETTEXT_POISON flag that tweaks the output generated by\n> git, but not by sub-programs like gpg.\n\nThere was no real motivation behind usage of test_i18ngrep. Certainly,\nusage of grep will fit in the context.\n\n>> +test_expect_success GPG '--show-signature overrides log.showsignature=false' '\n>> +     test_when_finished \"git reset --hard && git checkout master\" &&\n>> +     git config log.showsignature false &&\n>\n> Should this be test_config?\n\nNoted.\n\nThanks,\nMehul\n"},{"id":"287655","messageId":"CA+DCAeTnkTRnmscduio1-buKd2gNcaScYkLY7YfEQ+_Cm=Z28Q@mail.gmail.com","threadId":"42457","inReplyTo":"xmqqiny0wx8m.fsf@gitster.mtv.corp.google.com","subject":"Re: [RFC/PATCH 2/2] log: add \"--no-show-signature\" command line option","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-05-27T06:08:32Z","receivedAt":"2016-05-27T06:08:32Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"On Thu, May 26, 2016 at 10:52 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Jeff King <peff@peff.net> writes:\n>\n>> On Thu, May 26, 2016 at 06:36:47PM +0530, Mehul Jain wrote:\n>>\n>>> If \"log.showsignature=true\", then there is no way to override it using\n>>> command line switch.\n>>>\n>>> Teach \"git log\" and \"git show\" about \"--no-show-signature\" command line\n>>> option.\n>>\n>> I think this is teaching all of the revision machinery about it (which\n>> is a good thing).\n>\n> I agree that the proposed commit log message should be updated to\n> say so.\n>\n> Because we do not want .showsignature configuration to affect\n> rev-list nor format-patch, and we will not make \"--show-sig\" the\n> default for them either.  From that point of view, there is no\n> reason for them to know about the \"--no-show-signature\" option.\n>\n> The only reason why teaching the \"--no-show-signature\" option to\n> these commands is a good idea is because it would help people who\n> create an alias with \"--show-sig\" in early part of the command line,\n> e.g.\n>\n>         [alias] fp = format-patch --show-signature\n>\n> by allowing them to countermand with --no-show-signature, i.e.\n>\n>         $ git fp --no-show-signature ...\n>\n> If we are updating the log message in the final submission of this\n> patch, we'd want it to be clear that the presence of this option is\n> not an excuse to introduce .showsignature that affects rev-list\n> later to make sure we do not have to waste our time rejecting such a\n> patch in the future.\n\nCurrently, with the [patch 1/2], only git-show, git-log, git-whatchanged\nand git-reflog are able to learn about log.showsignature config variable.\nBut commands which will learn about \"--no-show-signature\" with\n[patch 2/2] are notably a super-set of above mentioned commands.\nIntroduction of this option should not give an impression that we might\nneed log.showSignature for commands like git-format-patch etc, and\nit will definitely be a wise decision to convey the same in the commit\nmessage of this patch. I will do the necessary change.\n\nJust out of curiosity, I was thinking that we might be able to teach\n\"--no-show-signature\" option only to git-show, git-log, git-whatchanged\nand git-reflog. To do this we can introduce a new member\n\"no_show_signature\" in struct rev_info, and use this variable further\nto modify the value of value of \"rev.show_signature\" after init_revision()\nis called. This way we can selectively decide which commands should\nlearn about \"--no-show-signature\". This may be a bad idea because\nwe will have two variables in rev_info, for option --[no]-show-signature.\nAny thoughts?\n\nThanks,\nMehul\n"},{"id":"287697","messageId":"xmqq4m9js8qb.fsf@gitster.mtv.corp.google.com","threadId":"42457","inReplyTo":"CA+DCAeTnkTRnmscduio1-buKd2gNcaScYkLY7YfEQ+_Cm=Z28Q@mail.gmail.com","subject":"Re: [RFC/PATCH 2/2] log: add \"--no-show-signature\" command line option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-27T17:37:16Z","receivedAt":"2016-05-27T17:37:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mehul Jain <mehul.jain2029@gmail.com> writes:\n\n> On Thu, May 26, 2016 at 10:52 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n>> The only reason why teaching the \"--no-show-signature\" option to\n>> these commands is a good idea is because it would help people who\n>> create an alias with \"--show-sig\" in early part of the command line,\n>> e.g.\n>>\n>>         [alias] fp = format-patch --show-signature\n>>\n>> by allowing them to countermand with --no-show-signature, i.e.\n>>\n>>         $ git fp --no-show-signature ...\n>> ...\n>\n> Just out of curiosity, I was thinking that we might be able to teach\n> \"--no-show-signature\" option only to git-show, git-log, git-whatchanged\n> and git-reflog.\n\nYeah, I know it is possible with extra code, but I do not think of a\ngood reason why it is necessary.\n"},{"id":"287698","messageId":"20160527174807.GA1614@sigill.intra.peff.net","threadId":"42457","inReplyTo":"xmqq4m9js8qb.fsf@gitster.mtv.corp.google.com","subject":"Re: [RFC/PATCH 2/2] log: add \"--no-show-signature\" command line option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-05-27T17:48:08Z","receivedAt":"2016-05-27T17:48:08Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 27, 2016 at 10:37:16AM -0700, Junio C Hamano wrote:\n\n> Mehul Jain <mehul.jain2029@gmail.com> writes:\n> \n> > On Thu, May 26, 2016 at 10:52 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> >\n> >> The only reason why teaching the \"--no-show-signature\" option to\n> >> these commands is a good idea is because it would help people who\n> >> create an alias with \"--show-sig\" in early part of the command line,\n> >> e.g.\n> >>\n> >>         [alias] fp = format-patch --show-signature\n> >>\n> >> by allowing them to countermand with --no-show-signature, i.e.\n> >>\n> >>         $ git fp --no-show-signature ...\n> >> ...\n> >\n> > Just out of curiosity, I was thinking that we might be able to teach\n> > \"--no-show-signature\" option only to git-show, git-log, git-whatchanged\n> > and git-reflog.\n> \n> Yeah, I know it is possible with extra code, but I do not think of a\n> good reason why it is necessary.\n\nNot only \"not necessary\" but \"actively worse\" in my opinion. We have\n--show-signature in revision.c, and that is reason enough to have\n--no-show-signature, in case anybody would want to countermand an\nearlier request (whether from config that is soon to exist, or from a\nprevious --show-signature on the command line), or just because somebody\nfeels like making sure git is doing what they want without bothering to\ncheck the defaults.\n\nWe add the \"--no-\" form by default for all of our bools parsed by\nparse-options. The only reason it is not already here is that this\noption parsing predates our use of parse-options, and nobody had\nbothered to go back and add it. But doing so is a win simply for\nconsistency if nothing else, IMHO.\n\nI actually think it would be nice to convert all of handle_revision_opt\nto parse-options, but that's a non-trivial task. And I certainly\nwouldn't want it to hold up this otherwise simple topic.\n\n-Peff\n"}]}