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

[PATCH] Make t8001-annotate and t8002-blame more portable

From
DSDennis Stosberg <dennis@stosberg.net>
Date
Jun 18, 2006, 20:33 UTC
Message-ID
<20060618203321.G2e8b0080@leonov.stosberg.net>

These two tests assume that "sed" will not modify the final line of a stream if it does not end with a newline character. The assumption is not true at least for FreeBSD and Solaris 9. FreeBSD's "sed" appends a newline character; "sed" in Solaris 9 even removes the incomplete final line. This patch makes the test use perl instead.

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
---
 t/annotate-tests.sh |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index 114938c..71d0f30 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -111,9 +111,7 @@ test_expect_success \
 
 test_expect_success \
     'some edit' \
-    'mv file file1 &&
-     sed -e 1d -e "5s/3A/99/" file1 >file &&
-     rm -f file1 &&
+    'perl -pi -e "s/^1A.*\n$//; s/^3A/99/" file &&
     GIT_AUTHOR_NAME="D" git commit -a -m "edit"'
 
 test_expect_success \
-- 
1.4.0
Next: Junio C Hamano
Message 1 of 6 in “Make t8001-annotate and t8002-blame more portable”
  1. Make t8001-annotate and t8002-blame more portableDennis Stosberg, Jun 18, 2006
  2. Junio C HamanoJun 18, 2006
  3. Dennis StosbergJun 18, 2006
  4. Junio C HamanoJun 18, 2006
  5. Alex RiesenJun 19, 2006
  6. Fix t8001-annotate and t8002-blame for ActiveState PerlDennis Stosberg, Jun 19, 2006

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.