{"thread":{"id":"41685","subject":"[PATCH v6] commit: add a commit.verbose config variable","startedAt":"2016-03-14T20:50:47Z","lastAt":"2016-03-14T21:32:59Z","messageCount":4,"participants":["Pranit Bauva","Eric Sunshine"],"isPatch":true,"patchVersion":6,"patchTotal":null},"messages":[{"id":"280740","messageId":"0102015376e53b40-d25f7fdc-4ae1-4aae-b779-052fcf252071-000000@eu-west-1.amazonses.com","threadId":"41685","inReplyTo":null,"subject":"[PATCH v6] commit: add a commit.verbose config variable","fromName":"Pranit Bauva","fromEmail":"pranit.bauva@gmail.com","sentAt":"2016-03-14T20:50:47Z","receivedAt":"2016-03-14T20:50:47Z","isPatch":true,"sender":{"key":"pranit.bauva@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2959938?v=4"},"body":"Add commit.verbose configuration variable as a convenience for those\nwho always prefer --verbose.\n\nHelped-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Pranit Bauva <pranit.bauva@gmail.com>\n\n---\nThe previous versions of this patch are:\n - [v5] $gmane/288728\n - [v4] $gmane/288652\n - [v3] $gmane/288634\n - [v2] $gmane/288569\n - [v1] $gmane/287540\n\nThe changes with respect to the last version are :\n - Use Helped-by tag instead of Mentored-by.\n - Use \"^diff --git\" instead of \"*diff --git\".\n - Add a different test to check whether the verbose option did not break status.\n---\n Documentation/config.txt     |  4 ++++\n Documentation/git-commit.txt |  3 ++-\n builtin/commit.c             |  4 ++++\n t/t7507-commit-verbose.sh    | 29 +++++++++++++++++++++++++++++\n 4 files changed, 39 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 01cca0a..9b93f6c 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1110,6 +1110,10 @@ commit.template::\n \t\"`~/`\" is expanded to the value of `$HOME` and \"`~user/`\" to the\n \tspecified user's home directory.\n \n+commit.verbose::\n+\tA boolean to specify whether to always include the verbose option\n+\twith `git commit`. See linkgit:git-commit[1].\n+\n credential.helper::\n \tSpecify an external helper to be called when a username or\n \tpassword credential is needed; the helper may consult external\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex 9ec6b3c..d474226 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -290,7 +290,8 @@ configuration variable documented in linkgit:git-config[1].\n \twhat changes the commit has.\n \tNote that this diff output doesn't have its\n \tlines prefixed with '#'. This diff will not be a part\n-\tof the commit message.\n+\tof the commit message. See the `commit.verbose` configuration\n+\tvariable in linkgit:git-config[1].\n +\n If specified twice, show in addition the unified diff between\n what would be committed and the worktree files, i.e. the unstaged\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex b3bd2d4..e0b96231 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1505,6 +1505,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.verbose\")) {\n+\t\tverbose = git_config_bool(k, v);\n+\t\treturn 0;\n+\t}\n \n \tstatus = git_gpg_config(k, v, NULL);\n \tif (status)\ndiff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh\nindex 2ddf28c..35960b4 100755\n--- a/t/t7507-commit-verbose.sh\n+++ b/t/t7507-commit-verbose.sh\n@@ -96,4 +96,33 @@ test_expect_success 'verbose diff is stripped out with set core.commentChar' '\n \ttest_i18ngrep \"Aborting commit due to empty commit message.\" err\n '\n \n+test_expect_success 'commit.verbose true and --verbose omitted' '\n+\tgit -c commit.verbose=true commit --amend\n+'\n+\n+test_expect_success 'commit.verbose true and --no-verbose' '\n+\ttest_must_fail git -c commit.verbose=true commit --amend --no-verbose\n+'\n+\n+test_expect_success 'commit.verbose false and --verbose' '\n+\tgit -c commit.verbose=false commit --amend --verbose\n+'\n+\n+test_expect_success 'commit.verbose false and --verbose omitted' '\n+\ttest_must_fail git -c commit.verbose=false commit --amend\n+'\n+\n+test_expect_success 'commit.verbose true and --verbose' '\n+\tgit -c commit.verbose=true commit --amend --verbose\n+'\n+\n+test_expect_success 'commit.verbose false and --no-verbose' '\n+\ttest_must_fail git -c commit.verbose=false commit --amend --no-verbose\n+'\n+\n+test_expect_success 'status ignores commit.verbose=true' '\n+\tgit status >actual &&\n+\t! grep \"^diff --git\" actual\n+'\n+\n test_done\n\n--\nhttps://github.com/git/git/pull/205\n"},{"id":"280743","messageId":"CAPig+cRC5kZCtELhTh3em0bv+mfeR58AKd3Y76VM+0J+C+zzcw@mail.gmail.com","threadId":"41685","inReplyTo":"0102015376e53b40-d25f7fdc-4ae1-4aae-b779-052fcf252071-000000@eu-west-1.amazonses.com","subject":"Re: [PATCH v6] commit: add a commit.verbose config variable","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2016-03-14T21:21:19Z","receivedAt":"2016-03-14T21:21:19Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Mar 14, 2016 at 4:50 PM, Pranit Bauva <pranit.bauva@gmail.com> wrote:\n> Add commit.verbose configuration variable as a convenience for those\n> who always prefer --verbose.\n>\n> Helped-by: Eric Sunshine <sunshine@sunshineco.com>\n> Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>\n> ---\n> diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh\n> index 2ddf28c..35960b4 100755\n> --- a/t/t7507-commit-verbose.sh\n> +++ b/t/t7507-commit-verbose.sh\n> @@ -96,4 +96,33 @@ test_expect_success 'verbose diff is stripped out with set core.commentChar' '\n> +test_expect_success 'commit.verbose true and --verbose omitted' '\n> +       git -c commit.verbose=true commit --amend\n> +'\n> +\n> +test_expect_success 'commit.verbose true and --no-verbose' '\n> +       test_must_fail git -c commit.verbose=true commit --amend --no-verbose\n> +'\n> +\n> +test_expect_success 'commit.verbose false and --verbose' '\n> +       git -c commit.verbose=false commit --amend --verbose\n> +'\n> +\n> +test_expect_success 'commit.verbose false and --verbose omitted' '\n> +       test_must_fail git -c commit.verbose=false commit --amend\n> +'\n> +\n> +test_expect_success 'commit.verbose true and --verbose' '\n> +       git -c commit.verbose=true commit --amend --verbose\n> +'\n> +\n> +test_expect_success 'commit.verbose false and --no-verbose' '\n> +       test_must_fail git -c commit.verbose=false commit --amend --no-verbose\n> +'\n> +\n> +test_expect_success 'status ignores commit.verbose=true' '\n> +       git status >actual &&\n\nThis is missing the important \"-c commit.verbose=false\". Without it,\nyou're not really testing anything interesting.\n\n(It was missing in the \"something like this\" example test I typed\ndirectly in the email of my last review[1], which I suppose is a good\nlesson that \"something like this\" is not meant as \"final\" or \"trust\nthis\".)\n\n[1]: http://article.gmane.org/gmane.comp.version-control.git/288774\n\n> +       ! grep \"^diff --git\" actual\n> +'\n> +\n>  test_done\n"},{"id":"280744","messageId":"CAPig+cRzDbBu=wFmkUGUm58aJoz-4oecPWfbCc=4oO6geyKj5Q@mail.gmail.com","threadId":"41685","inReplyTo":"CAPig+cRC5kZCtELhTh3em0bv+mfeR58AKd3Y76VM+0J+C+zzcw@mail.gmail.com","subject":"Re: [PATCH v6] commit: add a commit.verbose config variable","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2016-03-14T21:24:47Z","receivedAt":"2016-03-14T21:24:47Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Mar 14, 2016 at 5:21 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n>> +test_expect_success 'status ignores commit.verbose=true' '\n>> +       git status >actual &&\n>\n> This is missing the important \"-c commit.verbose=false\". Without it,\n> you're not really testing anything interesting.\n>\n> (It was missing in the \"something like this\" example test I typed\n> directly in the email of my last review[1], which I suppose is a good\n> lesson that \"something like this\" is not meant as \"final\" or \"trust\n> this\".)\n\nThat wasn't an intentional omission on my part, by the way -- I wasn't\ntrying to mislead you -- it was just an example I typed on-the-fly\nwithout thinking too hard about it.\n"},{"id":"280747","messageId":"CAPig+cTj0AeAUPDm2MBE=72b98AU+0F90a6UwmorwrRoO0kx_A@mail.gmail.com","threadId":"41685","inReplyTo":"CAPig+cRC5kZCtELhTh3em0bv+mfeR58AKd3Y76VM+0J+C+zzcw@mail.gmail.com","subject":"Re: [PATCH v6] commit: add a commit.verbose config variable","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2016-03-14T21:32:59Z","receivedAt":"2016-03-14T21:32:59Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Mar 14, 2016 at 5:21 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n> This is missing the important \"-c commit.verbose=false\". Without it,\n\nI meant \"-c commit.verbose=true\", of course.\n\n> you're not really testing anything interesting.\n>\n> (It was missing in the \"something like this\" example test I typed\n> directly in the email of my last review[1], which I suppose is a good\n> lesson that \"something like this\" is not meant as \"final\" or \"trust\n> this\".)\n"}]}