git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 19/22] t/t8*: merge "grep | sed" pipelines

From
BBBeat Bolli <bb@drbeat.li>
Date
Mar 5, 2024, 21:25 UTC
Message-ID
<20240305212533.12947-20-dev+git@drbeat.li>
In-Reply-To
<20240305212533.12947-1-dev+git@drbeat.li>
Signed-off-by: Beat Bolli <dev+git@drbeat.li>
---
 t/t8013-blame-ignore-revs.sh | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/t/t8013-blame-ignore-revs.sh b/t/t8013-blame-ignore-revs.sh
index 9a03b0f361ff..05213d13f30f 100755
--- a/t/t8013-blame-ignore-revs.sh
+++ b/t/t8013-blame-ignore-revs.sh
@@ -25,11 +25,11 @@ test_expect_success setup '
 
 	git blame --line-porcelain file >blame_raw &&
 
-	grep -E "^[0-9a-f]+ [0-9]+ 1" blame_raw | sed -e "s/ .*//" >actual &&
+	sed -Ene "/^[0-9a-f]+ [0-9]+ 1/s/ .*//p" blame_raw >actual &&
 	git rev-parse X >expect &&
 	test_cmp expect actual &&
 
-	grep -E "^[0-9a-f]+ [0-9]+ 2" blame_raw | sed -e "s/ .*//" >actual &&
+	sed -Ene "/^[0-9a-f]+ [0-9]+ 2/s/ .*//p" blame_raw >actual &&
 	git rev-parse X >expect &&
 	test_cmp expect actual
 '
@@ -53,11 +53,11 @@ do
 	test_expect_success "ignore_rev_changing_lines ($I)" '
 		git blame --line-porcelain --ignore-rev $I file >blame_raw &&
 
-		grep -E "^[0-9a-f]+ [0-9]+ 1" blame_raw | sed -e "s/ .*//" >actual &&
+		sed -Ene "/^[0-9a-f]+ [0-9]+ 1/s/ .*//p" blame_raw >actual &&
 		git rev-parse A >expect &&
 		test_cmp expect actual &&
 
-		grep -E "^[0-9a-f]+ [0-9]+ 2" blame_raw | sed -e "s/ .*//" >actual &&
+		sed -Ene "/^[0-9a-f]+ [0-9]+ 2/s/ .*//p" blame_raw >actual &&
 		git rev-parse B >expect &&
 		test_cmp expect actual
 	'
@@ -79,10 +79,10 @@ test_expect_success ignore_rev_adding_unblamable_lines '
 	git rev-parse Y >expect &&
 	git blame --line-porcelain file --ignore-rev Y >blame_raw &&
 
-	grep -E "^[0-9a-f]+ [0-9]+ 3" blame_raw | sed -e "s/ .*//" >actual &&
+	sed -Ene "/^[0-9a-f]+ [0-9]+ 3/s/ .*//p" blame_raw >actual &&
 	test_cmp expect actual &&
 
-	grep -E "^[0-9a-f]+ [0-9]+ 4" blame_raw | sed -e "s/ .*//" >actual &&
+	sed -Ene "/^[0-9a-f]+ [0-9]+ 4/s/ .*//p" blame_raw >actual &&
 	test_cmp expect actual
 '
 
@@ -92,11 +92,11 @@ test_expect_success ignore_revs_from_files '
 	git rev-parse Y >ignore_y &&
 	git blame --line-porcelain file --ignore-revs-file ignore_x --ignore-revs-file ignore_y >blame_raw &&
 
-	grep -E "^[0-9a-f]+ [0-9]+ 1" blame_raw | sed -e "s/ .*//" >actual &&
+	sed -Ene "/^[0-9a-f]+ [0-9]+ 1/s/ .*//p" blame_raw >actual &&
 	git rev-parse A >expect &&
 	test_cmp expect actual &&
 
-	grep -E "^[0-9a-f]+ [0-9]+ 2" blame_raw | sed -e "s/ .*//" >actual &&
+	sed -Ene "/^[0-9a-f]+ [0-9]+ 2/s/ .*//p" blame_raw >actual &&
 	git rev-parse B >expect &&
 	test_cmp expect actual
 '
@@ -106,11 +106,11 @@ test_expect_success ignore_revs_from_configs_and_files '
 	git config --add blame.ignoreRevsFile ignore_x &&
 	git blame --line-porcelain file --ignore-revs-file ignore_y >blame_raw &&
 
