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

[PATCH] t7508: avoid non-portable sed expression

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Sep 14, 2013, 04:47 UTC
Message-ID
<1379134032-83211-1-git-send-email-sunshine@sunshineco.com>

2556b996 (status: disable display of '#' comment prefix by default; 2013-09-06) introduced tests which fail on Mac OS X due to unportable use of \t (for TAB) in a sed expression. POSIX [1][2] also disallows it. Fix this.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html#tag_20_116_13_02 [2]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_02

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
---
This applies against 'next'.
 t/t7508-status.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 7d52dbf..6fb59f3 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -61,7 +61,8 @@ test_expect_success 'status (1)' '
 '
 
 strip_comments () {
-	sed "s/^\# //; s/^\#$//; s/^#\t/\t/" <"$1" >"$1".tmp &&
+	tab='	'
+	sed "s/^\# //; s/^\#$//; s/^#$tab/$tab/" <"$1" >"$1".tmp &&
 	rm "$1" && mv "$1".tmp "$1"
 }
 
-- 
1.8.4.535.g7b94f8e
Next: Matthieu Moy
Message 1 of 2 in “t7508: avoid non-portable sed expression”
  1. t7508: avoid non-portable sed expressionEric Sunshine, Sep 14, 2013
  2. Matthieu MoySep 14, 2013

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.