{"thread":{"id":"36894","subject":"[PATCH v4 0/4] commit: support commit.verbose and --no-verbose","startedAt":"2014-06-11T18:24:35Z","lastAt":"2014-06-12T19:23:40Z","messageCount":15,"participants":["caleb@calebthompson.io","René Scharfe","Caleb Thompson","Jeremiah Mahler"],"isPatch":true,"patchVersion":4,"patchTotal":4},"messages":[{"id":"243916","messageId":"1402511079-17735-1-git-send-email-caleb@calebthompson.io","threadId":"36894","inReplyTo":null,"subject":"[PATCH v4 0/4] commit: support commit.verbose and --no-verbose","fromName":"","fromEmail":"caleb@calebthompson.io","sentAt":"2014-06-11T18:24:35Z","receivedAt":"2014-06-11T18:24:35Z","isPatch":true,"sender":{"key":"caleb@calebthompson.io","avatar":"https://gravatar.com/avatar/0440c826b3dfa9dd7f768e4b661935a3a2584612a2fcd261f6914ced0457ab4d?d=mp&s=160"},"body":"This patch allows people to set commit.verbose to implicitly send\n--verbose to git-commit. It also introduces --no-verbose to override the\nconfiguration setting.\n\nThis version incorporates changes suggested by Eric Sunshine, Duy\nNguyen, and Jeremiah Mahler.\n\nIt introduces several cleanup patches to t/t7505-commit-verbose.sh to\nbring it closer to the current state of the tests as Eric has explained\nthem to me, then adds the verbose config and --no-verbose flag.\n\nSince the last version of this patch\n(http://marc.info/?l=git&m=140113063517118&w=2), I've made the following\nchanges:\n\n* Remove the $PWD => $(pwd) change, as it was a misunderstanding of\n  t/README (Thank you to Johannes and David for pointing that out and\n  clarifying)\n* Use consistent test naming (Thanks to Jeremiah)\n* Switch from <<-EOF to <<-'EOF' without manual escaping in write_script\n  calls for the test editors check-for-diff and check-for-no-diff. The\n  proposed <<-\\EOF syntax did not properly prevent the parameter\n  substitution on my machine, as both Eric and the documentation\n  suggested it should, but the quoted version seems to work fine.\n  (Thanks to Eric)\n* Fix extra test_set_editor invocations and broken %%-chains created as a result\n  of the test_set_editor changes. (Thanks again to Eric)\n\n------------------------------------------------------\n\nCaleb Thompson (4):\n      commit test: Use test_config instead of git-config\n      commit test: Use write_script\n      commit test: test_set_editor in each test\n      commit: support commit.verbose and --no-verbose\n\n Documentation/config.txt               |  5 +++++\n Documentation/git-commit.txt           |  8 +++++++-\n builtin/commit.c                       |  6 +++++-\n contrib/completion/git-completion.bash |  1 +\n t/t7507-commit-verbose.sh              | 64 +++++++++++++++++++++++++++++++++++++++++++++++-----------------\n 5 files changed, 65 insertions(+), 19 deletions(-)\n"},{"id":"243917","messageId":"1402511079-17735-2-git-send-email-caleb@calebthompson.io","threadId":"36894","inReplyTo":"1402511079-17735-1-git-send-email-caleb@calebthompson.io","subject":"[PATCH v4 1/4] commit test: Use test_config instead of git-config","fromName":"","fromEmail":"caleb@calebthompson.io","sentAt":"2014-06-11T18:24:36Z","receivedAt":"2014-06-11T18:24:36Z","isPatch":true,"sender":{"key":"caleb@calebthompson.io","avatar":"https://gravatar.com/avatar/0440c826b3dfa9dd7f768e4b661935a3a2584612a2fcd261f6914ced0457ab4d?d=mp&s=160"},"body":"Some of the tests in t/t7507-commit-verbose.sh were still using\ngit-config to set configuration. Change them to use the test_config\nhelper.\n\nSigned-off-by: Caleb Thompson <caleb@calebthompson.io>\n---\n t/t7507-commit-verbose.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh\nindex 2ddf28c..6d778ed 100755\n--- a/t/t7507-commit-verbose.sh\n+++ b/t/t7507-commit-verbose.sh\n@@ -43,7 +43,7 @@ test_expect_success 'verbose diff is stripped out' '\n '\n\n test_expect_success 'verbose diff is stripped out (mnemonicprefix)' '\n-\tgit config diff.mnemonicprefix true &&\n+\ttest_config diff.mnemonicprefix true &&\n\tgit commit --amend -v &&\n\tcheck_message message\n '\n@@ -71,7 +71,7 @@ test_expect_success 'diff in message is retained with -v' '\n '\n\n test_expect_success 'submodule log is stripped out too with -v' '\n-\tgit config diff.submodule log &&\n+\ttest_config diff.submodule log &&\n\tgit submodule add ./. sub &&\n\tgit commit -m \"sub added\" &&\n\t(\n--\n2.0.0\n"},{"id":"243918","messageId":"1402511079-17735-3-git-send-email-caleb@calebthompson.io","threadId":"36894","inReplyTo":"1402511079-17735-1-git-send-email-caleb@calebthompson.io","subject":"[PATCH v4 2/4] commit test: Use write_script","fromName":"","fromEmail":"caleb@calebthompson.io","sentAt":"2014-06-11T18:24:37Z","receivedAt":"2014-06-11T18:24:37Z","isPatch":true,"sender":{"key":"caleb@calebthompson.io","avatar":"https://gravatar.com/avatar/0440c826b3dfa9dd7f768e4b661935a3a2584612a2fcd261f6914ced0457ab4d?d=mp&s=160"},"body":"Use write_script from t/test-lib-functions.sh instead of cat, shebang,\nand chmod. This protects us from potential shell meta-characters in the\nname of our trash directory, which would be interpreted if we set\n$EDITOR directly.\n\nSigned-off-by: Caleb Thompson <caleb@calebthompson.io>\n---\n t/t7507-commit-verbose.sh | 6 ++----\n 1 file changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh\nindex 6d778ed..db09107 100755\n--- a/t/t7507-commit-verbose.sh\n+++ b/t/t7507-commit-verbose.sh\n@@ -3,11 +3,9 @@\n test_description='verbose commit template'\n . ./test-lib.sh\n\n-cat >check-for-diff <<EOF\n-#!$SHELL_PATH\n-exec grep '^diff --git' \"\\$1\"\n+write_script check-for-diff <<-'EOF'\n+\texec grep '^diff --git' \"$1\"\n EOF\n-chmod +x check-for-diff\n test_set_editor \"$PWD/check-for-diff\"\n\n cat >message <<'EOF'\n--\n2.0.0\n"},{"id":"243919","messageId":"1402511079-17735-4-git-send-email-caleb@calebthompson.io","threadId":"36894","inReplyTo":"1402511079-17735-1-git-send-email-caleb@calebthompson.io","subject":"[PATCH v4 3/4] commit test: test_set_editor in each test","fromName":"","fromEmail":"caleb@calebthompson.io","sentAt":"2014-06-11T18:24:38Z","receivedAt":"2014-06-11T18:24:38Z","isPatch":true,"sender":{"key":"caleb@calebthompson.io","avatar":"https://gravatar.com/avatar/0440c826b3dfa9dd7f768e4b661935a3a2584612a2fcd261f6914ced0457ab4d?d=mp&s=160"},"body":"t/t7507-commit-verbose.sh was using a global test_set_editor call to\nbuild its environment.\n\nImprove robustness against global state changes by having only tests\nwhich intend to use the $EDITOR to check for presence of a diff in the\neditor set up the test-editor to use check-for-diff rather than relying\nupon the editor set once at script start.\n\nBesides being in line with current practices, it also allows the tests\nwhich set GIT_EDITOR=cat manually to avoid using a subshell and simplify\ntheir logic.\n\nSigned-off-by: Caleb Thompson <caleb@calebthompson.io>\n---\n t/t7507-commit-verbose.sh | 18 +++++++-----------\n 1 file changed, 7 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh\nindex db09107..35a4d06 100755\n--- a/t/t7507-commit-verbose.sh\n+++ b/t/t7507-commit-verbose.sh\n@@ -6,7 +6,6 @@ test_description='verbose commit template'\n write_script check-for-diff <<-'EOF'\n\texec grep '^diff --git' \"$1\"\n EOF\n-test_set_editor \"$PWD/check-for-diff\"\n\n cat >message <<'EOF'\n subject\n@@ -21,6 +20,7 @@ test_expect_success 'setup' '\n '\n\n test_expect_success 'initial commit shows verbose diff' '\n+\ttest_set_editor \"$PWD/check-for-diff\" &&\n\tgit commit --amend -v\n '\n\n@@ -36,11 +36,13 @@ check_message() {\n }\n\n test_expect_success 'verbose diff is stripped out' '\n+\ttest_set_editor \"$PWD/check-for-diff\" &&\n\tgit commit --amend -v &&\n\tcheck_message message\n '\n\n test_expect_success 'verbose diff is stripped out (mnemonicprefix)' '\n+\ttest_set_editor \"$PWD/check-for-diff\" &&\n\ttest_config diff.mnemonicprefix true &&\n\tgit commit --amend -v &&\n\tcheck_message message\n@@ -77,20 +79,14 @@ test_expect_success 'submodule log is stripped out too with -v' '\n\t\techo \"more\" >>file &&\n\t\tgit commit -a -m \"submodule commit\"\n\t) &&\n-\t(\n-\t\tGIT_EDITOR=cat &&\n-\t\texport GIT_EDITOR &&\n-\t\ttest_must_fail git commit -a -v 2>err\n-\t) &&\n+\ttest_set_editor cat &&\n+\ttest_must_fail git commit -a -v 2>err &&\n\ttest_i18ngrep \"Aborting commit due to empty commit message.\" err\n '\n\n test_expect_success 'verbose diff is stripped out with set core.commentChar' '\n-\t(\n-\t\tGIT_EDITOR=cat &&\n-\t\texport GIT_EDITOR &&\n-\t\ttest_must_fail git -c core.commentchar=\";\" commit -a -v 2>err\n-\t) &&\n+\ttest_set_editor cat &&\n+\ttest_must_fail git -c core.commentchar=\";\" commit -a -v 2>err &&\n\ttest_i18ngrep \"Aborting commit due to empty commit message.\" err\n '\n\n--\n2.0.0\n"},{"id":"243920","messageId":"1402511079-17735-5-git-send-email-caleb@calebthompson.io","threadId":"36894","inReplyTo":"1402511079-17735-1-git-send-email-caleb@calebthompson.io","subject":"[PATCH v4 4/4] commit: support commit.verbose and --no-verbose","fromName":"","fromEmail":"caleb@calebthompson.io","sentAt":"2014-06-11T18:24:39Z","receivedAt":"2014-06-11T18:24:39Z","isPatch":true,"sender":{"key":"caleb@calebthompson.io","avatar":"https://gravatar.com/avatar/0440c826b3dfa9dd7f768e4b661935a3a2584612a2fcd261f6914ced0457ab4d?d=mp&s=160"},"body":"Add a new configuration variable commit.verbose to implicitly pass\n`--verbose` to `git-commit`. Add `--no-verbose` to commit to negate that\nsetting.\n\nSigned-off-by: Caleb Thompson <caleb@calebthompson.io>\n---\n Documentation/config.txt               |  5 +++++\n Documentation/git-commit.txt           |  8 +++++++-\n builtin/commit.c                       |  6 +++++-\n contrib/completion/git-completion.bash |  1 +\n t/t7507-commit-verbose.sh              | 36 ++++++++++++++++++++++++++++++++++\n 5 files changed, 54 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex cd2d651..ec51e1c 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1017,6 +1017,11 @@ 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 enable/disable inclusion of diff information in the\n+\tcommit message template when using an editor to prepare the commit\n+\tmessage.  Defaults to false.\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 0bbc8f5..8cb3439 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -282,7 +282,13 @@ configuration variable documented in linkgit:git-config[1].\n\tShow unified diff between the HEAD commit and what\n\twould be committed at the bottom of the commit message\n\ttemplate.  Note that this diff output doesn't have its\n-\tlines prefixed with '#'.\n+\tlines prefixed with '#'.  The `commit.verbose` configuration\n+\tvariable can be set to true to implicitly send this option.\n+\n+--no-verbose::\n+\tDo not show the unified diff at the bottom of the commit message\n+\ttemplate.  This is the default behavior, but can be used to override\n+\tthe `commit.verbose` configuration variable.\n\n -q::\n --quiet::\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 99c2044..c5b20c6 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1489,6 +1489,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)\n@@ -1556,7 +1560,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n\tstatic struct wt_status s;\n\tstatic struct option builtin_commit_options[] = {\n\t\tOPT__QUIET(&quiet, N_(\"suppress summary after successful commit\")),\n-\t\tOPT__VERBOSE(&verbose, N_(\"show diff in commit message template\")),\n+\t\tOPT_BOOL('v', \"verbose\", &verbose, N_(\"show diff in commit message template\")),\n\n\t\tOPT_GROUP(N_(\"Commit message options\")),\n\t\tOPT_FILENAME('F', \"file\", &logfile, N_(\"read message from file\")),\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 2c59a76..b8f4b94 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1976,6 +1976,7 @@ _git_config ()\n\t\tcolor.ui\n\t\tcommit.status\n\t\tcommit.template\n+\t\tcommit.verbose\n\t\tcore.abbrev\n\t\tcore.askpass\n\t\tcore.attributesfile\ndiff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh\nindex 35a4d06..512eef3 100755\n--- a/t/t7507-commit-verbose.sh\n+++ b/t/t7507-commit-verbose.sh\n@@ -7,6 +7,10 @@ write_script check-for-diff <<-'EOF'\n\texec grep '^diff --git' \"$1\"\n EOF\n\n+write_script check-for-no-diff <<-EOF\n+\texec grep -v '^diff --git' \"\\$1\"\n+EOF\n+\n cat >message <<'EOF'\n subject\n\n@@ -48,6 +52,38 @@ test_expect_success 'verbose diff is stripped out (mnemonicprefix)' '\n\tcheck_message message\n '\n\n+test_expect_success 'commit shows verbose diff with commit.verbose true' '\n+\techo morecontent >>file &&\n+\tgit add file &&\n+\ttest_config commit.verbose true &&\n+\ttest_set_editor \"$PWD/check-for-diff\" &&\n+\tgit commit --amend\n+'\n+\n+test_expect_success 'commit --verbose overrides commit.verbose false' '\n+\techo evenmorecontent >>file &&\n+\tgit add file &&\n+\ttest_config commit.verbose false  &&\n+\ttest_set_editor \"$PWD/check-for-diff\" &&\n+\tgit commit --amend --verbose\n+'\n+\n+test_expect_success 'commit does not show verbose diff with commit.verbose false' '\n+\techo evenmorecontent >>file &&\n+\tgit add file &&\n+\ttest_config commit.verbose false &&\n+\ttest_set_editor \"$PWD/check-for-no-diff\" &&\n+\tgit commit --amend\n+'\n+\n+test_expect_success 'commit --no-verbose overrides commit.verbose true' '\n+\techo evenmorecontent >>file &&\n+\tgit add file &&\n+\ttest_config commit.verbose true &&\n+\ttest_set_editor \"$PWD/check-for-no-diff\" &&\n+\tgit commit --amend --no-verbose\n+'\n+\n cat >diff <<'EOF'\n This is an example commit message that contains a diff.\n\n--\n2.0.0\n"},{"id":"243925","messageId":"5398BEDE.1040305@web.de","threadId":"36894","inReplyTo":"1402511079-17735-5-git-send-email-caleb@calebthompson.io","subject":"Re: [PATCH v4 4/4] commit: support commit.verbose and --no-verbose","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2014-06-11T20:41:02Z","receivedAt":"2014-06-11T20:41:02Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 11.06.2014 20:24, schrieb caleb@calebthompson.io:\n> Add a new configuration variable commit.verbose to implicitly pass\n> `--verbose` to `git-commit`. Add `--no-verbose` to commit to negate that\n> setting.\n>\n> Signed-off-by: Caleb Thompson<caleb@calebthompson.io>\n> ---\n>   Documentation/config.txt               |  5 +++++\n>   Documentation/git-commit.txt           |  8 +++++++-\n>   builtin/commit.c                       |  6 +++++-\n>   contrib/completion/git-completion.bash |  1 +\n>   t/t7507-commit-verbose.sh              | 36 ++++++++++++++++++++++++++++++++++\n>   5 files changed, 54 insertions(+), 2 deletions(-)\n>\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index cd2d651..ec51e1c 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -1017,6 +1017,11 @@ 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 enable/disable inclusion of diff information in the\n> +\tcommit message template when using an editor to prepare the commit\n> +\tmessage.  Defaults to false.\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\n> diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\n> index 0bbc8f5..8cb3439 100644\n> --- a/Documentation/git-commit.txt\n> +++ b/Documentation/git-commit.txt\n> @@ -282,7 +282,13 @@ configuration variable documented in linkgit:git-config[1].\n> \tShow unified diff between the HEAD commit and what\n> \twould be committed at the bottom of the commit message\n> \ttemplate.  Note that this diff output doesn't have its\n> -\tlines prefixed with '#'.\n> +\tlines prefixed with '#'.  The `commit.verbose` configuration\n> +\tvariable can be set to true to implicitly send this option.\n> +\n> +--no-verbose::\n> +\tDo not show the unified diff at the bottom of the commit message\n> +\ttemplate.  This is the default behavior, but can be used to override\n> +\tthe `commit.verbose` configuration variable.\n>\n>   -q::\n>   --quiet::\n> diff --git a/builtin/commit.c b/builtin/commit.c\n> index 99c2044..c5b20c6 100644\n> --- a/builtin/commit.c\n> +++ b/builtin/commit.c\n> @@ -1489,6 +1489,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)\n\n> @@ -1556,7 +1560,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n> \tstatic struct wt_status s;\n> \tstatic struct option builtin_commit_options[] = {\n> \t\tOPT__QUIET(&quiet, N_(\"suppress summary after successful commit\")),\n> -\t\tOPT__VERBOSE(&verbose, N_(\"show diff in commit message template\")),\n> +\t\tOPT_BOOL('v', \"verbose\", &verbose, N_(\"show diff in commit message template\")),\n\nHmm, this hunk seems to make sure that there can only be two verbosity \nlevels, 0 and 1, while before there could be higher levels (which \nproduce the same output as verbose = 1).  This change is not mentioned \nin the commit message.  Why is it necessary?\n\nNB: --no-verbose already works without this hunk.\n\n> \t\tOPT_GROUP(N_(\"Commit message options\")),\n> \t\tOPT_FILENAME('F', \"file\", &logfile, N_(\"read message from file\")),\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 2c59a76..b8f4b94 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1976,6 +1976,7 @@ _git_config ()\n> \t\tcolor.ui\n> \t\tcommit.status\n> \t\tcommit.template\n> +\t\tcommit.verbose\n> \t\tcore.abbrev\n> \t\tcore.askpass\n> \t\tcore.attributesfile\n> diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh\n> index 35a4d06..512eef3 100755\n> --- a/t/t7507-commit-verbose.sh\n> +++ b/t/t7507-commit-verbose.sh\n> @@ -7,6 +7,10 @@ write_script check-for-diff <<-'EOF'\n> \texec grep '^diff --git' \"$1\"\n>   EOF\n>\n> +write_script check-for-no-diff <<-EOF\n> +\texec grep -v '^diff --git' \"\\$1\"\n> +EOF\n> +\n>   cat >message <<'EOF'\n>   subject\n>\n> @@ -48,6 +52,38 @@ test_expect_success 'verbose diff is stripped out (mnemonicprefix)' '\n> \tcheck_message message\n>   '\n>\n> +test_expect_success 'commit shows verbose diff with commit.verbose true' '\n> +\techo morecontent >>file &&\n> +\tgit add file &&\n> +\ttest_config commit.verbose true &&\n> +\ttest_set_editor \"$PWD/check-for-diff\" &&\n> +\tgit commit --amend\n> +'\n> +\n> +test_expect_success 'commit --verbose overrides commit.verbose false' '\n> +\techo evenmorecontent >>file &&\n> +\tgit add file &&\n> +\ttest_config commit.verbose false  &&\n> +\ttest_set_editor \"$PWD/check-for-diff\" &&\n> +\tgit commit --amend --verbose\n> +'\n> +\n> +test_expect_success 'commit does not show verbose diff with commit.verbose false' '\n> +\techo evenmorecontent >>file &&\n> +\tgit add file &&\n> +\ttest_config commit.verbose false &&\n> +\ttest_set_editor \"$PWD/check-for-no-diff\" &&\n> +\tgit commit --amend\n> +'\n> +\n> +test_expect_success 'commit --no-verbose overrides commit.verbose true' '\n> +\techo evenmorecontent >>file &&\n> +\tgit add file &&\n> +\ttest_config commit.verbose true &&\n> +\ttest_set_editor \"$PWD/check-for-no-diff\" &&\n> +\tgit commit --amend --no-verbose\n> +'\n> +\n>   cat >diff <<'EOF'\n>   This is an example commit message that contains a diff.\n>\n> --\n> 2.0.0\n>\n"},{"id":"243927","messageId":"20140611212247.GB30119@sirius.local","threadId":"36894","inReplyTo":"5398BEDE.1040305@web.de","subject":"Re: [PATCH v4 4/4] commit: support commit.verbose and --no-verbose","fromName":"Caleb Thompson","fromEmail":"caleb@calebthompson.io","sentAt":"2014-06-11T21:26:30Z","receivedAt":"2014-06-11T21:26:30Z","isPatch":true,"sender":{"key":"caleb@calebthompson.io","avatar":"https://gravatar.com/avatar/0440c826b3dfa9dd7f768e4b661935a3a2584612a2fcd261f6914ced0457ab4d?d=mp&s=160"},"body":"On Wed, Jun 11, 2014, at 01:41 PM, René Scharfe wrote:\n>> @@ -1556,7 +1560,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n>>  static struct wt_status s;\n>>  static struct option builtin_commit_options[] = {\n>>    OPT__QUIET(&quiet, N_(\"suppress summary after successful commit\")),\n>> -    OPT__VERBOSE(&verbose, N_(\"show diff in commit message template\")),\n>> +    OPT_BOOL('v', \"verbose\", &verbose, N_(\"show diff in commit message template\")),\n>\n>Hmm, this hunk seems to make sure that there can only be two verbosity\n>levels, 0 and 1, while before there could be higher levels (which\n>produce the same output as verbose = 1).  This change is not mentioned\n>in the commit message.  Why is it necessary?\n>\n>NB: --no-verbose already works without this hunk.\n\nI had no idea, but you're quite right. I suppose that option was just a no-op\nbefore, or could cancel a previous --verbose flag?\n\nUpdated diff with that hunk removed follows. I rebuilt the branch and the tests\nI added for --no-verbose work as expected, as does actually using the\nflag/config with the local build.\n\nCaleb Thompson\n\n------------------------ >8 ------------------------\n\nAdd a new configuration variable commit.verbose to implicitly pass\n`--verbose` to `git-commit`. Add `--no-verbose` to commit to negate that\nsetting.\n\nSigned-off-by: Caleb Thompson <caleb@calebthompson.io>\n---\n Documentation/config.txt               |  5 +++++\n Documentation/git-commit.txt           |  8 +++++++-\n builtin/commit.c                       |  4 ++++\n contrib/completion/git-completion.bash |  1 +\n t/t7507-commit-verbose.sh              | 36 ++++++++++++++++++++++++++++++++++\n 5 files changed, 53 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex cd2d651..ec51e1c 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1017,6 +1017,11 @@ commit.template::\n  \"`~/`\" is expanded to the value of `$HOME` and \"`~user/`\" to the\n  specified user's home directory.\n\n+commit.verbose::\n+ A boolean to enable/disable inclusion of diff information in the\n+ commit message template when using an editor to prepare the commit\n+ message.  Defaults to false.\n+\n credential.helper::\n  Specify an external helper to be called when a username or\n  password credential is needed; the helper may consult external\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex 0bbc8f5..8cb3439 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -282,7 +282,13 @@ configuration variable documented in linkgit:git-config[1].\n  Show unified diff between the HEAD commit and what\n  would be committed at the bottom of the commit message\n  template.  Note that this diff output doesn't have its\n- lines prefixed with '#'.\n+ lines prefixed with '#'.  The `commit.verbose` configuration\n+ variable can be set to true to implicitly send this option.\n+\n+--no-verbose::\n+ Do not show the unified diff at the bottom of the commit message\n+ template.  This is the default behavior, but can be used to override\n+ the `commit.verbose` configuration variable.\n\n -q::\n --quiet::\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 99c2044..c782388 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1489,6 +1489,10 @@ static int git_commit_config(const char *k, const char *v, void *cb)\n    sign_commit = git_config_bool(k, v) ? \"\" : NULL;\n    return 0;\n  }\n+ if (!strcmp(k, \"commit.verbose\")) {\n+   verbose = git_config_bool(k, v);\n+   return 0;\n+ }\n\n  status = git_gpg_config(k, v, NULL);\n  if (status)\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 2c59a76..b8f4b94 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1976,6 +1976,7 @@ _git_config ()\n    color.ui\n    commit.status\n    commit.template\n+   commit.verbose\n    core.abbrev\n    core.askpass\n    core.attributesfile\ndiff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh\nindex 35a4d06..512eef3 100755\n--- a/t/t7507-commit-verbose.sh\n+++ b/t/t7507-commit-verbose.sh\n@@ -7,6 +7,10 @@ write_script check-for-diff <<-'EOF'\n  exec grep '^diff --git' \"$1\"\n EOF\n\n+write_script check-for-no-diff <<-EOF\n+ exec grep -v '^diff --git' \"\\$1\"\n+EOF\n+\n cat >message <<'EOF'\n subject\n\n@@ -48,6 +52,38 @@ test_expect_success 'verbose diff is stripped out (mnemonicprefix)' '\n  check_message message\n '\n\n+test_expect_success 'commit shows verbose diff with commit.verbose true' '\n+ echo morecontent >>file &&\n+ git add file &&\n+ test_config commit.verbose true &&\n+ test_set_editor \"$PWD/check-for-diff\" &&\n+ git commit --amend\n+'\n+\n+test_expect_success 'commit --verbose overrides commit.verbose false' '\n+ echo evenmorecontent >>file &&\n+ git add file &&\n+ test_config commit.verbose false  &&\n+ test_set_editor \"$PWD/check-for-diff\" &&\n+ git commit --amend --verbose\n+'\n+\n+test_expect_success 'commit does not show verbose diff with commit.verbose false' '\n+ echo evenmorecontent >>file &&\n+ git add file &&\n+ test_config commit.verbose false &&\n+ test_set_editor \"$PWD/check-for-no-diff\" &&\n+ git commit --amend\n+'\n+\n+test_expect_success 'commit --no-verbose overrides commit.verbose true' '\n+ echo evenmorecontent >>file &&\n+ git add file &&\n+ test_config commit.verbose true &&\n+ test_set_editor \"$PWD/check-for-no-diff\" &&\n+ git commit --amend --no-verbose\n+'\n+\n cat >diff <<'EOF'\n This is an example commit message that contains a diff.\n\n--\n2.0.0\n"},{"id":"243943","messageId":"20140612084152.GA6095@hudson.localdomain","threadId":"36894","inReplyTo":"1402511079-17735-2-git-send-email-caleb@calebthompson.io","subject":"Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config","fromName":"Jeremiah Mahler","fromEmail":"jmmahler@gmail.com","sentAt":"2014-06-12T08:41:52Z","receivedAt":"2014-06-12T08:41:52Z","isPatch":true,"sender":{"key":"jmmahler@gmail.com","avatar":"https://avatars.githubusercontent.com/u/154028?v=4"},"body":"On Wed, Jun 11, 2014 at 01:24:36PM -0500, caleb@calebthompson.io wrote:\n> Some of the tests in t/t7507-commit-verbose.sh were still using\n> git-config to set configuration. Change them to use the test_config\n> helper.\n> \n> Signed-off-by: Caleb Thompson <caleb@calebthompson.io>\n> ---\n>  t/t7507-commit-verbose.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh\n> index 2ddf28c..6d778ed 100755\n> --- a/t/t7507-commit-verbose.sh\n> +++ b/t/t7507-commit-verbose.sh\n> @@ -43,7 +43,7 @@ test_expect_success 'verbose diff is stripped out' '\n>  '\n> \n>  test_expect_success 'verbose diff is stripped out (mnemonicprefix)' '\n> -\tgit config diff.mnemonicprefix true &&\n> +\ttest_config diff.mnemonicprefix true &&\n> \tgit commit --amend -v &&\n> \tcheck_message message\n>  '\n> @@ -71,7 +71,7 @@ test_expect_success 'diff in message is retained with -v' '\n>  '\n> \n>  test_expect_success 'submodule log is stripped out too with -v' '\n> -\tgit config diff.submodule log &&\n> +\ttest_config diff.submodule log &&\n> \tgit submodule add ./. sub &&\n> \tgit commit -m \"sub added\" &&\n> \t(\n> --\n> 2.0.0\n> \n\nIt is probably something dumb on my part but for some reason I cannot\napply this patch using 'git am'.  After I save the patch to a Maildir\nfrom Mutt and run git am...\n\n  jeri@hudson:~/git$ ./git-am ct1.patch\n  Applying: commit test: Use test_config instead of git-config\n  fatal: corrupt patch at line 15\n  Patch failed at 0001 commit test: Use test_config instead of git-config\n  The copy of the patch that failed is found in:\n     /home/jeri/git/.git/rebase-apply/patch\n  When you have resolved this problem, run \"git am --continue\".\n  If you prefer to skip this patch, run \"git am --skip\" instead.\n  To restore the original branch and stop patching, run \"git am --abort\".\n  jeri@hudson:~/git$\n\nThe second patch in the series applies fine.  And I have applied other\npatches this way without issue.  Can anyone confirm this problem?\n\n-- \nJeremiah Mahler\njmmahler@gmail.com\nhttp://github.com/jmahler\n"},{"id":"243945","messageId":"20140612135051.GA35824@sirius.local","threadId":"36894","inReplyTo":"20140612084152.GA6095@hudson.localdomain","subject":"Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config","fromName":"Caleb Thompson","fromEmail":"caleb@calebthompson.io","sentAt":"2014-06-12T13:51:31Z","receivedAt":"2014-06-12T13:51:31Z","isPatch":true,"sender":{"key":"caleb@calebthompson.io","avatar":"https://gravatar.com/avatar/0440c826b3dfa9dd7f768e4b661935a3a2584612a2fcd261f6914ced0457ab4d?d=mp&s=160"},"body":"I assume that you're running it against master?\n\nI rebased the branch yesterday, but I'll give it another shot. Obviously I\ndidn't use git-am, but I can try that.\n\nCaleb Thompson\n\nOn Thu, Jun 12, 2014 at 01:41:52AM -0700, Jeremiah Mahler wrote:\n> On Wed, Jun 11, 2014 at 01:24:36PM -0500, caleb@calebthompson.io wrote:\n> > Some of the tests in t/t7507-commit-verbose.sh were still using\n> > git-config to set configuration. Change them to use the test_config\n> > helper.\n> >\n> > Signed-off-by: Caleb Thompson <caleb@calebthompson.io>\n> > ---\n> >  t/t7507-commit-verbose.sh | 4 ++--\n> >  1 file changed, 2 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh\n> > index 2ddf28c..6d778ed 100755\n> > --- a/t/t7507-commit-verbose.sh\n> > +++ b/t/t7507-commit-verbose.sh\n> > @@ -43,7 +43,7 @@ test_expect_success 'verbose diff is stripped out' '\n> >  '\n> >\n> >  test_expect_success 'verbose diff is stripped out (mnemonicprefix)' '\n> > -\tgit config diff.mnemonicprefix true &&\n> > +\ttest_config diff.mnemonicprefix true &&\n> >\tgit commit --amend -v &&\n> >\tcheck_message message\n> >  '\n> > @@ -71,7 +71,7 @@ test_expect_success 'diff in message is retained with -v' '\n> >  '\n> >\n> >  test_expect_success 'submodule log is stripped out too with -v' '\n> > -\tgit config diff.submodule log &&\n> > +\ttest_config diff.submodule log &&\n> >\tgit submodule add ./. sub &&\n> >\tgit commit -m \"sub added\" &&\n> >\t(\n> > --\n> > 2.0.0\n> >\n>\n> It is probably something dumb on my part but for some reason I cannot\n> apply this patch using 'git am'.  After I save the patch to a Maildir\n> from Mutt and run git am...\n>\n>   jeri@hudson:~/git$ ./git-am ct1.patch\n>   Applying: commit test: Use test_config instead of git-config\n>   fatal: corrupt patch at line 15\n>   Patch failed at 0001 commit test: Use test_config instead of git-config\n>   The copy of the patch that failed is found in:\n>      /home/jeri/git/.git/rebase-apply/patch\n>   When you have resolved this problem, run \"git am --continue\".\n>   If you prefer to skip this patch, run \"git am --skip\" instead.\n>   To restore the original branch and stop patching, run \"git am --abort\".\n>   jeri@hudson:~/git$\n>\n> The second patch in the series applies fine.  And I have applied other\n> patches this way without issue.  Can anyone confirm this problem?\n>\n> --\n> Jeremiah Mahler\n> jmmahler@gmail.com\n> http://github.com/jmahler\n"},{"id":"243946","messageId":"20140612143610.GA38048@sirius.local","threadId":"36894","inReplyTo":"20140611212247.GB30119@sirius.local","subject":"Re: [PATCH v4 4/4] commit: support commit.verbose and --no-verbose","fromName":"Caleb Thompson","fromEmail":"caleb@calebthompson.io","sentAt":"2014-06-12T14:36:10Z","receivedAt":"2014-06-12T14:36:10Z","isPatch":true,"sender":{"key":"caleb@calebthompson.io","avatar":"https://gravatar.com/avatar/0440c826b3dfa9dd7f768e4b661935a3a2584612a2fcd261f6914ced0457ab4d?d=mp&s=160"},"body":"Another update to also use quotes around the check-for-no-diff script body.\n\nIf I don't get any more feedback in the next few hours I'll send another full\nversion of the patch.\n\nCaleb Thompson\n\n------------------------ >8 ------------------------\n\nAdd a new configuration variable commit.verbose to implicitly pass\n`--verbose` to `git-commit`. Add `--no-verbose` to commit to negate that\nsetting.\n\nSigned-off-by: Caleb Thompson <caleb@calebthompson.io>\n---\n Documentation/config.txt               |  5 +++++\n Documentation/git-commit.txt           |  8 +++++++-\n builtin/commit.c                       |  4 ++++\n contrib/completion/git-completion.bash |  1 +\n t/t7507-commit-verbose.sh              | 36 ++++++++++++++++++++++++++++++++++\n 5 files changed, 53 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex cd2d651..ec51e1c 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1017,6 +1017,11 @@ commit.template::\n  \"`~/`\" is expanded to the value of `$HOME` and \"`~user/`\" to the\n  specified user's home directory.\n\n+commit.verbose::\n+ A boolean to enable/disable inclusion of diff information in the\n+ commit message template when using an editor to prepare the commit\n+ message.  Defaults to false.\n+\n credential.helper::\n  Specify an external helper to be called when a username or\n  password credential is needed; the helper may consult external\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex 0bbc8f5..8cb3439 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -282,7 +282,13 @@ configuration variable documented in linkgit:git-config[1].\n  Show unified diff between the HEAD commit and what\n  would be committed at the bottom of the commit message\n  template.  Note that this diff output doesn't have its\n- lines prefixed with '#'.\n+ lines prefixed with '#'.  The `commit.verbose` configuration\n+ variable can be set to true to implicitly send this option.\n+\n+--no-verbose::\n+ Do not show the unified diff at the bottom of the commit message\n+ template.  This is the default behavior, but can be used to override\n+ the `commit.verbose` configuration variable.\n\n -q::\n --quiet::\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 99c2044..c782388 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1489,6 +1489,10 @@ static int git_commit_config(const char *k, const char *v, void *cb)\n    sign_commit = git_config_bool(k, v) ? \"\" : NULL;\n    return 0;\n  }\n+ if (!strcmp(k, \"commit.verbose\")) {\n+   verbose = git_config_bool(k, v);\n+   return 0;\n+ }\n\n  status = git_gpg_config(k, v, NULL);\n  if (status)\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 2c59a76..b8f4b94 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1976,6 +1976,7 @@ _git_config ()\n    color.ui\n    commit.status\n    commit.template\n+   commit.verbose\n    core.abbrev\n    core.askpass\n    core.attributesfile\ndiff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh\nindex 35a4d06..402d6a1 100755\n--- a/t/t7507-commit-verbose.sh\n+++ b/t/t7507-commit-verbose.sh\n@@ -7,6 +7,10 @@ write_script check-for-diff <<-'EOF'\n  exec grep '^diff --git' \"$1\"\n EOF\n\n+write_script check-for-no-diff <<-'EOF'\n+ exec grep -v '^diff --git' \"$1\"\n+EOF\n+\n cat >message <<'EOF'\n subject\n\n@@ -48,6 +52,38 @@ test_expect_success 'verbose diff is stripped out (mnemonicprefix)' '\n  check_message message\n '\n\n+test_expect_success 'commit shows verbose diff with commit.verbose true' '\n+ echo morecontent >>file &&\n+ git add file &&\n+ test_config commit.verbose true &&\n+ test_set_editor \"$PWD/check-for-diff\" &&\n+ git commit --amend\n+'\n+\n+test_expect_success 'commit --verbose overrides commit.verbose false' '\n+ echo evenmorecontent >>file &&\n+ git add file &&\n+ test_config commit.verbose false  &&\n+ test_set_editor \"$PWD/check-for-diff\" &&\n+ git commit --amend --verbose\n+'\n+\n+test_expect_success 'commit does not show verbose diff with commit.verbose false' '\n+ echo evenmorecontent >>file &&\n+ git add file &&\n+ test_config commit.verbose false &&\n+ test_set_editor \"$PWD/check-for-no-diff\" &&\n+ git commit --amend\n+'\n+\n+test_expect_success 'commit --no-verbose overrides commit.verbose true' '\n+ echo evenmorecontent >>file &&\n+ git add file &&\n+ test_config commit.verbose true &&\n+ test_set_editor \"$PWD/check-for-no-diff\" &&\n+ git commit --amend --no-verbose\n+'\n+\n cat >diff <<'EOF'\n This is an example commit message that contains a diff.\n\n--\n2.0.0\n"},{"id":"244005","messageId":"20140612180459.GA15556@hudson.localdomain","threadId":"36894","inReplyTo":"20140612135051.GA35824@sirius.local","subject":"Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config","fromName":"Jeremiah Mahler","fromEmail":"jmmahler@gmail.com","sentAt":"2014-06-12T18:04:59Z","receivedAt":"2014-06-12T18:04:59Z","isPatch":true,"sender":{"key":"jmmahler@gmail.com","avatar":"https://avatars.githubusercontent.com/u/154028?v=4"},"body":"Caleb,\n\nOn Thu, Jun 12, 2014 at 08:51:31AM -0500, Caleb Thompson wrote:\n> I assume that you're running it against master?\n> \n> I rebased the branch yesterday, but I'll give it another shot. Obviously I\n> didn't use git-am, but I can try that.\n> \n> Caleb Thompson\n> \n> On Thu, Jun 12, 2014 at 01:41:52AM -0700, Jeremiah Mahler wrote:\n> > On Wed, Jun 11, 2014 at 01:24:36PM -0500, caleb@calebthompson.io wrote:\n> > > Some of the tests in t/t7507-commit-verbose.sh were still using\n> > > git-config to set configuration. Change them to use the test_config\n> > > helper.\n> > >\n> > > Signed-off-by: Caleb Thompson <caleb@calebthompson.io>\n> > > ---\n> > >  t/t7507-commit-verbose.sh | 4 ++--\n> > >  1 file changed, 2 insertions(+), 2 deletions(-)\n> > >\n> > > diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh\n> > > index 2ddf28c..6d778ed 100755\n> > > --- a/t/t7507-commit-verbose.sh\n> > > +++ b/t/t7507-commit-verbose.sh\n> > > @@ -43,7 +43,7 @@ test_expect_success 'verbose diff is stripped out' '\n> > >  '\n> > >\n> > >  test_expect_success 'verbose diff is stripped out (mnemonicprefix)' '\n> > > -\tgit config diff.mnemonicprefix true &&\n> > > +\ttest_config diff.mnemonicprefix true &&\n> > >\tgit commit --amend -v &&\n> > >\tcheck_message message\n> > >  '\n> > > @@ -71,7 +71,7 @@ test_expect_success 'diff in message is retained with -v' '\n> > >  '\n> > >\n> > >  test_expect_success 'submodule log is stripped out too with -v' '\n> > > -\tgit config diff.submodule log &&\n> > > +\ttest_config diff.submodule log &&\n> > >\tgit submodule add ./. sub &&\n> > >\tgit commit -m \"sub added\" &&\n> > >\t(\n> > > --\n> > > 2.0.0\n> > >\n> >\n> > It is probably something dumb on my part but for some reason I cannot\n> > apply this patch using 'git am'.  After I save the patch to a Maildir\n> > from Mutt and run git am...\n> >\n> >   jeri@hudson:~/git$ ./git-am ct1.patch\n> >   Applying: commit test: Use test_config instead of git-config\n> >   fatal: corrupt patch at line 15\n> >   Patch failed at 0001 commit test: Use test_config instead of git-config\n> >   The copy of the patch that failed is found in:\n> >      /home/jeri/git/.git/rebase-apply/patch\n> >   When you have resolved this problem, run \"git am --continue\".\n> >   If you prefer to skip this patch, run \"git am --skip\" instead.\n> >   To restore the original branch and stop patching, run \"git am --abort\".\n> >   jeri@hudson:~/git$\n> >\n> > The second patch in the series applies fine.  And I have applied other\n> > patches this way without issue.  Can anyone confirm this problem?\n> >\n> > --\n> > Jeremiah Mahler\n> > jmmahler@gmail.com\n> > http://github.com/jmahler\n\nThanks for checking.  Unfortunately the problem persists for me.\n\nIt seems to be related to there not being a space at the left most part\nof the patch.  It is just a tab with no space.  So 'git am' has a\nproblem because it is expecting to remove a space and there isn't one.\nSee the attached screenshots with tabs highlighted.\n\nHow are you preparing your patches.  'git format-patch' with a 'git\nsend-email'?\n\n-- \nJeremiah Mahler\njmmahler@gmail.com\nhttp://github.com/jmahler\n"},{"id":"244007","messageId":"20140612180830.GB15556@hudson.localdomain","threadId":"36894","inReplyTo":"20140612180459.GA15556@hudson.localdomain","subject":"Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config","fromName":"Jeremiah Mahler","fromEmail":"jmmahler@gmail.com","sentAt":"2014-06-12T18:08:30Z","receivedAt":"2014-06-12T18:08:30Z","isPatch":true,"sender":{"key":"jmmahler@gmail.com","avatar":"https://avatars.githubusercontent.com/u/154028?v=4"},"body":"On Thu, Jun 12, 2014 at 11:04:59AM -0700, Jeremiah Mahler wrote:\n> Caleb,\n> \n...\n>\n> Thanks for checking.  Unfortunately the problem persists for me.\n> \n> It seems to be related to there not being a space at the left most part\n> of the patch.  It is just a tab with no space.  So 'git am' has a\n> problem because it is expecting to remove a space and there isn't one.\n> See the attached screenshots with tabs highlighted.\n> \n> How are you preparing your patches.  'git format-patch' with a 'git\n> send-email'?\n> \n> -- \n> Jeremiah Mahler\n> jmmahler@gmail.com\n> http://github.com/jmahler\n\nForgot the screenshots.  Here they are attached.\n\n-- \nJeremiah Mahler\njmmahler@gmail.com\nhttp://github.com/jmahler\n"},{"id":"244011","messageId":"20140612182341.GA42013@sirius.local","threadId":"36894","inReplyTo":"20140612180830.GB15556@hudson.localdomain","subject":"Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config","fromName":"Caleb Thompson","fromEmail":"caleb@calebthompson.io","sentAt":"2014-06-12T18:23:41Z","receivedAt":"2014-06-12T18:23:41Z","isPatch":true,"sender":{"key":"caleb@calebthompson.io","avatar":"https://gravatar.com/avatar/0440c826b3dfa9dd7f768e4b661935a3a2584612a2fcd261f6914ced0457ab4d?d=mp&s=160"},"body":"Jeremiah,\n\nOn Thu, Jun 12, 2014 at 11:04:59AM -0700, Jeremiah Mahler wrote:\n>\n> Thanks for checking.  Unfortunately the problem persists for me.\n>\n> It seems to be related to there not being a space at the left most part\n> of the patch.  It is just a tab with no space.  So 'git am' has a\n> problem because it is expecting to remove a space and there isn't one.\n> See the attached screenshots with tabs highlighted.\n>\n> How are you preparing your patches.  'git format-patch' with a 'git\n> send-email'?\n\nI'm so glad you asked, because I've just been muddling through this.\n\nI've been generating the cover page variously with request-pull or diff\n--stat, then running a command like this, with --cc arguments added from\na list I've been keeping of people who respond to the threads:\n\n    git send-email --compose --to=git@vger.kernel.org --thread \\\n        [--cc ...] --no-chain-reply origin/master...\n\nThen I manually edit the subjects to add the version to the [PATCH N/M]\nportions. I haven't been using format-patch.\n\nIt's interesting that only the first patch isn't applying. I'd love to\nhear a better way.\n\nCaleb\n"},{"id":"244014","messageId":"20140612184637.GA16641@hudson.localdomain","threadId":"36894","inReplyTo":"20140612182341.GA42013@sirius.local","subject":"Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config","fromName":"Jeremiah Mahler","fromEmail":"jmmahler@gmail.com","sentAt":"2014-06-12T18:46:37Z","receivedAt":"2014-06-12T18:46:37Z","isPatch":true,"sender":{"key":"jmmahler@gmail.com","avatar":"https://avatars.githubusercontent.com/u/154028?v=4"},"body":"Caleb,\n\nOn Thu, Jun 12, 2014 at 01:23:41PM -0500, Caleb Thompson wrote:\n> Jeremiah,\n> \n> On Thu, Jun 12, 2014 at 11:04:59AM -0700, Jeremiah Mahler wrote:\n> >\n...\n> >\n> > How are you preparing your patches.  'git format-patch' with a 'git\n> > send-email'?\n> \n> I'm so glad you asked, because I've just been muddling through this.\n> \n> I've been generating the cover page variously with request-pull or diff\n> --stat, then running a command like this, with --cc arguments added from\n> a list I've been keeping of people who respond to the threads:\n> \n>     git send-email --compose --to=git@vger.kernel.org --thread \\\n>         [--cc ...] --no-chain-reply origin/master...\n> \n> Then I manually edit the subjects to add the version to the [PATCH N/M]\n> portions. I haven't been using format-patch.\n> \n> It's interesting that only the first patch isn't applying. I'd love to\n> hear a better way.\n> \n> Caleb\n\nIt sounds like you are doing too much work.\n\nAfter I make a series of commits I run format-patch.  This example has 2\npatches (-2).  I like --thread, although it seems to work fine without\nit.  And --reroll-count will automatically do your N/M numbering for\nyou.  It also generates a cover letter which you can then edit by hand.\nAll the patches will be named v3-* in this case.\n\n  git format-patch --reroll-count=3 --cover --thread -2\n\nThen I can send the whole patch series using send-email.\n\n  git send-email --to=caleb --cc=git --cc=junio v3-*\n\nFelipe Contreras has a good writeup [1] on how to setup aliases with Mutt so\nyou don't have to type the full email every time.\n\n[1]: http://felipec.wordpress.com/2009/10/25/git-send-email-tricks/\n\nI recently setup Mutt with Offlineimap [2] and Msmtp.  This is an\nawesome setup too.  Not patch related, but it makes the email part\neasier.\n\n[2]: https://wiki.archlinux.org/index.php/OfflineIMAP\n\n-- \nJeremiah Mahler\njmmahler@gmail.com\nhttp://github.com/jmahler\n"},{"id":"244020","messageId":"20140612192340.GA44281@sirius.local","threadId":"36894","inReplyTo":"20140612184637.GA16641@hudson.localdomain","subject":"Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config","fromName":"Caleb Thompson","fromEmail":"caleb@calebthompson.io","sentAt":"2014-06-12T19:23:40Z","receivedAt":"2014-06-12T19:23:40Z","isPatch":true,"sender":{"key":"caleb@calebthompson.io","avatar":"https://gravatar.com/avatar/0440c826b3dfa9dd7f768e4b661935a3a2584612a2fcd261f6914ced0457ab4d?d=mp&s=160"},"body":"Jeremiah,\n\nThat looks great. Since I'm not seeing any more feedback on the code for this\nset of patches, I'll go ahead and send up another set.\n\nThank you for those pointers.\n\nCaleb Thompson\n\nOn Thu, Jun 12, 2014 at 11:46:37AM -0700, Jeremiah Mahler wrote:\n> Caleb,\n>\n> On Thu, Jun 12, 2014 at 01:23:41PM -0500, Caleb Thompson wrote:\n> > Jeremiah,\n> >\n> > On Thu, Jun 12, 2014 at 11:04:59AM -0700, Jeremiah Mahler wrote:\n> > >\n> ...\n> > >\n> > > How are you preparing your patches.  'git format-patch' with a 'git\n> > > send-email'?\n> >\n> > I'm so glad you asked, because I've just been muddling through this.\n> >\n> > I've been generating the cover page variously with request-pull or diff\n> > --stat, then running a command like this, with --cc arguments added from\n> > a list I've been keeping of people who respond to the threads:\n> >\n> >     git send-email --compose --to=git@vger.kernel.org --thread \\\n> >         [--cc ...] --no-chain-reply origin/master...\n> >\n> > Then I manually edit the subjects to add the version to the [PATCH N/M]\n> > portions. I haven't been using format-patch.\n> >\n> > It's interesting that only the first patch isn't applying. I'd love to\n> > hear a better way.\n> >\n> > Caleb\n>\n> It sounds like you are doing too much work.\n>\n> After I make a series of commits I run format-patch.  This example has 2\n> patches (-2).  I like --thread, although it seems to work fine without\n> it.  And --reroll-count will automatically do your N/M numbering for\n> you.  It also generates a cover letter which you can then edit by hand.\n> All the patches will be named v3-* in this case.\n>\n>   git format-patch --reroll-count=3 --cover --thread -2\n>\n> Then I can send the whole patch series using send-email.\n>\n>   git send-email --to=caleb --cc=git --cc=junio v3-*\n>\n> Felipe Contreras has a good writeup [1] on how to setup aliases with Mutt so\n> you don't have to type the full email every time.\n>\n> [1]: http://felipec.wordpress.com/2009/10/25/git-send-email-tricks/\n>\n> I recently setup Mutt with Offlineimap [2] and Msmtp.  This is an\n> awesome setup too.  Not patch related, but it makes the email part\n> easier.\n>\n> [2]: https://wiki.archlinux.org/index.php/OfflineIMAP\n>\n> --\n> Jeremiah Mahler\n> jmmahler@gmail.com\n> http://github.com/jmahler\n"}]}