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

[PATCH] t6013: replace use of 'tac' with equivalent Perl

From
Thomas Rast <trast@student.ethz.ch>
Date
Aug 31, 2008, 22:31 UTC
Message-ID
<1220221897-6081-1-git-send-email-trast@student.ethz.ch>
In-Reply-To
<1220212998-90810-1-git-send-email-benji@silverinsanity.com>

'tac' is not available everywhere, so substitute the equivalent Perl code 'print reverse <>'. Noticed by Brian Gernhardt.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---

Thanks for pointing this out. However, I tried to avoid hardcoding those results by recommendation of t/README (last paragraph):

  ... If all the test scripts hardcoded the object IDs like
  t0000-basic.sh does, that defeats the purpose of t0000-basic.sh,
  which is to isolate that level of validation in one place.  Your
  test also ends up needing updating when such a change to the
  internal happens, so do _not_ do it and leave the low level of
  validation to t0000-basic.sh.

So I would favour this fix. I think this should be ok because we depend on Perl anyway.

- Thomas
 t/t6013-rev-list-reverse-parents.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t6013-rev-list-reverse-parents.sh b/t/t6013-rev-list-reverse-parents.sh
index d294466..59fc2f0 100755
--- a/t/t6013-rev-list-reverse-parents.sh
+++ b/t/t6013-rev-list-reverse-parents.sh
@@ -25,7 +25,7 @@ test_expect_success 'set up --reverse example' '
 
 test_expect_success '--reverse --parents --full-history combines correctly' '
 	git rev-list --parents --full-history master -- foo |
-		tac > expected &&
+		perl -e "print reverse <>" > expected &&
 	git rev-list --reverse --parents --full-history master -- foo \
 		> actual &&
 	test_cmp actual expected
@@ -33,7 +33,7 @@ test_expect_success '--reverse --parents --full-history combines correctly' '
 
 test_expect_success '--boundary does too' '
 	git rev-list --boundary --parents --full-history master ^root -- foo |
-		tac > expected &&
+		perl -e "print reverse <>" > expected &&
 	git rev-list --boundary --reverse --parents --full-history \
 		master ^root -- foo > actual &&
 	test_cmp actual expected
-- 
1.6.0.1.282.g3cc57
Previous: Brian GernhardtNext: Andreas Ericsson
Message 2 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.