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

Re: [PATCH v2] thunderbird-patch-inline: avoid bashism

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 11, 2025, 00:19 UTC
Message-ID
<xmqqa5at9vuo.fsf@gitster.g>
In-Reply-To
<20250210234947.1317056-1-sandals@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> I'll note that I could have just written '%s\n' here, but I think this
> is a little easier to reason about, so I didn't.

Yes, I actually was wondering why you didn't, as I find the "short format string makes the command iterate over its arguments" easier to understand, than how you wrote it. Either is fine, but that would also have been shorter.

Show 13 quoted lines
> diff --git a/contrib/thunderbird-patch-inline/appp.sh b/contrib/thunderbird-patch-inline/appp.sh
> index 1053872eea..fdcc948352 100755
> --- a/contrib/thunderbird-patch-inline/appp.sh
> +++ b/contrib/thunderbird-patch-inline/appp.sh
> @@ -31,7 +31,7 @@ BODY=$(sed -e "1,/${SEP}/d" $1)
>  CMT_MSG=$(sed -e '1,/^$/d' -e '/^---$/,$d' "${PATCH}")
>  DIFF=$(sed -e '1,/^---$/d' "${PATCH}")
>  
> -CCS=$(echo -e "$CMT_MSG\n$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
> +CCS=$(printf '%s\n%s\n' "$CMT_MSG" "$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp' \
>  	-e 's/^Signed-off-by: \(.*\)/\1,/gp')
>  
>  echo "$SUBJECT" > $1
Previous: brian m. carlson
Message 6 of 6 in “thunderbird-patch-inline: avoid bashism”
  1. thunderbird-patch-inline: avoid bashismbrian m. carlson, Feb 4, 2025
  2. D. Ben KnobleFeb 4, 2025
  3. brian m. carlsonFeb 4, 2025
  4. Junio C HamanoFeb 4, 2025
  5. thunderbird-patch-inline: avoid bashismbrian m. carlson, Feb 10, 2025
  6. Junio C HamanoFeb 11, 2025

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.