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

Re: [PATCHv2] am: fix patch format detection for Thunderbird "Save As" emails

From
Stephen Boyd <bebarino@gmail.com>
Date
Dec 18, 2009, 21:59 UTC
Message-ID
<1261173577.14059.5.camel@swboyd-laptop>
In-Reply-To
<loom.20091218T223918-175@post.gmane.org>
On Fri, 2009-12-18 at 21:42 +0000, Eric Blake wrote:
Show 12 quoted lines
> Stephen Boyd <bebarino <at> gmail.com> writes:
> 
> > +	{
> > +		echo "X-Fake-Field: Line One\015" &&
> 
> echo and \ do not portably mix.  For that matter, shell double quotes and 
> backslash escapes that are not required by POSIX do not portably mix.  To 
> reliably create carriage returns in shell, you need to use printf, or else 
> something like:
> 
> echo "...@" | tr '@' '\015'
> 
Thanks. Hopefully squashing this in will make it even more portable?
--->8---
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 7b6269d..19d5ca1 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -84,18 +84,18 @@ test_expect_success setup '
                git format-patch --stdout first | sed -e "1d"
        } > patch1.eml &&
        {
-               echo "X-Fake-Field: Line One\015" &&
-               echo "X-Fake-Field: Line Two\015" &&
-               echo "X-Fake-Field: Line Three\015" &&
+               printf "X-Fake-Field: Line One\015\n" &&
+               printf "X-Fake-Field: Line Two\015\n" &&
+               printf "X-Fake-Field: Line Three\015\n" &&
                git format-patch --stdout first |
                sed -e "1d" -e "3,\$d" | tr -d "\n" &&
-               echo "\015" &&
+               printf "\015\n" &&
                git format-patch --stdout first |
                sed -e "1,2d" -e "4,\$d" | tr -d "\n" &&
-               echo "\015" &&
+               printf "\015\n" &&
                git format-patch --stdout first |
                sed -e "1,3d" -e "5,\$d" | tr -d "\n" &&
-               echo "\015\n\015" &&
+               printf "\015\n\015\n" &&
                git format-patch --stdout first | sed -e "1,5d"
        } > patch1-crlf.eml &&
        sed -n -e "3,\$p" msg >file &&
Previous: Eric BlakeNext: Eric Blake
Message 5 of 16 in “am: fix patch format detection for Thunderbird "Save As" emails”
  1. am: fix patch format detection for Thunderbird "Save As" emailsStephen Boyd, Dec 17, 2009
  2. Junio C HamanoDec 18, 2009
  3. [PATCHv2] am: fix patch format detection for Thunderbird "Save As" emailsStephen Boyd, Dec 18, 2009
  4. Eric BlakeDec 18, 2009
  5. Stephen BoydDec 18, 2009
  6. Eric BlakeDec 18, 2009
  7. Stephen BoydDec 19, 2009
  8. Eric BlakeDec 19, 2009
  9. Stephen BoydDec 19, 2009
  10. Stephen BoydDec 19, 2009
  11. Junio C HamanoDec 19, 2009
  12. Stephen BoydDec 19, 2009
  13. Andreas SchwabDec 19, 2009
  14. Junio C HamanoDec 18, 2009
  15. Nanako ShiraishiJan 5, 2010
  16. Stephen BoydJan 21, 2010

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.