{"thread":{"id":"34930","subject":"[PATCH] t7508: avoid non-portable sed expression","startedAt":"2013-09-14T04:47:12Z","lastAt":"2013-09-14T17:50:33Z","messageCount":2,"participants":["Eric Sunshine","Matthieu Moy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"227669","messageId":"1379134032-83211-1-git-send-email-sunshine@sunshineco.com","threadId":"34930","inReplyTo":null,"subject":"[PATCH] t7508: avoid non-portable sed expression","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-09-14T04:47:12Z","receivedAt":"2013-09-14T04:47:12Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"2556b996 (status: disable display of '#' comment prefix by default;\n2013-09-06) introduced tests which fail on Mac OS X due to unportable\nuse of \\t (for TAB) in a sed expression. POSIX [1][2] also disallows\nit. Fix this.\n\n[1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html#tag_20_116_13_02\n[2]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_02\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n\nThis applies against 'next'.\n\n t/t7508-status.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex 7d52dbf..6fb59f3 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -61,7 +61,8 @@ test_expect_success 'status (1)' '\n '\n \n strip_comments () {\n-\tsed \"s/^\\# //; s/^\\#$//; s/^#\\t/\\t/\" <\"$1\" >\"$1\".tmp &&\n+\ttab='\t'\n+\tsed \"s/^\\# //; s/^\\#$//; s/^#$tab/$tab/\" <\"$1\" >\"$1\".tmp &&\n \trm \"$1\" && mv \"$1\".tmp \"$1\"\n }\n \n-- \n1.8.4.535.g7b94f8e\n"},{"id":"227685","messageId":"vpqppsbe1hy.fsf@anie.imag.fr","threadId":"34930","inReplyTo":"1379134032-83211-1-git-send-email-sunshine@sunshineco.com","subject":"Re: [PATCH] t7508: avoid non-portable sed expression","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2013-09-14T17:50:33Z","receivedAt":"2013-09-14T17:50:33Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n>  strip_comments () {\n> -\tsed \"s/^\\# //; s/^\\#$//; s/^#\\t/\\t/\" <\"$1\" >\"$1\".tmp &&\n> +\ttab='\t'\n> +\tsed \"s/^\\# //; s/^\\#$//; s/^#$tab/$tab/\" <\"$1\" >\"$1\".tmp &&\n\nSounds trivially right.\n\nSorry for breaking this.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}