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

[PATCH] t/annotate-tests: Use echo & cat instead of sed

From
Brian Gernhardt <brian@gernhardtsoftware.com>
Date
May 5, 2011, 04:43 UTC
Message-ID
<1304570617-17603-1-git-send-email-brian@gernhardtsoftware.com>

The use of the sed command "1i No robots allowed" caused the version of sed in OS X to die with

   sed: 1: "1i "No robots allowed"\n": command i expects \ followed by
   text

Since this command was just trying to add a single line to the beginning of the file, do the same with "echo > file.net && cat file

>> file.new"
Unbreaks t8001 and t8002 on OS X 10.6.7
---
 t/annotate-tests.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index abb1885..c56a77d 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -127,7 +127,8 @@ test_expect_success \
 
 test_expect_success \
     'an obfuscated email added' \
-    'sed -e "1i No robots allowed" < file > file.new &&
+    'echo "No robots allowed" > file.new &&
+     cat file >> file.new &&
      mv file.new file &&
      GIT_AUTHOR_NAME="E" GIT_AUTHOR_EMAIL="E at test dot git" git commit -a -m "norobots"'
 
-- 
1.7.5.258.g6ba2f
Next: Junio C Hamano
Message 1 of 3 in “t/annotate-tests: Use echo & cat instead of sed”
  1. t/annotate-tests: Use echo & cat instead of sedBrian Gernhardt, May 5, 2011
  2. Junio C HamanoMay 5, 2011
  3. Arjen LaarhovenMay 5, 2011

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.