{"thread":{"id":"33228","subject":"[PATCH] t7811 (grep-open): remove test_config() redefinition","startedAt":"2013-03-19T10:43:14Z","lastAt":"2013-03-20T19:59:54Z","messageCount":6,"participants":["Ramkumar Ramachandra","Junio C Hamano","Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"211652","messageId":"1363689794-25974-1-git-send-email-artagnon@gmail.com","threadId":"33228","inReplyTo":null,"subject":"[PATCH] t7811 (grep-open): remove test_config() redefinition","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-03-19T10:43:14Z","receivedAt":"2013-03-19T10:43:14Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"test_config() is already a well-defined function in\ntest-lib-functions.sh.  Don't duplicate it unnecessarily.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n Found this while randomly grep'ping around.\n\n t/t7811-grep-open.sh | 5 -----\n 1 file changed, 5 deletions(-)\n\ndiff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh\nindex a895778..e1951a5 100755\n--- a/t/t7811-grep-open.sh\n+++ b/t/t7811-grep-open.sh\n@@ -125,11 +125,6 @@ test_expect_success 'modified file' '\n \ttest_cmp empty out\n '\n \n-test_config() {\n-\tgit config \"$1\" \"$2\" &&\n-\ttest_when_finished \"git config --unset $1\"\n-}\n-\n test_expect_success 'copes with color settings' '\n \trm -f actual &&\n \techo grep.h >expect &&\n-- \n1.8.2\n"},{"id":"211688","messageId":"7vk3p3jrrw.fsf@alter.siamese.dyndns.org","threadId":"33228","inReplyTo":"1363689794-25974-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH] t7811 (grep-open): remove test_config() redefinition","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-19T16:09:07Z","receivedAt":"2013-03-19T16:09:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> test_config() is already a well-defined function in\n> test-lib-functions.sh.  Don't duplicate it unnecessarily.\n\nThere are other instances of it in t7810 and t4018, with slightly\ndifferent styles.\n\nt/t4018-diff-funcname.sh:test_config () {\nt/t7810-grep.sh:test_config() {\nt/t7811-grep-open.sh:test_config() {\nt/test-lib-functions.sh:test_config () {\n\nIncidentally, this is why a consistent coding style helps.  It\nshould be possible to catch all ofhtme with a single\n\n\tgit grep 'test_config () {' t/\n\nbut the ones in t78xx wouldn't have been found.\n\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> ---\n>  Found this while randomly grep'ping around.\n>\n>  t/t7811-grep-open.sh | 5 -----\n>  1 file changed, 5 deletions(-)\n>\n> diff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh\n> index a895778..e1951a5 100755\n> --- a/t/t7811-grep-open.sh\n> +++ b/t/t7811-grep-open.sh\n> @@ -125,11 +125,6 @@ test_expect_success 'modified file' '\n>  \ttest_cmp empty out\n>  '\n>  \n> -test_config() {\n> -\tgit config \"$1\" \"$2\" &&\n> -\ttest_when_finished \"git config --unset $1\"\n> -}\n> -\n>  test_expect_success 'copes with color settings' '\n>  \trm -f actual &&\n>  \techo grep.h >expect &&\n"},{"id":"211726","messageId":"1363767703-12936-1-git-send-email-artagnon@gmail.com","threadId":"33228","inReplyTo":"7vk3p3jrrw.fsf@alter.siamese.dyndns.org","subject":"[PATCH] t: don't redefine test_config() in various places","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-03-20T08:21:43Z","receivedAt":"2013-03-20T08:21:43Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"test_config() is already a well-defined function in\ntest-lib-functions.sh.  Don't duplicate it unnecessarily in:\n\n  t4018-diff-funcname.sh\n  t7810-grep.sh\n  t7811-grep-open.sh\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n Thanks, Junio.\n\n t/t4018-diff-funcname.sh | 5 -----\n t/t7810-grep.sh          | 5 -----\n t/t7811-grep-open.sh     | 5 -----\n 3 files changed, 15 deletions(-)\n\ndiff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh\nindex 082d3e8..38a092a 100755\n--- a/t/t4018-diff-funcname.sh\n+++ b/t/t4018-diff-funcname.sh\n@@ -93,11 +93,6 @@ sed -e '\n \ts/song;/song();/\n ' <Beer.perl >Beer-correct.perl\n \n-test_config () {\n-\tgit config \"$1\" \"$2\" &&\n-\ttest_when_finished \"git config --unset $1\"\n-}\n-\n test_expect_funcname () {\n \tlang=${2-java}\n \ttest_expect_code 1 git diff --no-index -U1 \\\ndiff --git a/t/t7810-grep.sh b/t/t7810-grep.sh\nindex f698001..500eb50 100755\n--- a/t/t7810-grep.sh\n+++ b/t/t7810-grep.sh\n@@ -1084,11 +1084,6 @@ test_expect_success 'grep -E pattern with grep.patternType=fixed' '\n \ttest_cmp expected actual\n '\n \n-test_config() {\n-\tgit config \"$1\" \"$2\" &&\n-\ttest_when_finished \"git config --unset $1\"\n-}\n-\n cat >expected <<EOF\n hello.c<RED>:<RESET>int main(int argc, const char **argv)\n hello.c<RED>-<RESET>{\ndiff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh\nindex a895778..e1951a5 100755\n--- a/t/t7811-grep-open.sh\n+++ b/t/t7811-grep-open.sh\n@@ -125,11 +125,6 @@ test_expect_success 'modified file' '\n \ttest_cmp empty out\n '\n \n-test_config() {\n-\tgit config \"$1\" \"$2\" &&\n-\ttest_when_finished \"git config --unset $1\"\n-}\n-\n test_expect_success 'copes with color settings' '\n \trm -f actual &&\n \techo grep.h >expect &&\n-- \n1.8.2\n"},{"id":"211794","messageId":"20130320184021.GN3655@google.com","threadId":"33228","inReplyTo":"1363767703-12936-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH] t: don't redefine test_config() in various places","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-03-20T18:40:21Z","receivedAt":"2013-03-20T18:40:21Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ramkumar Ramachandra wrote:\n\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> ---\n>  Thanks, Junio.\n>\n>  t/t4018-diff-funcname.sh | 5 -----\n>  t/t7810-grep.sh          | 5 -----\n>  t/t7811-grep-open.sh     | 5 -----\n>  3 files changed, 15 deletions(-)\n\nYeah, that looks like all of them.  FWIW,\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n"},{"id":"211798","messageId":"7vsj3pewgl.fsf@alter.siamese.dyndns.org","threadId":"33228","inReplyTo":"1363767703-12936-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH] t: don't redefine test_config() in various places","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-20T18:51:22Z","receivedAt":"2013-03-20T18:51:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> test_config() is already a well-defined function in\n> test-lib-functions.sh.  Don't duplicate it unnecessarily in:\n>\n>   t4018-diff-funcname.sh\n>   t7810-grep.sh\n>   t7811-grep-open.sh\n>\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> ---\n>  Thanks, Junio.\n\nHeh, I've pushed out the original one after fixing them up myself\nlast night.\n"},{"id":"211818","messageId":"CALkWK0kwzE+Dk7qVim7S5ie_L+eGKS+iw+Q6HTUME0cHAcPdxQ@mail.gmail.com","threadId":"33228","inReplyTo":"7vsj3pewgl.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t: don't redefine test_config() in various places","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-03-20T19:59:54Z","receivedAt":"2013-03-20T19:59:54Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Junio C Hamano wrote:\n> Ramkumar Ramachandra <artagnon@gmail.com> writes:\n>\n>> test_config() is already a well-defined function in\n>> test-lib-functions.sh.  Don't duplicate it unnecessarily in:\n>>\n>>   t4018-diff-funcname.sh\n>>   t7810-grep.sh\n>>   t7811-grep-open.sh\n>>\n>> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n>> ---\n>>  Thanks, Junio.\n>\n> Heh, I've pushed out the original one after fixing them up myself\n> last night.\n\nDoing a fine job as the editor, as always.  I need to watch `pu` more closely.\n"}]}