* [PATCH v4] commit: add a commit.verbose config variable
@ 2016-03-10 22:12 Pranit Bauva
2016-03-10 22:39 ` Pranit Bauva
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Pranit Bauva @ 2016-03-10 22:12 UTC (permalink / raw)
To: git
Since many people always run the command with this option, it would be
preferrable to specify it in the configuration file instead of passing
the option with `git commit` again and again.
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
---
Documentation/config.txt | 4 ++++
Documentation/git-commit.txt | 3 ++-
builtin/commit.c | 4 ++++
t/t7507-commit-verbose.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 58 insertions(+), 1 deletion(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 01cca0a..9b93f6c 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1110,6 +1110,10 @@ commit.template::
"`~/`" is expanded to the value of `$HOME` and "`~user/`" to the
specified user's home directory.
+commit.verbose::
+ A boolean to specify whether to always include the verbose option
+ with `git commit`. See linkgit:git-commit[1].
+
credential.helper::
Specify an external helper to be called when a username or
password credential is needed; the helper may consult external
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 9ec6b3c..3dcaac7 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -290,7 +290,8 @@ configuration variable documented in linkgit:git-config[1].
what changes the commit has.
Note that this diff output doesn't have its
lines prefixed with '#'. This diff will not be a part
- of the commit message.
+ of the commit message. To activate this option permanently, the
+ configuration variable `commit.verbose` can be set to true.
+
If specified twice, show in addition the unified diff between
what would be committed and the worktree files, i.e. the unstaged
diff --git a/builtin/commit.c b/builtin/commit.c
index b3bd2d4..55e9a82 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1505,6 +1505,10 @@ static int git_commit_config(const char *k, const char *v, void *cb)
sign_commit = git_config_bool(k, v) ? "" : NULL;
return 0;
}
+ if (!strcmp(k, "commit.verbose")){
+ verbose = git_config_bool(k, v);
+ return 0;
+ }
status = git_gpg_config(k, v, NULL);
if (status)
diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh
index 2ddf28c..4e123a5 100755
--- a/t/t7507-commit-verbose.sh
+++ b/t/t7507-commit-verbose.sh
@@ -96,4 +96,52 @@ test_expect_success 'verbose diff is stripped out with set core.commentChar' '
test_i18ngrep "Aborting commit due to empty commit message." err
'
+test_expect_success 'commit with commit.verbose true and no arguments' '
+ echo content >file &&
+ git add file &&
+ test_config commit.verbose true &&
+ (
+ GIT_EDITOR=cat &&
+ export GIT_EDITOR &&
+ test_must_fail git commit >output
+ ) &&
+ test_i18ngrep "diff --git" output
+'
+
+test_expect_success 'commit with commit.verbose true and --no-verbose' '
+ echo content >file &&
+ git add file &&
+ test_config commit.verbose true &&
+ (
+ GIT_EDITOR=cat &&
+ export GIT_EDITOR &&
+ test_must_fail git commit --no-verbose >output
+ ) &&
+ ! test_i18ngrep "diff --git" output
+'
+
+test_expect_success 'commit with commit.verbose false and -v' '
+ echo content >file &&
+ git add file &&
+ test_config commit.verbose false &&
+ (
+ GIT_EDITOR=cat &&
+ export GIT_EDITOR &&
+ test_must_fail git commit -v >output
+ ) &&
+ test_i18ngrep "diff --git" output
+'
+
+test_expect_success 'commit with commit.verbose false no arguments' '
+ echo content >file &&
+ git add file &&
+ test_config commit.verbose false &&
+ (
+ GIT_EDITOR=cat &&
+ export GIT_EDITOR &&
+ test_must_fail git commit >output
+ ) &&
+ ! test_i18ngrep "diff --git" output
+'
+
test_done
--
https://github.com/git/git/pull/205
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v4] commit: add a commit.verbose config variable
2016-03-10 22:12 [PATCH v4] commit: add a commit.verbose config variable Pranit Bauva
@ 2016-03-10 22:39 ` Pranit Bauva
2016-03-10 22:52 ` Junio C Hamano
` (2 subsequent siblings)
3 siblings, 0 replies; 13+ messages in thread
From: Pranit Bauva @ 2016-03-10 22:39 UTC (permalink / raw)
To: git
Older versions of this patch can be found at :-
[v3] : http://thread.gmane.org/gmane.comp.version-control.git/288634
[v2] : http://thread.gmane.org/gmane.comp.version-control.git/288569
[v1] : http://thread.gmane.org/gmane.comp.version-control.git/287540
The changes with respect to last version are :
- put the code in git_commit_config() instead of git_status_config()
- Add test to cover all possible scenarios
Regards,
Pranit Bauva
IIT Kharagpur
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4] commit: add a commit.verbose config variable
2016-03-10 22:12 [PATCH v4] commit: add a commit.verbose config variable Pranit Bauva
2016-03-10 22:39 ` Pranit Bauva
@ 2016-03-10 22:52 ` Junio C Hamano
2016-03-10 23:02 ` Pranit Bauva
2016-03-10 23:01 ` Eric Sunshine
2016-03-11 0:49 ` [PATCH v2] t/t7502 : drop duplicate test Pranit Bauva
3 siblings, 1 reply; 13+ messages in thread
From: Junio C Hamano @ 2016-03-10 22:52 UTC (permalink / raw)
To: Pranit Bauva; +Cc: git
Pranit Bauva <pranit.bauva@gmail.com> writes:
> + if (!strcmp(k, "commit.verbose")){
v3 did this line correctly but you somehow lost the SP between
"){". What happened?
> diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh
> index 2ddf28c..4e123a5 100755
> --- a/t/t7507-commit-verbose.sh
> +++ b/t/t7507-commit-verbose.sh
> @@ -96,4 +96,52 @@ test_expect_success 'verbose diff is stripped out with set core.commentChar' '
> test_i18ngrep "Aborting commit due to empty commit message." err
> '
>
> +test_expect_success 'commit with commit.verbose true and no arguments' '
> +test_expect_success 'commit with commit.verbose true and --no-verbose' '
> +test_expect_success 'commit with commit.verbose false and -v' '
> +test_expect_success 'commit with commit.verbose false no arguments' '
Don't you need a test that status is not broken when the variable is
set?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4] commit: add a commit.verbose config variable
2016-03-10 22:12 [PATCH v4] commit: add a commit.verbose config variable Pranit Bauva
2016-03-10 22:39 ` Pranit Bauva
2016-03-10 22:52 ` Junio C Hamano
@ 2016-03-10 23:01 ` Eric Sunshine
2016-03-11 0:15 ` Pranit Bauva
2016-03-11 0:49 ` [PATCH v2] t/t7502 : drop duplicate test Pranit Bauva
3 siblings, 1 reply; 13+ messages in thread
From: Eric Sunshine @ 2016-03-10 23:01 UTC (permalink / raw)
To: Pranit Bauva; +Cc: Git List
On Thu, Mar 10, 2016 at 5:12 PM, Pranit Bauva <pranit.bauva@gmail.com> wrote:
> Since many people always run the command with this option, it would be
> preferrable to specify it in the configuration file instead of passing
> the option with `git commit` again and again.
Perhaps drop the unsubstantiated "many people always" and just say:
Add commit.verbose configuration variable as a convenience
for those who always prefer --verbose.
or something.
> Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
> ---
As a convenience to reviewers, please use this area below the "---"
line to provide links and explain what changed since the previous
round rather than doing so in a separate email.
> diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
> @@ -290,7 +290,8 @@ configuration variable documented in linkgit:git-config[1].
> what changes the commit has.
> Note that this diff output doesn't have its
> lines prefixed with '#'. This diff will not be a part
> - of the commit message.
> + of the commit message. To activate this option permanently, the
> + configuration variable `commit.verbose` can be set to true.
The "permanently" bit sounds scary. A more concise way to state this might be:
See the `commit.verbose` configuration variable in
linkgit:git-config[1].
which doesn't bother spelling out what the intelligent reader should
infer from the reference.
> diff --git a/builtin/commit.c b/builtin/commit.c
> @@ -1505,6 +1505,10 @@ static int git_commit_config(const char *k, const char *v, void *cb)
> sign_commit = git_config_bool(k, v) ? "" : NULL;
> return 0;
> }
> + if (!strcmp(k, "commit.verbose")){
Style: space before {
> + verbose = git_config_bool(k, v);
> + return 0;
> + }
>
> status = git_gpg_config(k, v, NULL);
> if (status)
> diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh
> @@ -96,4 +96,52 @@ test_expect_success 'verbose diff is stripped out with set core.commentChar' '
> test_i18ngrep "Aborting commit due to empty commit message." err
> '
>
> +test_expect_success 'commit with commit.verbose true and no arguments' '
"no arguments" doesn't convey much; how about "--verbose omitted" or
something? Ditto for the titles of other tests.
> + echo content >file &&
> + git add file &&
> + test_config commit.verbose true &&
> + (
> + GIT_EDITOR=cat &&
> + export GIT_EDITOR &&
> + test_must_fail git commit >output
> + ) &&
> + test_i18ngrep "diff --git" output
> +'
Making git-commit fail unconditionally with "aborting due to empty
commit message" is a rather sneaky way to perform this test. I would
have expected to see these new tests re-use the existing machinery
provided by this script (the check-for-diff "editor") rather than
inventing an entirely new and unintuitive mechanism. Doing so would
also reduce the size of each new test.
More below...
> +test_expect_success 'commit with commit.verbose true and --no-verbose' '
> + echo content >file &&
> + git add file &&
> + test_config commit.verbose true &&
> + (
> + GIT_EDITOR=cat &&
> + export GIT_EDITOR &&
> + test_must_fail git commit --no-verbose >output
> + ) &&
> + ! test_i18ngrep "diff --git" output
> +'
> +
> +test_expect_success 'commit with commit.verbose false and -v' '
> + echo content >file &&
> + git add file &&
> + test_config commit.verbose false &&
> + (
> + GIT_EDITOR=cat &&
> + export GIT_EDITOR &&
> + test_must_fail git commit -v >output
> + ) &&
> + test_i18ngrep "diff --git" output
> +'
> +
> +test_expect_success 'commit with commit.verbose false no arguments' '
> + echo content >file &&
> + git add file &&
> + test_config commit.verbose false &&
> + (
> + GIT_EDITOR=cat &&
> + export GIT_EDITOR &&
> + test_must_fail git commit >output
> + ) &&
> + ! test_i18ngrep "diff --git" output
> +'
Some additional tests[1][2] are probably warranted.
[1]: http://article.gmane.org/gmane.comp.version-control.git/288648
[2]: http://article.gmane.org/gmane.comp.version-control.git/288657
> +
> test_done
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4] commit: add a commit.verbose config variable
2016-03-10 22:52 ` Junio C Hamano
@ 2016-03-10 23:02 ` Pranit Bauva
0 siblings, 0 replies; 13+ messages in thread
From: Pranit Bauva @ 2016-03-10 23:02 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
> + if (!strcmp(k, "commit.verbose")){
> v3 did this line correctly but you somehow lost the SP between
> "){". What happened?
I will include the SP between )) and { .
> Don't you need a test that status is not broken when the variable is
> set?
I will include the test for status too. But I am a bit confused where
should I place them? This patch triggers the possibility of a breakage
in status related to verbose but other tests related to status are in
different files. Could you tell me the filename where I should place
these test?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4] commit: add a commit.verbose config variable
2016-03-10 23:01 ` Eric Sunshine
@ 2016-03-11 0:15 ` Pranit Bauva
2016-03-11 5:44 ` Eric Sunshine
2016-03-11 10:18 ` Philip Oakley
0 siblings, 2 replies; 13+ messages in thread
From: Pranit Bauva @ 2016-03-11 0:15 UTC (permalink / raw)
To: Eric Sunshine; +Cc: Git List
On Fri, Mar 11, 2016 at 4:31 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> Add commit.verbose configuration variable as a convenience
> for those who always prefer --verbose.
>
> or something.
Sure!
> As a convenience to reviewers, please use this area below the "---"
> line to provide links and explain what changed since the previous
> round rather than doing so in a separate email.
Actually I am sending the patches with submitGit herokuapp because my
institute proxy does not allow IMAP/POP3 connections.
> The "permanently" bit sounds scary. A more concise way to state this might be:
>
> See the `commit.verbose` configuration variable in
> linkgit:git-config[1].
>
> which doesn't bother spelling out what the intelligent reader should
> infer from the reference.
> Style: space before {
Sure!
>> +test_expect_success 'commit with commit.verbose true and no arguments' '
>
> "no arguments" doesn't convey much; how about "--verbose omitted" or
> something? Ditto for the titles of other tests.
Will change the language construct.
>> + echo content >file &&
>> + git add file &&
>> + test_config commit.verbose true &&
>> + (
>> + GIT_EDITOR=cat &&
>> + export GIT_EDITOR &&
>> + test_must_fail git commit >output
>> + ) &&
>> + test_i18ngrep "diff --git" output
>> +'
>
> Making git-commit fail unconditionally with "aborting due to empty
> commit message" is a rather sneaky way to perform this test. I would
> have expected to see these new tests re-use the existing machinery
> provided by this script (the check-for-diff "editor") rather than
> inventing an entirely new and unintuitive mechanism. Doing so would
> also reduce the size of each new test.
I agree on the fact that making git-commit fail unconditionally is not
a good way to perform the test. "check-for-diff" is not really an
"editor" and it checks for the commit message after it has been
written to the history. The verbose output is stripped when it is
written to the history so we won't be able to test whether this patch
works. This is where purposely breaking the code is required as when
the commit fails, it gives the output of the contents present at that
time (which will contain the verbose output). More over the
'check-for-diff' uses grep which is not preferred. Many tests are now
using test_i18ngrep (eg. f79ce8db). I had planned on using
'check-for-diff' before but it took me some time to figure out this
behavior and thus I began searching for another mechanism (breaking
code).
> Some additional tests[1][2] are probably warranted.
>
> [1]: http://article.gmane.org/gmane.comp.version-control.git/288648
> [2]: http://article.gmane.org/gmane.comp.version-control.git/288657
I think these tests also are better included in this file as this
patch triggers it and it would not make much of a difference between
t7507 and t7502 but in fact improve its readability.
>> test_done
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2] t/t7502 : drop duplicate test
2016-03-10 22:12 [PATCH v4] commit: add a commit.verbose config variable Pranit Bauva
` (2 preceding siblings ...)
2016-03-10 23:01 ` Eric Sunshine
@ 2016-03-11 0:49 ` Pranit Bauva
2016-03-11 5:09 ` Pranit Bauva
2016-03-11 18:39 ` Junio C Hamano
3 siblings, 2 replies; 13+ messages in thread
From: Pranit Bauva @ 2016-03-11 0:49 UTC (permalink / raw)
To: git
This extra test was introduced erroneously by
f9c0181 (t7502: test commit.status, --status and
--no-status, 2010-01-13)
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
---
t/t7502-commit.sh | 5 -----
1 file changed, 5 deletions(-)
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index b39e313..725687d 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -527,11 +527,6 @@ try_commit_status_combo () {
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
- test_expect_success 'commit' '
- try_commit "" &&
- test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
- '
-
test_expect_success 'commit --status' '
try_commit --status &&
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
--
https://github.com/git/git/pull/208
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v2] t/t7502 : drop duplicate test
2016-03-11 0:49 ` [PATCH v2] t/t7502 : drop duplicate test Pranit Bauva
@ 2016-03-11 5:09 ` Pranit Bauva
2016-03-11 18:39 ` Junio C Hamano
1 sibling, 0 replies; 13+ messages in thread
From: Pranit Bauva @ 2016-03-11 5:09 UTC (permalink / raw)
To: Git List, Junio C Hamano; +Cc: Eric Sunshine
The older version of this patch :
- [v1] http://thread.gmane.org/gmane.comp.version-control.git/288662
The changes between the patches :
- Improved the language construct of the commit message
- Provided more details about the cited commit in the commit message
Regards,
Pranit Bauva
IIT Kharagpur
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4] commit: add a commit.verbose config variable
2016-03-11 0:15 ` Pranit Bauva
@ 2016-03-11 5:44 ` Eric Sunshine
2016-03-11 8:00 ` Pranit Bauva
2016-03-11 9:39 ` Roberto Tyley
2016-03-11 10:18 ` Philip Oakley
1 sibling, 2 replies; 13+ messages in thread
From: Eric Sunshine @ 2016-03-11 5:44 UTC (permalink / raw)
To: Pranit Bauva; +Cc: Git List, Roberto Tyley
[+cc:Roberto Tyley]
On Fri, Mar 11, 2016 at 05:45:27AM +0530, Pranit Bauva wrote:
> On Fri, Mar 11, 2016 at 4:31 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> > As a convenience to reviewers, please use this area below the "---"
> > line to provide links and explain what changed since the previous
> > round rather than doing so in a separate email.
>
> Actually I am sending the patches with submitGit herokuapp because my
> institute proxy does not allow IMAP/POP3 connections.
That's unfortunate. Your separate "cover letter" often arrives hours
later than the patch itself. Perhaps Roberto can comment on submitGit
and per-patch commentary.
> >> + echo content >file &&
> >> + git add file &&
> >> + test_config commit.verbose true &&
> >> + (
> >> + GIT_EDITOR=cat &&
> >> + export GIT_EDITOR &&
> >> + test_must_fail git commit >output
> >> + ) &&
> >> + test_i18ngrep "diff --git" output
> >> +'
> >
> > Making git-commit fail unconditionally with "aborting due to empty
> > commit message" is a rather sneaky way to perform this test. I would
> > have expected to see these new tests re-use the existing machinery
> > provided by this script (the check-for-diff "editor") rather than
> > inventing an entirely new and unintuitive mechanism. Doing so would
> > also reduce the size of each new test.
>
> I agree on the fact that making git-commit fail unconditionally is not
> a good way to perform the test. "check-for-diff" is not really an
> "editor" and it checks for the commit message after it has been
> written to the history. The verbose output is stripped when it is
> written to the history so we won't be able to test whether this patch
> works.
It's a bit tricky if you're not used to it, but check-for-diff
actually does what you want, and does so in a more direct way. While
it's true that it's not an "editor" per se, it does get access to the
entire block of text that would normally appear in your editor during
an interactive commit. And, this is happening before the commit has
been written to history. So, check-for-diff gets a chance to look at
the full text that would appear in your editor, and can therefore
check if it contains the expected "diff --git" string.
> This is where purposely breaking the code is required as when
> the commit fails, it gives the output of the contents present at that
> time (which will contain the verbose output). More over the
> 'check-for-diff' uses grep which is not preferred. Many tests are now
> using test_i18ngrep (eg. f79ce8db).
'test_i18ngrep' is intended for strings which may be translated,
however, since the expected "diff --git" string should never be
translated, check-for-diff's use of 'grep' is correct, whereas
'test_i18ngrep' would be misleading (if not actively wrong).
> I had planned on using
> 'check-for-diff' before but it took me some time to figure out this
> behavior and thus I began searching for another mechanism (breaking
> code).
As an experiment, I rewrote the four new tests in terms of
check-for-diff (with "test_set_editor check-for-diff" already in
effect). Here's what they look like, and they function as expected:
test_expect_success 'commit.verbose true and --verbose omitted' '
git -c commit.verbose=true commit --amend
'
test_expect_success 'commit.verbose true and --no-verbose' '
test_must_fail git -c commit.verbose=true commit --amend --no-verbose
'
test_expect_success 'commit.verbose false and --verbose' '
git -c commit.verbose=false commit --amend --verbose
'
test_expect_success 'commit.verbose false and --verbose omitted' '
test_must_fail git -c commit.verbose=false commit --amend
'
These are modeled after the "initial commit shows verbose diff" test
earlier in the script.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4] commit: add a commit.verbose config variable
2016-03-11 5:44 ` Eric Sunshine
@ 2016-03-11 8:00 ` Pranit Bauva
2016-03-11 9:39 ` Roberto Tyley
1 sibling, 0 replies; 13+ messages in thread
From: Pranit Bauva @ 2016-03-11 8:00 UTC (permalink / raw)
To: Eric Sunshine; +Cc: Git List, Roberto Tyley
On Fri, Mar 11, 2016 at 11:14 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> It's a bit tricky if you're not used to it, but check-for-diff
> actually does what you want, and does so in a more direct way. While
> it's true that it's not an "editor" per se, it does get access to the
> entire block of text that would normally appear in your editor during
> an interactive commit. And, this is happening before the commit has
> been written to history. So, check-for-diff gets a chance to look at
> the full text that would appear in your editor, and can therefore
> check if it contains the expected "diff --git" string.
Yes, this was new to me. Thanks for explaining it in an elaborate
manner. It took me some time to actually understand the behavior of
check-for-diff (a tricky one). And it does the task pretty nicely!
> 'test_i18ngrep' is intended for strings which may be translated,
> however, since the expected "diff --git" string should never be
> translated, check-for-diff's use of 'grep' is correct, whereas
> 'test_i18ngrep' would be misleading (if not actively wrong).
I should have read the docs before using this method and not just
blindly using it. I will definitely take care of that next time.
> As an experiment, I rewrote the four new tests in terms of
> check-for-diff (with "test_set_editor check-for-diff" already in
> effect). Here's what they look like, and they function as expected:
>
> test_expect_success 'commit.verbose true and --verbose omitted' '
> git -c commit.verbose=true commit --amend
> '
>
> test_expect_success 'commit.verbose true and --no-verbose' '
> test_must_fail git -c commit.verbose=true commit --amend --no-verbose
> '
>
> test_expect_success 'commit.verbose false and --verbose' '
> git -c commit.verbose=false commit --amend --verbose
> '
>
> test_expect_success 'commit.verbose false and --verbose omitted' '
> test_must_fail git -c commit.verbose=false commit --amend
> '
>
> These are modeled after the "initial commit shows verbose diff" test
> earlier in the script.
Thanks a lot for helping me with the tests. I will add the status
tests and then resend the patch. This was a nice exercise!
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4] commit: add a commit.verbose config variable
2016-03-11 5:44 ` Eric Sunshine
2016-03-11 8:00 ` Pranit Bauva
@ 2016-03-11 9:39 ` Roberto Tyley
1 sibling, 0 replies; 13+ messages in thread
From: Roberto Tyley @ 2016-03-11 9:39 UTC (permalink / raw)
To: Eric Sunshine; +Cc: Pranit Bauva, Git List, Roberto Tyley
On 11 March 2016 at 05:44, Eric Sunshine <sunshine@sunshineco.com> wrote:
> On Fri, Mar 11, 2016 at 05:45:27AM +0530, Pranit Bauva wrote:
>> Actually I am sending the patches with submitGit herokuapp because my
>> institute proxy does not allow IMAP/POP3 connections.
Really glad to hear this is helping you Pranit - I hadn't even thought
of the blocked IMAP/POP3 connections problem, I'm not sure what other
method you could have easily used to get round this.
> That's unfortunate. Your separate "cover letter" often arrives hours
> later than the patch itself. Perhaps Roberto can comment on submitGit
> and per-patch commentary.
This sounds like an improvement I need to make to submitGit, I've
created an issue here:
https://github.com/rtyley/submitgit/issues/30
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v4] commit: add a commit.verbose config variable
2016-03-11 0:15 ` Pranit Bauva
2016-03-11 5:44 ` Eric Sunshine
@ 2016-03-11 10:18 ` Philip Oakley
1 sibling, 0 replies; 13+ messages in thread
From: Philip Oakley @ 2016-03-11 10:18 UTC (permalink / raw)
To: Pranit Bauva, Eric Sunshine; +Cc: Git List
From: "Pranit Bauva" <pranit.bauva@gmail.com>
> On Fri, Mar 11, 2016 at 4:31 AM, Eric Sunshine <sunshine@sunshineco.com>
> wrote:
>
>> Add commit.verbose configuration variable as a convenience
>> for those who always prefer --verbose.
>>
>> or something.
>
> Sure!
>
>> As a convenience to reviewers, please use this area below the "---"
>> line to provide links and explain what changed since the previous
>> round rather than doing so in a separate email.
>
> Actually I am sending the patches with submitGit herokuapp because my
> institute proxy does not allow IMAP/POP3 connections.
You can still include the 'three dashes' and a commentary at the end of your
(local) regular commit message, and then when it is sent as a patch it will
have the right format. There are carried through rebases as well.
There is a similar feature for attaching notes (though I haven't used it).
Either should get around your institute's proxy issue.
>
>> The "permanently" bit sounds scary. A more concise way to state this
>> might be:
>>
>> See the `commit.verbose` configuration variable in
>> linkgit:git-config[1].
>>
>> which doesn't bother spelling out what the intelligent reader should
>> infer from the reference.
>> Style: space before {
>
> Sure!
>
>>> +test_expect_success 'commit with commit.verbose true and no arguments'
>>> '
>>
>> "no arguments" doesn't convey much; how about "--verbose omitted" or
>> something? Ditto for the titles of other tests.
>
> Will change the language construct.
>>> + echo content >file &&
>>> + git add file &&
>>> + test_config commit.verbose true &&
>>> + (
>>> + GIT_EDITOR=cat &&
>>> + export GIT_EDITOR &&
>>> + test_must_fail git commit >output
>>> + ) &&
>>> + test_i18ngrep "diff --git" output
>>> +'
>>
>> Making git-commit fail unconditionally with "aborting due to empty
>> commit message" is a rather sneaky way to perform this test. I would
>> have expected to see these new tests re-use the existing machinery
>> provided by this script (the check-for-diff "editor") rather than
>> inventing an entirely new and unintuitive mechanism. Doing so would
>> also reduce the size of each new test.
>
> I agree on the fact that making git-commit fail unconditionally is not
> a good way to perform the test. "check-for-diff" is not really an
> "editor" and it checks for the commit message after it has been
> written to the history. The verbose output is stripped when it is
> written to the history so we won't be able to test whether this patch
> works. This is where purposely breaking the code is required as when
> the commit fails, it gives the output of the contents present at that
> time (which will contain the verbose output). More over the
> 'check-for-diff' uses grep which is not preferred. Many tests are now
> using test_i18ngrep (eg. f79ce8db). I had planned on using
> 'check-for-diff' before but it took me some time to figure out this
> behavior and thus I began searching for another mechanism (breaking
> code).
>
>> Some additional tests[1][2] are probably warranted.
>>
>> [1]: http://article.gmane.org/gmane.comp.version-control.git/288648
>> [2]: http://article.gmane.org/gmane.comp.version-control.git/288657
>
> I think these tests also are better included in this file as this
> patch triggers it and it would not make much of a difference between
> t7507 and t7502 but in fact improve its readability.
>>> test_done
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] t/t7502 : drop duplicate test
2016-03-11 0:49 ` [PATCH v2] t/t7502 : drop duplicate test Pranit Bauva
2016-03-11 5:09 ` Pranit Bauva
@ 2016-03-11 18:39 ` Junio C Hamano
1 sibling, 0 replies; 13+ messages in thread
From: Junio C Hamano @ 2016-03-11 18:39 UTC (permalink / raw)
To: Pranit Bauva; +Cc: git
Pranit Bauva <pranit.bauva@gmail.com> writes:
> This extra test was introduced erroneously by
> f9c0181 (t7502: test commit.status, --status and
> --no-status, 2010-01-13)
>
> Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
> ---
Thanks. I briefly thought that this might be checking that doing
this twice would give different results, but that is not what is
happening. Also the remainder of this does cover all the
combinations, so we are OK after applying this patch.
Thanks, will queue.
> t/t7502-commit.sh | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
> index b39e313..725687d 100755
> --- a/t/t7502-commit.sh
> +++ b/t/t7502-commit.sh
> @@ -527,11 +527,6 @@ try_commit_status_combo () {
> test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
> '
>
> - test_expect_success 'commit' '
> - try_commit "" &&
> - test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
> - '
> -
> test_expect_success 'commit --status' '
> try_commit --status &&
> test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
>
> --
> https://github.com/git/git/pull/208
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2016-03-11 18:48 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 22:12 [PATCH v4] commit: add a commit.verbose config variable Pranit Bauva
2016-03-10 22:39 ` Pranit Bauva
2016-03-10 22:52 ` Junio C Hamano
2016-03-10 23:02 ` Pranit Bauva
2016-03-10 23:01 ` Eric Sunshine
2016-03-11 0:15 ` Pranit Bauva
2016-03-11 5:44 ` Eric Sunshine
2016-03-11 8:00 ` Pranit Bauva
2016-03-11 9:39 ` Roberto Tyley
2016-03-11 10:18 ` Philip Oakley
2016-03-11 0:49 ` [PATCH v2] t/t7502 : drop duplicate test Pranit Bauva
2016-03-11 5:09 ` Pranit Bauva
2016-03-11 18:39 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).