-	grep -E "^[0-9a-f]+ [0-9]+ 1" blame_raw | sed -e "s/ .*//" >actual &&
+	sed -Ene "/^[0-9a-f]+ [0-9]+ 1/s/ .*//p" blame_raw >actual &&
 	git rev-parse A >expect &&
 	test_cmp expect actual &&
 
-	grep -E "^[0-9a-f]+ [0-9]+ 2" blame_raw | sed -e "s/ .*//" >actual &&
+	sed -Ene "/^[0-9a-f]+ [0-9]+ 2/s/ .*//p" blame_raw >actual &&
 	git rev-parse B >expect &&
 	test_cmp expect actual
 '
@@ -121,10 +121,10 @@ test_expect_success override_ignore_revs_file '
 	git blame --line-porcelain file --ignore-revs-file "" --ignore-revs-file ignore_y >blame_raw &&
 	git rev-parse X >expect &&
 
-	grep -E "^[0-9a-f]+ [0-9]+ 1" blame_raw | sed -e "s/ .*//" >actual &&
+	sed -Ene "/^[0-9a-f]+ [0-9]+ 1/s/ .*//p" blame_raw >actual &&
 	test_cmp expect actual &&
 
-	grep -E "^[0-9a-f]+ [0-9]+ 2" blame_raw | sed -e "s/ .*//" >actual &&
+	sed -Ene "/^[0-9a-f]+ [0-9]+ 2/s/ .*//p" blame_raw >actual &&
 	test_cmp expect actual
 	'
 test_expect_success bad_files_and_revs '
@@ -279,11 +279,11 @@ test_expect_success ignore_merge '
 	test_merge M B &&
 	git blame --line-porcelain file --ignore-rev M >blame_raw &&
 
-	grep -E "^[0-9a-f]+ [0-9]+ 1" blame_raw | sed -e "s/ .*//" >actual &&
+	sed -Ene "/^[0-9a-f]+ [0-9]+ 1/s/ .*//p" blame_raw >actual &&
 	git rev-parse B >expect &&
 	test_cmp expect actual &&
 
-	grep -E "^[0-9a-f]+ [0-9]+ 9" blame_raw | sed -e "s/ .*//" >actual &&
+	sed -Ene "/^[0-9a-f]+ [0-9]+ 9/s/ .*//p" blame_raw >actual &&
 	git rev-parse C >expect &&
 	test_cmp expect actual
 '
