{"thread":{"id":"42689","subject":"[PATCH v3 0/3] Introduce log.showSignature config variable","startedAt":"2016-06-22T16:53:31Z","lastAt":"2016-06-24T14:13:12Z","messageCount":10,"participants":["Mehul Jain","Junio C Hamano","Eric Sunshine"],"isPatch":true,"patchVersion":3,"patchTotal":3},"messages":[{"id":"289865","messageId":"20160622165126.12786-1-mehul.jain2029@gmail.com","threadId":"42689","inReplyTo":null,"subject":"[PATCH v3 0/3] Introduce log.showSignature config variable","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-06-22T16:51:23Z","receivedAt":"2016-06-22T16:53:31Z","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\nand related commands. \"log.showSignature=true\" will enable user to\nsee GPG signature by default for git-log and related commands.\n\nChanges compared to v2:\n\t* A preparatory patch 1/3 has been introduced so that tests\n\t  in patches 2/3 and 3/3 can take advantage of it.\n\t* Mistake regarding branch in [patch v2 2/2] has been\n\t  corrected.\n\t* Tight coupling between the tests in [patch v2 2/2] has\n\t  been resovled.\n\nI would like to thanks Eric Sunshine for his feedback on previous\nseries [1].\n\n[1]: http://thread.gmane.org/gmane.comp.version-control.git/297648 \n\nMehul Jain (3):\n  t4202: refactoring of test\n  log: add \"--no-show-signature\" command line option\n  log: add log.showSignature configuration variable\n\n Documentation/git-log.txt |  4 ++++\n builtin/log.c             |  6 ++++++\n revision.c                |  2 ++\n t/t4202-log.sh            | 32 ++++++++++++++++++++++++++++++--\n t/t7510-signed-commit.sh  |  7 +++++++\n 5 files changed, 49 insertions(+), 2 deletions(-)\n\n-- \n2.9.0.rc0.dirty\n\n"},{"id":"289866","messageId":"20160622165126.12786-2-mehul.jain2029@gmail.com","threadId":"42689","inReplyTo":"20160622165126.12786-1-mehul.jain2029@gmail.com","subject":"[PATCH v3 1/3] t4202: refactor test","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-06-22T16:51:24Z","receivedAt":"2016-06-22T16:53:36Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"Separate the creation of 'signed' branch so that other tests can take\nadvantage of this branch.\n\nSigned-off-by: Mehul Jain <mehul.jain2029@gmail.com>\n---\n t/t4202-log.sh | 7 +++++--\n 1 file changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 128ba93..ab66ee0 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -860,12 +860,15 @@ test_expect_success 'dotdot is a parent directory' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG 'log --graph --show-signature' '\n+test_expect_success 'setup signed branch' '\n \ttest_when_finished \"git reset --hard && git checkout master\" &&\n \tgit checkout -b signed master &&\n \techo foo >foo &&\n \tgit add foo &&\n-\tgit commit -S -m signed_commit &&\n+\tgit commit -S -m signed_commit\n+'\n+\n+test_expect_success GPG 'log --graph --show-signature' '\n \tgit log --graph --show-signature -n1 signed >actual &&\n \tgrep \"^| gpg: Signature made\" actual &&\n \tgrep \"^| gpg: Good signature\" actual\n-- \n2.9.0.rc0.dirty\n\n"},{"id":"289867","messageId":"20160622165126.12786-3-mehul.jain2029@gmail.com","threadId":"42689","inReplyTo":"20160622165126.12786-1-mehul.jain2029@gmail.com","subject":"[PATCH v3 2/3] log: add \"--no-show-signature\" command line option","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-06-22T16:51:25Z","receivedAt":"2016-06-22T16:53:41Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"If an user creates an alias with \"--show-signature\" early in command\nline, e.g.\n\t[alias] logss = log --show-signature\n\nthen there is no way to countermand it through command line.\n\nTeach git-log and related commands about \"--no-show-signature\" command\nline option. This will make \"git logss --no-show-signature\" run\nwithout showing GPG signature.\n\nSigned-off-by: Mehul Jain <mehul.jain2029@gmail.com>\n---\n revision.c     | 2 ++\n t/t4202-log.sh | 5 +++++\n 2 files changed, 7 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 ab66ee0..93a82e9 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -893,6 +893,11 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '\n \tgrep \"^| | gpg: Good signature\" actual\n '\n \n+test_expect_success GPG '--no-show-signature overrides --show-signature' '\n+\tgit log -1 --show-signature --no-show-signature signed >actual &&\n+\t! grep \"^gpg:\" actual\n+'\n+\n test_expect_success 'log --graph --no-walk is forbidden' '\n \ttest_must_fail git log --graph --no-walk\n '\n-- \n2.9.0.rc0.dirty\n\n"},{"id":"289868","messageId":"20160622165126.12786-4-mehul.jain2029@gmail.com","threadId":"42689","inReplyTo":"20160622165126.12786-1-mehul.jain2029@gmail.com","subject":"[PATCH v3 3/3] log: add log.showSignature configuration variable","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-06-22T16:51:26Z","receivedAt":"2016-06-22T16:53:45Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"Users may want to always use \"--show-signature\" while using git-log and\nrelated commands.\n\nWhen log.showSignature is set to true, git-log and related commands will\nbehave as if \"--show-signature\" was given to them.\n\nNote that this config variable is meant to affect git-log, git-show,\ngit-whatchanged and git-reflog. Other commands like git-format-patch,\ngit-rev-list are not to be affected by this config variable.\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            | 20 ++++++++++++++++++++\n t/t7510-signed-commit.sh  |  7 +++++++\n 4 files changed, 37 insertions(+)\n\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex 03f9580..bbb5adc 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 related commands will act as if the\n+\t`--show-signature` option 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 93a82e9..ecac186 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -898,6 +898,26 @@ test_expect_success GPG '--no-show-signature overrides --show-signature' '\n \t! grep \"^gpg:\" actual\n '\n \n+test_expect_success GPG 'log.showsignature=true behaves like --show-signature' '\n+\ttest_config log.showsignature true &&\n+\tgit log -1 signed >actual &&\n+\tgrep \"gpg: Signature made\" actual &&\n+\tgrep \"gpg: Good signature\" actual\n+'\n+\n+test_expect_success GPG '--no-show-signature overrides log.showsignature=true' '\n+\ttest_config log.showsignature true &&\n+\tgit log -1 --no-show-signature signed >actual &&\n+\t! grep \"^gpg:\" actual\n+'\n+\n+test_expect_success GPG '--show-signature overrides log.showsignature=false' '\n+\ttest_config log.showsignature false &&\n+\tgit log -1 --show-signature signed >actual &&\n+\tgrep \"gpg: Signature made\" actual &&\n+\tgrep \"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..6e839f5 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+\ttest_config log.showsignature true &&\n+\tgit show initial >actual &&\n+\tgrep \"gpg: Signature made\" actual &&\n+\tgrep \"gpg: Good signature\" actual\n+'\n+\n test_done\n-- \n2.9.0.rc0.dirty\n\n"},{"id":"289914","messageId":"xmqqr3bpklsd.fsf@gitster.mtv.corp.google.com","threadId":"42689","inReplyTo":"20160622165126.12786-1-mehul.jain2029@gmail.com","subject":"Re: [PATCH v3 0/3] Introduce log.showSignature config variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-06-22T20:31:46Z","receivedAt":"2016-06-22T20:31:57Z","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> Add a new configuratation variable \"log.showSignature\" for git-log\n> and related commands. \"log.showSignature=true\" will enable user to\n> see GPG signature by default for git-log and related commands.\n>\n> Changes compared to v2:\n> \t* A preparatory patch 1/3 has been introduced so that tests\n> \t  in patches 2/3 and 3/3 can take advantage of it.\n\nIt is unclear how this change allows the remainder to \"take\nadvanrage\" to me.  Earlier, \"signed\" branch was created only when\nthe GPG prerequisite is met and with this change the branch is\nalways created, which is the only change as far as I can see.  But\nthe tests that are added in 2 and 3 are all protected with the GPG\nprerequiste.\n\nBesides, the invocation of \"git commit -S\" after this change is no\nlonger protected by the GPG prerequisite and it may even cause the\n'setup' step to fail on a host without GPG.\n\nWhat am I missing?  I do not quite see any reason to take 1/2; I\nonly see a possible downside without any upside.\n\nThe main two steps 2&3 looked good.\n\nThanks.\n\n> \t* Mistake regarding branch in [patch v2 2/2] has been\n> \t  corrected.\n> \t* Tight coupling between the tests in [patch v2 2/2] has\n> \t  been resovled.\n>\n> I would like to thanks Eric Sunshine for his feedback on previous\n> series [1].\n\n\n\n>\n> [1]: http://thread.gmane.org/gmane.comp.version-control.git/297648 \n>\n> Mehul Jain (3):\n>   t4202: refactoring of test\n>   log: add \"--no-show-signature\" command line option\n>   log: add log.showSignature configuration variable\n>\n>  Documentation/git-log.txt |  4 ++++\n>  builtin/log.c             |  6 ++++++\n>  revision.c                |  2 ++\n>  t/t4202-log.sh            | 32 ++++++++++++++++++++++++++++++--\n>  t/t7510-signed-commit.sh  |  7 +++++++\n>  5 files changed, 49 insertions(+), 2 deletions(-)\n"},{"id":"289940","messageId":"CA+DCAeQUJ4D4kjR6FtTibwPO8o+wv-hQNDDj2ysJaBHGTPkHgA@mail.gmail.com","threadId":"42689","inReplyTo":"xmqqr3bpklsd.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v3 0/3] Introduce log.showSignature config variable","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-06-23T05:44:27Z","receivedAt":"2016-06-23T05:44:31Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"On Thu, Jun 23, 2016 at 2:01 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Mehul Jain <mehul.jain2029@gmail.com> writes:\n>\n>> Add a new configuratation variable \"log.showSignature\" for git-log\n>> and related commands. \"log.showSignature=true\" will enable user to\n>> see GPG signature by default for git-log and related commands.\n>>\n>> Changes compared to v2:\n>>       * A preparatory patch 1/3 has been introduced so that tests\n>>         in patches 2/3 and 3/3 can take advantage of it.\n>\n> It is unclear how this change allows the remainder to \"take\n> advanrage\" to me.  Earlier, \"signed\" branch was created only when\n> the GPG prerequisite is met and with this change the branch is\n> always created, which is the only change as far as I can see.  But\n> the tests that are added in 2 and 3 are all protected with the GPG\n> prerequiste.\n>\n> Besides, the invocation of \"git commit -S\" after this change is no\n> longer protected by the GPG prerequisite and it may even cause the\n> 'setup' step to fail on a host without GPG.\n\nI overlooked the GPG prerequisite when I created the \"setup signed\nbranch\" test in patch 1/3. I will send a patch to  rectify it ones\neveryone agree with the idea behind this patch.\n\nIn patch 2/3 and 3/3, there are many tests which requires a branch\nsimilar to that of \"signed\" branch, i.e. a branch with a commit having\nGPG signature. So previously in v2, I created two new branches,\n\"test_sign\" and \"no_sign\", which are identical to that of \"signed\"\nbranch. And with these branches, I wrote the tests in patch 2/3\nand 3/3.\n\nAs suggested by Eric [1], rather than creating new branches, I\ncan take advantage of \"signed\" branch which already exists.\nSo, I created a new test to separate the creation of \"signed\" branch\nfrom existing test \"log --graph --show-signature\". This was done\nbecause I do not want new tests to depend on this test. If in future\nsomeone changes this test then it will affect new tests introduced\nin 2/3 and 3/3.\n\nNow the new tests and existing one (\"log --graph ... \") are using a\nsingle branch \"signed\" to do there work.\n\nIf changing an existing test is not well justified here, then I can create\nsetup test for new tests only, without affecting the existing test.\n\n[1]: http://thread.gmane.org/gmane.comp.version-control.git/297648\n\nThanks,\nMehul\n"},{"id":"289943","messageId":"xmqqd1n8jtzk.fsf@gitster.mtv.corp.google.com","threadId":"42689","inReplyTo":"CA+DCAeQUJ4D4kjR6FtTibwPO8o+wv-hQNDDj2ysJaBHGTPkHgA@mail.gmail.com","subject":"Re: [PATCH v3 0/3] Introduce log.showSignature config variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-06-23T06:32:15Z","receivedAt":"2016-06-23T06:32:22Z","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> In patch 2/3 and 3/3, there are many tests which requires a branch\n> similar to that of \"signed\" branch, i.e. a branch with a commit having\n> GPG signature. So previously in v2, I created two new branches,\n> \"test_sign\" and \"no_sign\", which are identical to that of \"signed\"\n> branch. And with these branches, I wrote the tests in patch 2/3\n> and 3/3.\n>\n> As suggested by Eric [1], rather than creating new branches, I\n> can take advantage of \"signed\" branch which already exists.\n\nYeah, I understand that part.  But you do not _need_ to do the split\nyou do in 1/3 in order to reuse \"signed\".\n\nThe first 'log --graph --signature' test may fail, but it is not\nlike that the test without 1/3 removes the \"signed\" branch when\n\"log\" command or the signature tests of its output fail, so \"I\ndidn't want the later tests to depend on the first test being\nsuccessful\" does not quite justify the split.  If \"commit -S\" step,\nwhich 1/3 splits into the earlier one of the two, fails, then you\nwon't have a signed commit to use in the later tests, even though\nyou have \"signed\" branch.  The split of the tests done by 1/3 does\nnot make the tests more robust.  If the commands in the original\nin the part of the first test in the original that you keep in the\nfirst half with 1/3 fail, subsequent tests will be affected with or\nwithout 1/3.\n\nIf 1/3 justifies the change a bit differently, it would become a\ngood one.\n\n    In 2/3 and 3/3, we will use the same 'signed' branch that the\n    first test for 'log --graph --show-signature' uses.  This branch\n    is currently created in that 'log --graph --show-signature' test\n    itself.\n\n    Split the set-up part into a test of its own, and make the\n    existing first test into a separate one that only inspects the\n    history on the 'signed' branch.  That way, it would become\n    clearer that later tests added by 2/3 and 3/3 reuse the 'signed'\n    branch in the same way this 'log --graph --show-signature' uses\n    that same branch.\n\nOf course, you would need to keep GPG prerequisite for both halves\n1/3 creates.\n\nThanks.\n"},{"id":"290011","messageId":"CA+DCAeSvb14W5CoEa72DQtM+FHQ+jppSVvoTmQ7rX0EHQAMy6g@mail.gmail.com","threadId":"42689","inReplyTo":"xmqqd1n8jtzk.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v3 0/3] Introduce log.showSignature config variable","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-06-24T09:21:48Z","receivedAt":"2016-06-24T09:21:56Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"On Thu, Jun 23, 2016 at 12:02 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Mehul Jain <mehul.jain2029@gmail.com> writes:\n>\n>> In patch 2/3 and 3/3, there are many tests which requires a branch\n>> similar to that of \"signed\" branch, i.e. a branch with a commit having\n>> GPG signature. So previously in v2, I created two new branches,\n>> \"test_sign\" and \"no_sign\", which are identical to that of \"signed\"\n>> branch. And with these branches, I wrote the tests in patch 2/3\n>> and 3/3.\n>>\n>> As suggested by Eric [1], rather than creating new branches, I\n>> can take advantage of \"signed\" branch which already exists.\n>\n> Yeah, I understand that part.  But you do not _need_ to do the split\n> you do in 1/3 in order to reuse \"signed\".\n\nIf it's fine, then I think it would be OK to drop this 1/3. Without splitting\nthe 'log --graph --show-signature' in two test will also serve the\npurpose for the new test to use the signed branch.\n\nShould I send a new patch series with 1/3 dropped or you can do\nit manually at your end?\n\nThanks,\nMehul\n"},{"id":"290016","messageId":"CAPig+cSHRWHUJ+P9nxQXz5YGigD7XOT24oUJs=JSR5L+xDoc0A@mail.gmail.com","threadId":"42689","inReplyTo":"CA+DCAeSvb14W5CoEa72DQtM+FHQ+jppSVvoTmQ7rX0EHQAMy6g@mail.gmail.com","subject":"Re: [PATCH v3 0/3] Introduce log.showSignature config variable","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2016-06-24T12:25:44Z","receivedAt":"2016-06-24T12:25:50Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Jun 24, 2016 at 5:21 AM, Mehul Jain <mehul.jain2029@gmail.com> wrote:\n> On Thu, Jun 23, 2016 at 12:02 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Mehul Jain <mehul.jain2029@gmail.com> writes:\n>>> In patch 2/3 and 3/3, there are many tests which requires a branch\n>>> similar to that of \"signed\" branch, i.e. a branch with a commit having\n>>> GPG signature. So previously in v2, I created two new branches,\n>>> \"test_sign\" and \"no_sign\", which are identical to that of \"signed\"\n>>> branch. And with these branches, I wrote the tests in patch 2/3\n>>> and 3/3.\n>>>\n>>> As suggested by Eric [1], rather than creating new branches, I\n>>> can take advantage of \"signed\" branch which already exists.\n>>\n>> Yeah, I understand that part.  But you do not _need_ to do the split\n>> you do in 1/3 in order to reuse \"signed\".\n>\n> If it's fine, then I think it would be OK to drop this 1/3. Without splitting\n> the 'log --graph --show-signature' in two test will also serve the\n> purpose for the new test to use the signed branch.\n\nMy understanding of Junio's response is that the missing PGP\nprerequisite along with a weak commit message make for poor\njustification of patch 1/3, however, if you add the prerequisite and\nuse the commit message he proposed (reproduced below) then it becomes\nsensible to retain 1/3.\n\n    --->8---\n    In 2/3 and 3/3, we will use the same 'signed' branch that the\n    first test for 'log --graph --show-signature' uses.  This branch\n    is currently created in that 'log --graph --show-signature' test\n    itself.\n\n    Split the set-up part into a test of its own, and make the\n    existing first test into a separate one that only inspects the\n    history on the 'signed' branch.  That way, it would become\n    clearer that later tests added by 2/3 and 3/3 reuse the 'signed'\n    branch in the same way this 'log --graph --show-signature' uses\n    that same branch.\n    --->8---\n"},{"id":"290020","messageId":"20160624141234.22836-1-mehul.jain2029@gmail.com","threadId":"42689","inReplyTo":"20160622165126.12786-2-mehul.jain2029@gmail.com","subject":"[PATCH v3 1/3] t4202: refactor test","fromName":"Mehul Jain","fromEmail":"mehul.jain2029@gmail.com","sentAt":"2016-06-24T14:12:34Z","receivedAt":"2016-06-24T14:13:12Z","isPatch":true,"sender":{"key":"mehul.jain2029@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14936539?v=4"},"body":"Subsequent patches will want to reuse the 'signed' branch that the\n'log --graph --show-signature' test creates and uses.\n\nSplit the set-up part into a test of its own, and make the existing\ntest into a separate one that only inspects the history on the 'signed'\nbranch. This way, it becomes clearer that tests added by subsequent\npatches reuse the 'signed' branch in the same way.\n\nSigned-off-by: Mehul Jain <mehul.jain2029@gmail.com>\n---\n t/t4202-log.sh | 7 +++++--\n 1 file changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 128ba93..ab66ee0 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -860,12 +860,15 @@ test_expect_success 'dotdot is a parent directory' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG 'log --graph --show-signature' '\n+test_expect_success GPG 'setup signed branch' '\n \ttest_when_finished \"git reset --hard && git checkout master\" &&\n \tgit checkout -b signed master &&\n \techo foo >foo &&\n \tgit add foo &&\n-\tgit commit -S -m signed_commit &&\n+\tgit commit -S -m signed_commit\n+'\n+\n+test_expect_success GPG 'log --graph --show-signature' '\n \tgit log --graph --show-signature -n1 signed >actual &&\n \tgrep \"^| gpg: Signature made\" actual &&\n \tgrep \"^| gpg: Good signature\" actual\n-- \n2.9.0.rc0.dirty\n\n"}]}