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

[PATCH] t6013: Avoid using tac

From
Brian Gernhardt <benji@silverinsanity.com>
Date
Aug 31, 2008, 20:03 UTC
Message-ID
<1220212998-90810-1-git-send-email-benji@silverinsanity.com>

Although tac is useful for testing for reversed output, it is not available everywhere. Replace uses of tac with hand-rolled expected files.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
---
 t/t6013-rev-list-reverse-parents.sh |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/t/t6013-rev-list-reverse-parents.sh b/t/t6013-rev-list-reverse-parents.sh
index d294466..f023fae 100755
--- a/t/t6013-rev-list-reverse-parents.sh
+++ b/t/t6013-rev-list-reverse-parents.sh
@@ -23,17 +23,29 @@ test_expect_success 'set up --reverse example' '
 	commit five
 	'
 
+cat >expected <<\EOF
+86412ffbe95da677fa145e05bcedc75d0d4e49f7
+4931c530d1fde996a29be48a97a056f13ab5e9ce 86412ffbe95da677fa145e05bcedc75d0d4e49f7
+0fcb03eaefb4569dea16195a244d95523cff4934 86412ffbe95da677fa145e05bcedc75d0d4e49f7
+524efe5b12a180964d586b6c47314ea015a98614 4931c530d1fde996a29be48a97a056f13ab5e9ce 0fcb03eaefb4569dea16195a244d95523cff4934
+2ed4a763ad375916b4f0fc34ed08f5843299ded6 524efe5b12a180964d586b6c47314ea015a98614
+EOF
+
 test_expect_success '--reverse --parents --full-history combines correctly' '
-	git rev-list --parents --full-history master -- foo |
-		tac > expected &&
 	git rev-list --reverse --parents --full-history master -- foo \
 		> actual &&
 	test_cmp actual expected
 	'
 
+cat >expected <<\EOF
+-86412ffbe95da677fa145e05bcedc75d0d4e49f7
+4931c530d1fde996a29be48a97a056f13ab5e9ce 86412ffbe95da677fa145e05bcedc75d0d4e49f7
+0fcb03eaefb4569dea16195a244d95523cff4934 86412ffbe95da677fa145e05bcedc75d0d4e49f7
+524efe5b12a180964d586b6c47314ea015a98614 4931c530d1fde996a29be48a97a056f13ab5e9ce 0fcb03eaefb4569dea16195a244d95523cff4934
+2ed4a763ad375916b4f0fc34ed08f5843299ded6 524efe5b12a180964d586b6c47314ea015a98614
+EOF
+
 test_expect_success '--boundary does too' '
-	git rev-list --boundary --parents --full-history master ^root -- foo |
-		tac > expected &&
 	git rev-list --boundary --reverse --parents --full-history \
 		master ^root -- foo > actual &&
 	test_cmp actual expected
-- 
1.6.0.1.207.g020e5
Next: Thomas Rast
Message 1 of 5 in “t6013: Avoid using tac”
  1. t6013: Avoid using tacBrian Gernhardt, Aug 31, 2008
  2. t6013: replace use of 'tac' with equivalent PerlThomas Rast, Aug 31, 2008
  3. Andreas EricssonSep 1, 2008
  4. Brian GernhardtSep 1, 2008
  5. Johannes SchindelinSep 1, 2008

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.