{"thread":{"id":"47755","subject":"[GSoC][PATCH v2] commit: add a commit.signOff config variable","startedAt":"2018-02-05T10:43:55Z","lastAt":"2018-02-06T04:39:38Z","messageCount":3,"participants":["Chen Jingpiao","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"338184","messageId":"20180205104059.4759-1-chenjingpiao@gmail.com","threadId":"47755","inReplyTo":null,"subject":"[GSoC][PATCH v2] commit: add a commit.signOff config variable","fromName":"Chen Jingpiao","fromEmail":"chenjingpiao@gmail.com","sentAt":"2018-02-05T10:40:59Z","receivedAt":"2018-02-05T10:43:55Z","isPatch":true,"sender":{"key":"chenjingpiao@gmail.com","avatar":null},"body":"Add the commit.signOff configuration variable to use the -s or --signoff\noption of git commit by default.\n\nConvenience for those who prefer to add Signed-off-by line by the committer\ninstead of using format.signOff variable.\n\nSigned-off-by: Chen Jingpiao <chenjingpiao@gmail.com>\n---\n\nPrevious version of the patch:\n[v1]: https://public-inbox.org/git/20180204020318.4363-1-chenjingpiao@gmail.com/\n\nChanges in v2:\n\t* Update commit message: Move commentary explains to commit message.\n\t* Update test: Just test two combinations.\n\tSuggested-by: Eric Sunshine <sunshine@sunshineco.com>\n\n Documentation/config.txt     |  4 ++++\n Documentation/git-commit.txt |  2 ++\n builtin/commit.c             |  4 ++++\n t/t7501-commit.sh            | 10 ++++++++++\n 4 files changed, 20 insertions(+)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 0e25b2c92..5dec3f0cb 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1303,6 +1303,10 @@ commit.gpgSign::\n \tconvenient to use an agent to avoid typing your GPG passphrase\n \tseveral times.\n \n+commit.signOff::\n+\tA boolean value which lets you enable the `-s/--signoff` option of\n+\t`git commit` by default. See linkgit:git-commit[1].\n+\n commit.status::\n \tA boolean to enable/disable inclusion of status information in the\n \tcommit message template when using an editor to prepare the commit\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex f970a4342..7a28ea765 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -166,6 +166,8 @@ The `-m` option is mutually exclusive with `-c`, `-C`, and `-F`.\n \tthe rights to submit this work under the same license and\n \tagrees to a Developer Certificate of Origin\n \t(see http://developercertificate.org/ for more information).\n+\tSee the `commit.signOff` configuration variable in\n+\tlinkgit:git-config[1].\n \n -n::\n --no-verify::\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 4610e3d8e..324213254 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1548,6 +1548,10 @@ static int git_commit_config(const char *k, const char *v, void *cb)\n \t\tsign_commit = git_config_bool(k, v) ? \"\" : NULL;\n \t\treturn 0;\n \t}\n+\tif (!strcmp(k, \"commit.signoff\")) {\n+\t\tsignoff = git_config_bool(k, v);\n+\t\treturn 0;\n+\t}\n \tif (!strcmp(k, \"commit.verbose\")) {\n \t\tint is_bool;\n \t\tconfig_commit_verbose = git_config_bool_or_int(k, v, &is_bool);\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex fa61b1a4e..adaaeea5b 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -505,6 +505,16 @@ Myfooter: x\" &&\n \ttest_cmp expected actual\n '\n \n+test_expect_success 'commit.signoff=true & --signoff omitted' '\n+\tgit -c commit.signoff=true commit --allow-empty -m x &&\n+\tgit log -1 --format=%B | grep ^Signed-off-by:\n+'\n+\n+test_expect_success 'commit.signoff=true & --no-signoff' '\n+\tgit -c commit.signoff=true commit --allow-empty -m x --no-signoff &&\n+\t! git log -1 --format=%B | grep ^Signed-off-by:\n+'\n+\n test_expect_success 'multiple -m' '\n \n \t>negative &&\n-- \n2.16.1.70.g5ccd54536\n\n"},{"id":"338232","messageId":"xmqq4lmvb5sz.fsf@gitster-ct.c.googlers.com","threadId":"47755","inReplyTo":"20180205104059.4759-1-chenjingpiao@gmail.com","subject":"Re: [GSoC][PATCH v2] commit: add a commit.signOff config variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-02-05T19:22:04Z","receivedAt":"2018-02-05T19:22:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Chen Jingpiao <chenjingpiao@gmail.com> writes:\n\n> Add the commit.signOff configuration variable to use the -s or --signoff\n> option of git commit by default.\n\nThis is a rather old topic.  Here is one from 2006:\n\n    https://public-inbox.org/git/Pine.LNX.4.63.0611281426311.30004@wbgn013.biozentrum.uni-wuerzburg.de/\n\nwhich was referred to in another discussion in late 2008:\n\n    https://public-inbox.org/git/20081227070228.6117@nanako3.lavabit.com/\n    https://public-inbox.org/git/7vabaijvxl.fsf@gitster.siamese.dyndns.org/\n\nI am not sure if the reasons why the last effort was retracted still\napply to this round (the world certainly has changed in the past 10\nyears); it would be good to explain why this time it is different\n;-).\n\nAssuming that the new configuration variable is a desirable thing to\nadd, the change to the code looks OK.  Documentation updates may\nneed more thought in the light of past discussions, though.\n\nThanks.\n"},{"id":"338477","messageId":"20180206043723.GB30460@localhost","threadId":"47755","inReplyTo":"xmqq4lmvb5sz.fsf@gitster-ct.c.googlers.com","subject":"Re: [GSoC][PATCH v2] commit: add a commit.signOff config variable","fromName":"Chen Jingpiao","fromEmail":"chenjingpiao@gmail.com","sentAt":"2018-02-06T04:37:23Z","receivedAt":"2018-02-06T04:39:38Z","isPatch":true,"sender":{"key":"chenjingpiao@gmail.com","avatar":null},"body":"On 02/05 11:22, Junio C Hamano wrote:\n> Chen Jingpiao <chenjingpiao@gmail.com> writes:\n> \n> > Add the commit.signOff configuration variable to use the -s or --signoff\n> > option of git commit by default.\n> \n> This is a rather old topic.  Here is one from 2006:\n> \n>     https://public-inbox.org/git/Pine.LNX.4.63.0611281426311.30004@wbgn013.biozentrum.uni-wuerzburg.de/\n> \n> which was referred to in another discussion in late 2008:\n> \n>     https://public-inbox.org/git/20081227070228.6117@nanako3.lavabit.com/\n>     https://public-inbox.org/git/7vabaijvxl.fsf@gitster.siamese.dyndns.org/\n> \n> I am not sure if the reasons why the last effort was retracted still\n> apply to this round (the world certainly has changed in the past 10\n> years); it would be good to explain why this time it is different\n> ;-).\n> \n> Assuming that the new configuration variable is a desirable thing to\n> add, the change to the code looks OK.  Documentation updates may\n> need more thought in the light of past discussions, though.\n> \n> Thanks.\n\nI agree with Johannes Schindelin once said \"a signoff _has_ to be a\nconscious act, or else  it will lose its meaning.\"\nI think I shouldn't add this configuration variable. Thank you.\n\n--\nChen Jingpiao\n"}]}