git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: Usman Akinyemi via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Cc: Patrick Steinhardt <ps@pks.im>,
	Usman Akinyemi <usmanakinyemi202@gmail.com>
Subject: Re: [PATCH v6 2/2] t3404: employing test_line_count() to replace test
Date: Mon, 7 Oct 2024 16:07:28 +0100	[thread overview]
Message-ID: <4f79f144-9f48-4fbe-b646-2d146e57606a@gmail.com> (raw)
In-Reply-To: <b3d3deced25f038defe6afe7d474350464328299.1728299466.git.gitgitgadget@gmail.com>

Hi Usman

I missed this when I read the earlier version of this series but our 
commit subjects use the imperative so we would say

     t3403: employ test_line_count() to replace test

or

     t3404: replace test with test_line_count()

I agree with Patrick that we should let this series settle for a couple 
of days to allow others to comment before sending any new version.

This series is looking good, congratulations

Phillip

On 07/10/2024 12:11, Usman Akinyemi via GitGitGadget wrote:
> From: Usman Akinyemi <usmanakinyemi202@gmail.com>
> 
> Refactor t3404 to replace instances of `test` with `test_line_count()`
> for checking line counts. This improves readability and aligns with Git's
> current test practices.
> 
> Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
> ---
>   t/t3404-rebase-interactive.sh | 28 ++++++++++++++--------------
>   1 file changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
> index 96a65783c47..2ab660ef30f 100755
> --- a/t/t3404-rebase-interactive.sh
> +++ b/t/t3404-rebase-interactive.sh
> @@ -281,8 +281,9 @@ test_expect_success 'stop on conflicting pick' '
>   	test_cmp expect2 file1 &&
>   	test "$(git diff --name-status |
>   		sed -n -e "/^U/s/^U[^a-z]*//p")" = file1 &&
> -	test 4 = $(grep -v "^#" < .git/rebase-merge/done | wc -l) &&
> -	test 0 = $(grep -c "^[^#]" < .git/rebase-merge/git-rebase-todo)
> +	grep -v "^#" <.git/rebase-merge/done >actual &&
> +	test_line_count = 4 actual &&
> +	test 0 = $(grep -c "^[^#]" <.git/rebase-merge/git-rebase-todo)
>   '
>   
>   test_expect_success 'show conflicted patch' '
> @@ -401,8 +402,8 @@ test_expect_success 'multi-squash only fires up editor once' '
>   	) &&
>   	test $base = $(git rev-parse HEAD^) &&
>   	git show >output &&
> -	count=$(grep ONCE output | wc -l) &&
> -	test 1 = $count
> +	grep ONCE output >actual &&
> +	test_line_count = 1 actual
>   '
>   
>   test_expect_success 'multi-fixup does not fire up editor' '
> @@ -416,8 +417,7 @@ test_expect_success 'multi-fixup does not fire up editor' '
>   	) &&
>   	test $base = $(git rev-parse HEAD^) &&
>   	git show >output &&
> -	count=$(grep NEVER output | wc -l) &&
> -	test 0 = $count &&
> +	! grep NEVER output &&
>   	git checkout @{-1} &&
>   	git branch -D multi-fixup
>   '
> @@ -436,8 +436,8 @@ test_expect_success 'commit message used after conflict' '
>   	) &&
>   	test $base = $(git rev-parse HEAD^) &&
>   	git show >output &&
> -	count=$(grep ONCE output | wc -l) &&
> -	test 1 = $count &&
> +	grep ONCE output >actual &&
> +	test_line_count = 1 actual &&
>   	git checkout @{-1} &&
>   	git branch -D conflict-fixup
>   '
> @@ -456,8 +456,8 @@ test_expect_success 'commit message retained after conflict' '
>   	) &&
>   	test $base = $(git rev-parse HEAD^) &&
>   	git show >output &&
> -	count=$(grep TWICE output | wc -l) &&
> -	test 2 = $count &&
> +	grep TWICE output >actual &&
> +	test_line_count = 2 actual &&
>   	git checkout @{-1} &&
>   	git branch -D conflict-squash
>   '
> @@ -501,8 +501,8 @@ test_expect_success 'squash ignores comments' '
>   	) &&
>   	test $base = $(git rev-parse HEAD^) &&
>   	git show >output &&
> -	count=$(grep ONCE output | wc -l) &&
> -	test 1 = $count &&
> +	grep ONCE output >actual &&
> +	test_line_count = 1 actual &&
>   	git checkout @{-1} &&
>   	git branch -D skip-comments
>   '
> @@ -519,8 +519,8 @@ test_expect_success 'squash ignores blank lines' '
>   	) &&
>   	test $base = $(git rev-parse HEAD^) &&
>   	git show >output &&
> -	count=$(grep ONCE output | wc -l) &&
> -	test 1 = $count &&
> +	grep ONCE output >actual &&
> +	test_line_count = 1 actual &&
>   	git checkout @{-1} &&
>   	git branch -D skip-blank-lines
>   '


  reply	other threads:[~2024-10-07 15:07 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-06  5:33 [PATCH 0/2] [Outreachy][Patch v2] t3404: avoid losing exit status to pipes Usman Akinyemi via GitGitGadget
2024-10-06  5:33 ` [PATCH 1/2] [Outreachy][Patch v1] " Usman Akinyemi via GitGitGadget
2024-10-06  5:55   ` Eric Sunshine
2024-10-06  6:31     ` Usman Akinyemi
2024-10-06  5:33 ` [PATCH 2/2] [Outreachy][Patch v2] " Usman Akinyemi via GitGitGadget
2024-10-06  5:48   ` Eric Sunshine
2024-10-06  6:30     ` Usman Akinyemi
2024-10-06  7:28       ` Eric Sunshine
2024-10-06  8:26         ` Usman Akinyemi
2024-10-06  8:31 ` [PATCH v2] [Outreachy][Patch v1] " Usman Akinyemi via GitGitGadget
2024-10-06  9:19   ` Eric Sunshine
2024-10-06  9:32     ` Usman Akinyemi
2024-10-06 10:21       ` Eric Sunshine
2024-10-06 11:12     ` shejialuo
2024-10-06 12:06       ` Eric Sunshine
2024-10-06 12:28         ` Usman Akinyemi
2024-10-06 13:03           ` shejialuo
2024-10-06 13:27             ` Usman Akinyemi
2024-10-06 13:36               ` shejialuo
2024-10-06 12:29         ` shejialuo
2024-10-06 12:46           ` Usman Akinyemi
2024-10-07  4:19           ` Eric Sunshine
2024-10-06 16:06   ` [PATCH v3 0/2] [Outreachy][Patch v2] " Usman Akinyemi via GitGitGadget
2024-10-06 16:06     ` [PATCH v3 1/2] t3404: avoid losing exit status with focus on `git show` and `git cat-files` Usman Akinyemi via GitGitGadget
2024-10-07  6:04       ` Patrick Steinhardt
2024-10-07  8:52       ` phillip.wood123
2024-10-07  9:05         ` Usman Akinyemi
2024-10-06 16:06     ` [PATCH v3 2/2] [Outreachy][Patch v1] t3404: employing test_line_count() to replace test Usman Akinyemi via GitGitGadget
2024-10-06 16:31       ` Kristoffer Haugsbakk
2024-10-07  4:38       ` Eric Sunshine
2024-10-07  6:05       ` Patrick Steinhardt
2024-10-07  7:32         ` Usman Akinyemi
2024-10-07  9:00         ` phillip.wood123
2024-10-06 16:18     ` [PATCH v3 0/2] [Outreachy][Patch v2] t3404: avoid losing exit status to pipes Usman Akinyemi
2024-10-07  4:24       ` Eric Sunshine
2024-10-07  7:25         ` Usman Akinyemi
2024-10-07  8:08           ` Patrick Steinhardt
2024-10-07  8:11             ` Eric Sunshine
2024-10-07  9:01               ` Usman Akinyemi
2024-10-06 16:21     ` Kristoffer Haugsbakk
2024-10-06 16:26       ` Usman Akinyemi
2024-10-07  5:55         ` Patrick Steinhardt
2024-10-07 10:22     ` [PATCH v4 " Usman Akinyemi via GitGitGadget
2024-10-07 10:22       ` [PATCH v4 1/2] t3404: avoid losing exit status with focus on `git show` and `git cat-file` Usman Akinyemi via GitGitGadget
2024-10-07 10:22       ` [PATCH v4 2/2] [Outreachy][Patch v1] t3404: employing test_line_count() to replace test Usman Akinyemi via GitGitGadget
2024-10-07 10:28         ` Patrick Steinhardt
2024-10-07 10:51       ` [PATCH v5 0/2] [Outreachy][Patch v2] t3404: avoid losing exit status to pipes Usman Akinyemi via GitGitGadget
2024-10-07 10:51         ` [PATCH v5 1/2] t3404: avoid losing exit status with focus on `git show` and `git cat-file` Usman Akinyemi via GitGitGadget
2024-10-07 10:51         ` [PATCH v5 2/2] t3404: employing test_line_count() to replace test Usman Akinyemi via GitGitGadget
2024-10-07 10:54           ` Patrick Steinhardt
2024-10-07 11:10             ` Usman Akinyemi
2024-10-07 11:11         ` [PATCH v6 0/2] [Outreachy][Patch v2] t3404: avoid losing exit status to pipes Usman Akinyemi via GitGitGadget
2024-10-07 11:11           ` [PATCH v6 1/2] t3404: avoid losing exit status with focus on `git show` and `git cat-file` Usman Akinyemi via GitGitGadget
2024-10-07 11:11           ` [PATCH v6 2/2] t3404: employing test_line_count() to replace test Usman Akinyemi via GitGitGadget
2024-10-07 15:07             ` Phillip Wood [this message]
2024-10-07 15:32               ` Usman Akinyemi
2024-10-07 11:12           ` [PATCH v6 0/2] [Outreachy][Patch v2] t3404: avoid losing exit status to pipes Patrick Steinhardt
2024-10-07 11:16             ` Usman Akinyemi
2024-10-07 11:32               ` Patrick Steinhardt
2024-10-07 11:44                 ` Usman Akinyemi
2024-10-07 15:32           ` [PATCH v7 " Usman Akinyemi via GitGitGadget
2024-10-07 15:32             ` [PATCH v7 1/2] t3404: avoid losing exit status with focus on `git show` and `git cat-file` Usman Akinyemi via GitGitGadget
2024-10-07 15:32             ` [PATCH v7 2/2] t3404: replace test with test_line_count() Usman Akinyemi via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4f79f144-9f48-4fbe-b646-2d146e57606a@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=ps@pks.im \
    --cc=usmanakinyemi202@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).