threads / patch / 61485

patcht/t0211-trace2-perf.sh: fix typo patern -> pattern

Subject: [PATCH] t/t0211-trace2-perf.sh: fix typo patern -> pattern

## tl;dr

3 messages between May 15, 2024 and May 16, 2024. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Marcel Telka· May 15, 2024, 22:51 UTC · lore
Signed-off-by: Marcel Telka <marcel@telka.sk>
---
 t/t0211-trace2-perf.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to t/t0211-trace2-perf.sh +1 −1
diff --git a/t/t0211-trace2-perf.sh b/t/t0211-trace2-perf.sh
index 13ef69b92f..070fe7a5da 100755
--- a/t/t0211-trace2-perf.sh
+++ b/t/t0211-trace2-perf.sh
@@ -233,7 +233,7 @@ have_counter_event () {
 
 	pattern="d0|${thread}|${event}||||${category}|name:${name} value:${value}" &&
 
-	grep "${patern}" ${file}
+	grep "${pattern}" ${file}
 }
 
 test_expect_success 'global counter test/test1' '
Patrick Steinhardt· May 16, 2024, 04:17 UTC · re: Marcel Telka · lore

Re: [PATCH] t/t0211-trace2-perf.sh: fix typo patern -> pattern

On Thu, May 16, 2024 at 12:51:00AM +0200, Marcel Telka wrote:

Thanks for the patch, which looks obviously good to me. It would be nice to have a short explanation in the commit message that explains why this issue was able to sneak.

Patrick
Show 19 quoted lines
> Signed-off-by: Marcel Telka <marcel@telka.sk>
> ---
>  t/t0211-trace2-perf.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/t/t0211-trace2-perf.sh b/t/t0211-trace2-perf.sh
> index 13ef69b92f..070fe7a5da 100755
> --- a/t/t0211-trace2-perf.sh
> +++ b/t/t0211-trace2-perf.sh
> @@ -233,7 +233,7 @@ have_counter_event () {
>  
>  	pattern="d0|${thread}|${event}||||${category}|name:${name} value:${value}" &&
>  
> -	grep "${patern}" ${file}
> +	grep "${pattern}" ${file}
>  }
>  
>  test_expect_success 'global counter test/test1' '
> 
Junio C Hamano· May 16, 2024, 15:38 UTC · re: Patrick Steinhardt · lore

Re: [PATCH] t/t0211-trace2-perf.sh: fix typo patern -> pattern

Patrick Steinhardt <ps@pks.im> writes:
Show 7 quoted lines
> On Thu, May 16, 2024 at 12:51:00AM +0200, Marcel Telka wrote:
>
> Thanks for the patch, which looks obviously good to me. It would be nice
> to have a short explanation in the commit message that explains why this
> issue was able to sneak.
>
> Patrick
A good piece of advice.

FYI, I have the following since last night, as the original report was whitespace damaged and did not apply.

-------- >8 --------------- >8 --------------- >8 --------
Subject: [PATCH] t0211: typofix

Marcel Telka noticed that one test assigns to $pattern and then uses $patern in an invocation of "grep". Of course, looking for an empty string will succeed, so the test succeeds for a wrong reason.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t0211-trace2-perf.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to t/t0211-trace2-perf.sh +1 −1
diff --git a/t/t0211-trace2-perf.sh b/t/t0211-trace2-perf.sh
index 0b3436e8ca..37a51e6449 100755
--- a/t/t0211-trace2-perf.sh
+++ b/t/t0211-trace2-perf.sh
@@ -233,7 +233,7 @@ have_counter_event () {
 
 	pattern="d0|${thread}|${event}||||${category}|name:${name} value:${value}" &&
 
-	grep "${patern}" ${file}
+	grep "${pattern}" ${file}
 }
 
 test_expect_success 'global counter test/test1' '
-- 
2.45.1-190-g19fe900cfc

← back to recent threads