Re: [PATCH v2] commit: support commit.verbose and --no-verbose
From: Jeremiah Mahler <hidden>
Date: 2016-06-15 23:01:22
On Sun, May 25, 2014 at 01:24:27AM -0500, Caleb Thompson wrote: ...
would be committed at the bottom of the commit message template. Note that this diff output doesn't have its - lines prefixed with '#'. + lines prefixed with '#'. The `commit.verbose` configuration + variable can be set to true to implicitly send this option. + +--no-verbose:: + Do not show the unified diff at the bottom of the commit message + template. This is the default behavior, but can be used to override + the`commit.verbose` configuration variable.
Why is there two spaces between "diff at"? Needs a space between "the`comm" -> "the `comm".
+cat >check-for-no-diff <<EOF +#!$SHELL_PATH +exec grep -v '^diff --git' "\$1" +EOF +chmod +x check-for-no-diff +
Me personally, I would leave it like that for now, since that is the style being used nearby. We'll see what others have to say. I certainly wouldn't convert all the other cases to use test_expect_success. Leave that for another patch.
quoted hunk ↗ jump to hunk
@@ -48,6 +54,21 @@ test_expect_success 'verbose diff is stripped out (mnemonicprefix)' ' check_message message ' +test_expect_success 'commit shows verbose diff with set commit.verbose' ' + echo morecontent >file && + git add file && + test_config commit.verbose true && + check_message message +' + +test_expect_success 'commit does not show verbose diff with --no-verbose' ' + echo morecontent >file && + git add file && + test_config commit.verbose true && + test_set_editor "$PWD/check-for-no-diff" && + git commit --amend --no-verbose +' +
I like those better with 'test_config' instead of 'git config', good. Keep working on it, it is looking better :-) -- Jeremiah Mahler jmmahler@gmail.com http://github.com/jmahler