-- 
2.44.0
Previous: Junio C HamanoNext: Junio C Hamano
Message 36 of 78 in “avoid redundant pipelines”
  1. 00/22 avoid redundant pipelinesBeat Bolli, Mar 5, 2024
  2. 01/22 doc: avoid redundant use of catBeat Bolli, Mar 5, 2024
  3. Junio C HamanoMar 5, 2024
  4. 02/22 contrib/subtree/t: avoid redundant use of catBeat Bolli, Mar 5, 2024
  5. Junio C HamanoMar 5, 2024
  6. 03/22 t/lib-cvs.sh: avoid redundant use of catBeat Bolli, Mar 5, 2024
  7. Junio C HamanoMar 5, 2024
  8. 04/22 t/annotate-tests.sh: avoid redundant use of catBeat Bolli, Mar 5, 2024
  9. Junio C HamanoMar 5, 2024
  10. Rubén JustoMar 6, 2024
  11. Junio C HamanoMar 6, 2024
  12. Rubén JustoMar 6, 2024
  13. 05/22 t/perf: avoid redundant use of catBeat Bolli, Mar 5, 2024
  14. Junio C HamanoMar 5, 2024
  15. 06/22 t/t0*: avoid redundant uses of catBeat Bolli, Mar 5, 2024
  16. 07/22 t/t1*: avoid redundant uses of catBeat Bolli, Mar 5, 2024
  17. 08/22 t/t3*: avoid redundant uses of catBeat Bolli, Mar 5, 2024
  18. 09/22 t/t4*: avoid redundant uses of catBeat Bolli, Mar 5, 2024
  19. Junio C HamanoMar 6, 2024
  20. Eric SunshineMar 6, 2024
  21. Beat BolliMar 6, 2024
  22. 10/22 t/t5*: avoid redundant uses of catBeat Bolli, Mar 5, 2024
  23. 11/22 t/t6*: avoid redundant uses of catBeat Bolli, Mar 5, 2024
  24. 12/22 t/t7*: avoid redundant use of catBeat Bolli, Mar 5, 2024
  25. 13/22 t/t8*: avoid redundant use of catBeat Bolli, Mar 5, 2024
  26. 14/22 t/t9*: avoid redundant uses of catBeat Bolli, Mar 5, 2024
  27. Rubén JustoMar 5, 2024
  28. Junio C HamanoMar 6, 2024
  29. Rubén JustoMar 6, 2024
  30. 15/22 t/t1*: merge a "grep | sed" pipelineBeat Bolli, Mar 5, 2024
  31. 16/22 t/t3*: merge a "grep | awk" pipelineBeat Bolli, Mar 5, 2024
  32. Junio C HamanoMar 6, 2024
  33. 17/22 t/t4*: merge a "grep | sed" pipelineBeat Bolli, Mar 5, 2024
  34. 18/22 t/t5*: merge a "grep | sed" pipelineBeat Bolli, Mar 5, 2024
  35. Junio C HamanoMar 6, 2024
  36. 19/22 t/t8*: merge "grep | sed" pipelinesBeat Bolli, Mar 5, 2024
  37. Junio C HamanoMar 6, 2024
  38. Todd ZullingerMar 6, 2024
  39. Junio C HamanoMar 6, 2024
  40. Beat BolliMar 6, 2024
  41. Junio C HamanoMar 6, 2024
  42. 20/22 t/t9*: merge "grep | sed" pipelinesBeat Bolli, Mar 5, 2024
  43. Junio C HamanoMar 6, 2024
  44. 21/22 contrib/coverage-diff: avoid redundant pipelinesBeat Bolli, Mar 5, 2024
  45. 22/22 git-quiltimport: avoid an unnecessary subshellBeat Bolli, Mar 5, 2024
  46. Rubén JustoMar 5, 2024
  47. Rubén JustoMar 5, 2024
  48. Junio C HamanoMar 5, 2024
  49. 00/22 avoid redundant pipelinesBeat Bolli, Mar 15, 2024
  50. 01/22 doc: avoid redundant use of catBeat Bolli, Mar 15, 2024
  51. 07/22 t/t1*: avoid redundant uses of catBeat Bolli, Mar 15, 2024
  52. 06/22 t/t0*: avoid redundant uses of catBeat Bolli, Mar 15, 2024
  53. 02/22 contrib/subtree/t: avoid redundant use of catBeat Bolli, Mar 15, 2024
  54. 08/22 t/t3*: avoid redundant uses of catBeat Bolli, Mar 15, 2024
  55. 03/22 t/lib-cvs.sh: avoid redundant use of catBeat Bolli, Mar 15, 2024
  56. 09/22 t/t4*: avoid redundant uses of catBeat Bolli, Mar 15, 2024
  57. Taylor BlauMar 16, 2024
  58. Junio C HamanoMar 16, 2024
  59. 04/22 t/annotate-tests.sh: avoid redundant use of catBeat Bolli, Mar 15, 2024
  60. 10/22 t/t5*: avoid redundant uses of catBeat Bolli, Mar 15, 2024
  61. 05/22 t/perf: avoid redundant use of catBeat Bolli, Mar 15, 2024
  62. 11/22 t/t6*: avoid redundant uses of catBeat Bolli, Mar 15, 2024
  63. 12/22 t/t7*: avoid redundant use of catBeat Bolli, Mar 15, 2024
  64. 13/22 t/t8*: avoid redundant use of catBeat Bolli, Mar 15, 2024
  65. 14/22 t/t9*: avoid redundant uses of catBeat Bolli, Mar 15, 2024
  66. 15/22 t/t1*: merge a "grep | sed" pipelineBeat Bolli, Mar 15, 2024
  67. 16/22 t/t3*: merge a "grep | awk" pipelineBeat Bolli, Mar 15, 2024
  68. Taylor BlauMar 16, 2024
  69. Beat BolliMar 16, 2024
  70. Taylor BlauMar 16, 2024
  71. 17/22 t/t4*: merge a "grep | sed" pipelineBeat Bolli, Mar 15, 2024
  72. 18/22 t/t5*: merge a "grep | sed" pipelineBeat Bolli, Mar 15, 2024
  73. 19/22 t/t8*: merge "grep | sed" pipelinesBeat Bolli, Mar 15, 2024
  74. 20/22 t/t9*: merge "grep | sed" pipelinesBeat Bolli, Mar 15, 2024
  75. 21/22 contrib/coverage-diff: avoid redundant pipelinesBeat Bolli, Mar 15, 2024
  76. 22/22 git-quiltimport: avoid an unnecessary subshellBeat Bolli, Mar 15, 2024
  77. Taylor BlauMar 16, 2024
  78. Junio C HamanoMar 16, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.