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

Re: [PATCH v2] generate-configlist: collapse depfile for older Ninja

From
Toon Claes <toon@iotcl.com>
Date
May 15, 2026, 08:44 UTC
Message-ID
<87wlx59i4n.fsf@emacs.iotcl.com>
In-Reply-To
<0557838b-214d-4e8f-9cbd-bc342563e9ba@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 29 quoted lines
> I don't think this use of '\n' portable. The sed man page [1] says that 
> '\n' matches a newline in the pattern space, but does not mention it 
> being supported in the replacement string. We do have an existing use in 
> t4150-am.sh:"am newline in subject" which does
>
> 	sed -e "s/second/second \\\n foo/" patch1 >patchnl &&
>
> However if I add "cat patchnl" it shows the subject line is
>
> 	Subject: [PATCH] second \n foo
>
> so sed has inserted "\n" rather than a newline. Indeed looking at the 
> commit message for that test it is testing a fix that c escapes are 
> printed verbatim introduced by 4b7cc26a74 (git-am: use printf instead of 
> echo on user-supplied strings, 2007-05-25).
>
> I've not tested it but I think
>
> 	sed 's/ $/\
> /'
>
> will insert a newline. Alternatively we could do
>
> 	printf '%s' "$QUOTED_OUTPUT: "
> 	printf '%s\n' "$SOURCE_DIR"/Documentation/*config.adoc \
>   			"$SOURCE_DIR"/Documentation/config/*.adoc |
> 		sed -e 's/[# ]/\\&/g' |
> 		tr '\n' ' '
> 	printf '\n'

Whoops, I somehow archived your reply without addressing it. Thanks for finding this. I've sent out v3 with this suggestion.

-- Toon

Previous: Phillip WoodNext: Toon Claes
Message 8 of 12 in “generate-configlist: collapse depfile for older Ninja”
  1. generate-configlist: collapse depfile for older NinjaToon Claes, Apr 21, 2026
  2. Patrick SteinhardtApr 22, 2026
  3. Toon ClaesApr 22, 2026
  4. generate-configlist: collapse depfile for older NinjaToon Claes, Apr 22, 2026
  5. Patrick SteinhardtApr 22, 2026
  6. Phillip WoodApr 22, 2026
  7. Phillip WoodApr 22, 2026
  8. Toon ClaesMay 15, 2026
  9. generate-configlist: collapse depfile for older NinjaToon Claes, May 15, 2026
  10. Phillip WoodMay 15, 2026
  11. Patrick SteinhardtMay 21, 2026
  12. D. Ben KnobleApr 22, 2026

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.