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

Re: [PATCH v2] completion: Make sed command that generates config-list.h portable.

From
Jean-Noël AVILA <jn.avila@free.fr>
Date
Jun 2, 2025, 19:49 UTC
Message-ID
<3631972.iIbC2pHGDl@cayenne>
In-Reply-To
<1ff542bb1090cc5185644d6032addac5cd0df402.1748892261.git.collin.funk1@gmail.com>
On Monday, 2 June 2025 21:26:47 CEST Collin Funk wrote:
Show 34 quoted lines
> The OpenBSD 'sed' command does not support '\n' to represent newlines in
> sed expressions. This leads to the follow compiler error:
> 
>     In file included from builtin/help.c:15:
>     ./config-list.h:282:18: error: use of undeclared identifier 'n'
>             "gitcvs.dbUser",n       "gitcvs.dbPass",
>                             ^
>     1 error generated.
>     gmake: *** [Makefile:2821: builtin/help.o] Error 1
> 
> We can use a backslash followed by a newline to fix this.
> 
> This portably issue was introduced in e1b81f54da (completion: take into
> account the formatting backticks for options, 2025-03-19)
> 
> Signed-off-by: Collin Funk <collin.funk1@gmail.com>
> ---
>  generate-configlist.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/generate-configlist.sh b/generate-configlist.sh
> index b06da53c89..e1f9e99488 100755
> --- a/generate-configlist.sh
> +++ b/generate-configlist.sh
> @@ -19,7 +19,8 @@ EOF
>  	s/::$//;
>  	s/`//g;
>  	s/^.*$/	"&",/;
> -	s/,  */",\n	"/g;
> +	s/,  */",\
> +	"/g;
>  	p;};
>  d' \
>  	    "$SOURCE_DIR"/Documentation/*config.adoc \

FYI I pushed your patch to https://github.com/gitgitgadget/git/pull/1930/

It seems to be passing, although it's not very readable.
Your commit message has some issues:
 * upper case in "Make": prefixed commits message must be lower case
 * to be correct, the bug was already there at the first introduction of the 
generate-configlist.sh script (3ac68a9). The '\n' was there, and the generated 
.h file had two wrong strings such as
"gitcvs.dbUserngitcvs.dbPass" . My patch only put it in light by breaking the 
build.

Maybe an alternative way of fixing the issue is to just rework the documentation on the two spots where a comma is used and put each config variable on its own line.

What do you think?
JN
Previous: Collin FunkNext: Collin Funk
Message 6 of 20 in “completion: Make sed command that generates config-list.h portable.”
  1. completion: Make sed command that generates config-list.h portable.Collin Funk, Jun 2, 2025
  2. Brad SmithJun 2, 2025
  3. Jean-Noël AVILAJun 2, 2025
  4. Collin FunkJun 2, 2025
  5. completion: Make sed command that generates config-list.h portable.Collin Funk, Jun 2, 2025
  6. Jean-Noël AVILAJun 2, 2025
  7. Collin FunkJun 2, 2025
  8. Jacob KellerJun 2, 2025
  9. Collin FunkJun 2, 2025
  10. Junio C HamanoJun 3, 2025
  11. CodingGuidelines: document formatting required by generate-configlist.sh.Collin Funk, Jun 3, 2025
  12. Junio C HamanoJun 3, 2025
  13. Collin FunkJun 3, 2025
  14. Junio C HamanoJun 3, 2025
  15. Collin FunkJun 3, 2025
  16. CodingGuidelines: document formatting of similar config variables.Collin Funk, Jun 3, 2025
  17. Junio C HamanoJun 3, 2025
  18. completion: make sed command that generates config-list.h portable.Collin Funk, Jun 2, 2025
  19. Keller, Jacob EJun 2, 2025
  20. Junio C HamanoJun 3, 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.