{"thread":{"id":"64940","subject":"[PATCH] meson: regenerate config-list.h when Documentation changes","startedAt":"2026-02-07T21:59:53Z","lastAt":"2026-02-26T03:20:40Z","messageCount":46,"participants":["D. Ben Knoble","Ben Knoble","Patrick Steinhardt","Phillip Wood","Junio C Hamano","Marc Branchaud","SZEDER Gábor"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"535451","messageId":"20260207215924.28863-2-ben.knoble+github@gmail.com","threadId":"64940","inReplyTo":null,"subject":"[PATCH] meson: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-07T21:59:17Z","receivedAt":"2026-02-07T21:59:53Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"The Meson-based build doesn't know when to rebuild config-list.h, so the\nheader is sometimes stale.\n\nFor example, an old build directory might have config-list.h from before\n4173df5187 (submodule: introduce extensions.submodulePathConfig,\n2026-01-12), which added submodule.<name>.gitdir to the list. Without\nit, t9902-completion.sh fails. Regenerating the config-list.h artifact\nfrom sources fixes the artifact and the test.\n\nTeach the meson build to depend on the Documentation files that\ngenerate-configlist.sh reads by having it use the output of\ngenerate-configlist-deps.sh as a list of dependency files, since Meson\ndoes not have (or want) builtin support for globbing like Make.\n\nSigned-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n---\n\nNotes (benknoble/commits):\n    I considered having generate-configlist.sh write its own dependency\n    list, which Meson also supports… idk though. Input welcome :)\n\n generate-configlist-deps.sh | 5 +++++\n meson.build                 | 1 +\n 2 files changed, 6 insertions(+)\n create mode 100755 generate-configlist-deps.sh\n\ndiff --git a/generate-configlist-deps.sh b/generate-configlist-deps.sh\nnew file mode 100755\nindex 0000000000..a873e976b6\n--- /dev/null\n+++ b/generate-configlist-deps.sh\n@@ -0,0 +1,5 @@\n+#! /bin/sh\n+\n+printf '%s\\n' \\\n+  \"$MESON_SOURCE_ROOT\"/Documentation/*config.adoc \\\n+  \"$MESON_SOURCE_ROOT\"/Documentation/config/*.adoc\ndiff --git a/meson.build b/meson.build\nindex 3a1d12caa4..4df7caa206 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -720,6 +720,7 @@ endif\n \n builtin_sources += custom_target(\n   output: 'config-list.h',\n+  depend_files: run_command(meson.current_source_dir() + '/generate-configlist-deps').stdout().strip().split('\\n'),\n   command: [\n     shell,\n     meson.current_source_dir() + '/generate-configlist.sh',\n-- \n2.52.0.rc0.971.g305ecc6b61.dirty\n\n"},{"id":"535452","messageId":"E6D69F2A-31AB-4370-85F9-CEE718E14327@gmail.com","threadId":"64940","inReplyTo":"20260207215924.28863-2-ben.knoble+github@gmail.com","subject":"Re: [PATCH] meson: regenerate config-list.h when Documentation changes","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2026-02-07T22:38:38Z","receivedAt":"2026-02-07T22:38:50Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"\n> Le 7 févr. 2026 à 16:59, D. Ben Knoble <ben.knoble+github@gmail.com> a écrit :\n> \n> diff --git a/generate-configlist-deps.sh b/generate-configlist-deps.sh\n> new file mode 100755\n> index 0000000000..a873e976b6\n> --- /dev/null\n> +++ b/generate-configlist-deps.sh\n> @@ -0,0 +1,5 @@\n> +#! /bin/sh\n> +\n> +printf '%s\\n' \\\n> +  \"$MESON_SOURCE_ROOT\"/Documentation/*config.adoc \\\n> +  \"$MESON_SOURCE_ROOT\"/Documentation/config/*.adoc\n> diff --git a/meson.build b/meson.build\n> index 3a1d12caa4..4df7caa206 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -720,6 +720,7 @@ endif\n> \n> builtin_sources += custom_target(\n>   output: 'config-list.h',\n> +  depend_files: run_command(meson.current_source_dir() + '/generate-configlist-deps').stdout().strip().split('\\n'),\n>   \nAh, woops. I renamed the file locally before committing but forgot to update the meson spec. This line should have the obvious change to use the correct filename. Will send a v2 when I get more feedback. "},{"id":"535546","messageId":"c9ae171eed6bd5b0fa6671b10a5ad0da024f36d0.1770649805.git.ben.knoble+github@gmail.com","threadId":"64940","inReplyTo":"20260207215924.28863-2-ben.knoble+github@gmail.com","subject":"[PATCH v2] meson: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-09T15:19:59Z","receivedAt":"2026-02-09T15:20:30Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"The Meson-based build doesn't know when to rebuild config-list.h, so the\nheader is sometimes stale.\n\nFor example, an old build directory might have config-list.h from before\n4173df5187 (submodule: introduce extensions.submodulePathConfig,\n2026-01-12), which added submodule.<name>.gitdir to the list. Without\nit, t9902-completion.sh fails. Regenerating the config-list.h artifact\nfrom sources fixes the artifact and the test.\n\nTeach the meson build to depend on the Documentation files that\ngenerate-configlist.sh reads by having it use the output of\ngenerate-configlist-deps.sh as a list of dependency files, since Meson\ndoes not have (or want) builtin support for globbing like Make.\n\nSigned-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n---\n\nNotes (benknoble/commits):\n    I considered having generate-configlist.sh write its own dependency\n    list, which Meson also supports… idk though. Input welcome :)\n\n    This was also built on top of commits [1] on next, but should not depend on\n    them despite what base-commit and prerequisite-patch-id say. Indeed, it\n    applies cleanly to master @ 3e0db84c88 (Start 2.54 cycle, 2026-02-05).\n\n    [1]: https://lore.kernel.org/git/20260207215924.28863-1-ben.knoble+github@gmail.com/\n\n generate-configlist-deps.sh | 5 +++++\n meson.build                 | 1 +\n 2 files changed, 6 insertions(+)\n create mode 100755 generate-configlist-deps.sh\n\ndiff --git a/generate-configlist-deps.sh b/generate-configlist-deps.sh\nnew file mode 100755\nindex 0000000000..a873e976b6\n--- /dev/null\n+++ b/generate-configlist-deps.sh\n@@ -0,0 +1,5 @@\n+#! /bin/sh\n+\n+printf '%s\\n' \\\n+  \"$MESON_SOURCE_ROOT\"/Documentation/*config.adoc \\\n+  \"$MESON_SOURCE_ROOT\"/Documentation/config/*.adoc\ndiff --git a/meson.build b/meson.build\nindex 3a1d12caa4..eb6a149c9f 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -720,6 +720,7 @@ endif\n \n builtin_sources += custom_target(\n   output: 'config-list.h',\n+  depend_files: run_command(meson.current_source_dir() + '/generate-configlist-deps.sh', check: true).stdout().strip().split('\\n'),\n   command: [\n     shell,\n     meson.current_source_dir() + '/generate-configlist.sh',\n\nDiff-intervalle contre v1 :\n1:  b03d70c9f3 ! 1:  c9ae171eed meson: regenerate config-list.h when Documentation changes\n    @@ meson.build: endif\n      \n      builtin_sources += custom_target(\n        output: 'config-list.h',\n    -+  depend_files: run_command(meson.current_source_dir() + '/generate-configlist-deps').stdout().strip().split('\\n'),\n    ++  depend_files: run_command(meson.current_source_dir() + '/generate-configlist-deps.sh', check: true).stdout().strip().split('\\n'),\n        command: [\n          shell,\n          meson.current_source_dir() + '/generate-configlist.sh',\n\nbase-commit: 64333814d3ac6e46b6b9c308a6398a66743a4022\nprerequisite-patch-id: 364ba1899740b93be5957262d3583348d030e8fa\n-- \n2.52.0.rc0.1018.g3ad6585c12.dirty\n\n"},{"id":"535548","messageId":"aYn8XKv2hH2HX2xO@pks.im","threadId":"64940","inReplyTo":"20260207215924.28863-2-ben.knoble+github@gmail.com","subject":"Re: [PATCH] meson: regenerate config-list.h when Documentation changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-09T15:25:16Z","receivedAt":"2026-02-09T15:25:22Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Sat, Feb 07, 2026 at 04:59:17PM -0500, D. Ben Knoble wrote:\n> The Meson-based build doesn't know when to rebuild config-list.h, so the\n> header is sometimes stale.\n> \n> For example, an old build directory might have config-list.h from before\n> 4173df5187 (submodule: introduce extensions.submodulePathConfig,\n> 2026-01-12), which added submodule.<name>.gitdir to the list. Without\n> it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n> from sources fixes the artifact and the test.\n> \n> Teach the meson build to depend on the Documentation files that\n> generate-configlist.sh reads by having it use the output of\n> generate-configlist-deps.sh as a list of dependency files, since Meson\n> does not have (or want) builtin support for globbing like Make.\n> \n> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n> ---\n> \n> Notes (benknoble/commits):\n>     I considered having generate-configlist.sh write its own dependency\n>     list, which Meson also supports… idk though. Input welcome :)\n\nI think that would actually be the better approach, also because the\nlist of files with `run_command()` would only be computed at setup time.\nI guess it could look something like the below patch -- please feel free\nto reuse it at will.\n\nThanks!\n\nPatrick\n\ndiff --git a/generate-configlist.sh b/generate-configlist.sh\nindex 75c39ade20..2c93ffc58a 100755\n--- a/generate-configlist.sh\n+++ b/generate-configlist.sh\n@@ -2,10 +2,11 @@\n \n SOURCE_DIR=\"$1\"\n OUTPUT=\"$2\"\n+DEPFILE=\"$3\"\n \n if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n then\n-\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n+\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT> [<DEPFILE>]\"\n \texit 1\n fi\n \n@@ -36,3 +37,9 @@ EOF\n \techo\n \tprint_config_list\n } >\"$OUTPUT\"\n+\n+if test -n \"$DEPFILE\"\n+then\n+\tprintf \"$OUTPUT: %s\\n\" \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n+\t    \"$SOURCE_DIR\"/Documentation/config/*.adoc >\"$DEPFILE\"\n+fi\ndiff --git a/meson.build b/meson.build\nindex dd52efd1c8..03ad7a2152 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -718,11 +718,13 @@ endif\n \n builtin_sources += custom_target(\n   output: 'config-list.h',\n+  depfile: 'config-list.h.d',\n   command: [\n     shell,\n-    meson.current_source_dir() + '/generate-configlist.sh',\n+    meson.current_source_dir() / 'generate-configlist.sh',\n     meson.current_source_dir(),\n     '@OUTPUT@',\n+    meson.current_build_dir() / 'config-list.h.d',\n   ],\n   env: script_environment,\n )\n"},{"id":"535605","messageId":"20260209215015.25867-1-ben.knoble+github@gmail.com","threadId":"64940","inReplyTo":"aYn8XKv2hH2HX2xO@pks.im","subject":"Re: [PATCH] meson: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-09T21:50:06Z","receivedAt":"2026-02-09T21:51:15Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"Hi Patrick,\n\n> On Sat, Feb 07, 2026 at 04:59:17PM -0500, D. Ben Knoble wrote:\n> > The Meson-based build doesn't know when to rebuild config-list.h, so the\n> > header is sometimes stale.\n> >\n> > For example, an old build directory might have config-list.h from before\n> > 4173df5187 (submodule: introduce extensions.submodulePathConfig,\n> > 2026-01-12), which added submodule.<name>.gitdir to the list. Without\n> > it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n> > from sources fixes the artifact and the test.\n> >\n> > Teach the meson build to depend on the Documentation files that\n> > generate-configlist.sh reads by having it use the output of\n> > generate-configlist-deps.sh as a list of dependency files, since Meson\n> > does not have (or want) builtin support for globbing like Make.\n> >\n> > Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n> > ---\n> >\n> > Notes (benknoble/commits):\n> >     I considered having generate-configlist.sh write its own dependency\n> >     list, which Meson also supports… idk though. Input welcome :)\n>\n> I think that would actually be the better approach, also because the\n> list of files with `run_command()` would only be computed at setup time.\n\nOh, interesting. I didn't consider that, but it seems that adding a new file\ndoesn't cause the dependency list to get updated in my version. Good catch\n\n> I guess it could look something like the below patch -- please feel free\n> to reuse it at will.\n>\n> Thanks!\n>\n> Patrick\n\n[snip patch]\n\nI've applied this locally as so (tinkering since I saw the same symptoms below\nwith your version):\n\n---- 8< ----\ndiff --git c/generate-configlist.sh w/generate-configlist.sh\nindex 75c39ade20..2c93ffc58a 100755\n--- c/generate-configlist.sh\n+++ w/generate-configlist.sh\n@@ -2,10 +2,11 @@\n \n SOURCE_DIR=\"$1\"\n OUTPUT=\"$2\"\n+DEPFILE=\"$3\"\n \n if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n then\n-\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n+\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT> [<DEPFILE>]\"\n \texit 1\n fi\n \n@@ -36,3 +37,9 @@ print_config_list () {\n \techo\n \tprint_config_list\n } >\"$OUTPUT\"\n+\n+if test -n \"$DEPFILE\"\n+then\n+\tprintf \"$OUTPUT: %s\\n\" \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n+\t    \"$SOURCE_DIR\"/Documentation/config/*.adoc >\"$DEPFILE\"\n+fi\ndiff --git c/meson.build w/meson.build\nindex 3a1d12caa4..fb5d7367f5 100644\n--- c/meson.build\n+++ w/meson.build\n@@ -720,11 +720,13 @@ endif\n \n builtin_sources += custom_target(\n   output: 'config-list.h',\n+  depfile: 'config-list.h.d',\n   command: [\n     shell,\n-    meson.current_source_dir() + '/generate-configlist.sh',\n+    meson.current_source_dir() / 'generate-configlist.sh',\n     meson.current_source_dir(),\n     '@OUTPUT@',\n+    '@DEPFILE@',\n   ],\n   env: script_environment,\n )\n---- 8< ----\n\nOnly, things are behaving oddly. For example:\n\n    λ meson setup build2\n    λ ninja -C build2\n\nworks fine, but\n\n    λ ls -l build2/config*\n    -rw-r--r-- 1 benknoble benknoble 17169  9 févr. 16:39 build2/config-list.h\n\nI don't see the dependency file. Further, re-building seems to get stuck (I get\nsimilar symptoms if I add or remove a relevant config.adoc file, but let's keep\nit simple for now):\n\n    λ ninja -C build2\n    ninja: Entering directory `build2'\n    [1/28] Generating GIT-VERSION-FILE with a custom command (wrapped by meson to set env)\n\nOf course, if I invoke the command myself, I can fix the build:\n\n    λ grep generate-config build2/build.ninja\n     COMMAND = /usr/bin/sh /home/benknoble/code/git/generate-configlist.sh /home/benknoble/code/git config-list.h config-list.h.d\n    λ (cd build2 && ../generate-configlist.sh .. config-list.h config-list.h.d)\n    λ ninja -C build2\n    ninja: Entering directory `build2'\n    [7/7] Linking target git-upload-pack\n\nbut I certainly wouldn't have expected to have to do that!\n\nInterestingly, after the \"setup\" step, build2/meson-info/intro-targets.json has\nthis block\n\n  {\n    \"name\": \"config-list.h\",\n    \"id\": \"config-list.h@cus\",\n    \"type\": \"custom\",\n    \"defined_in\": \"/home/benknoble/code/git/meson.build\",\n    \"filename\": [\n      \"/home/benknoble/code/git/build2/config-list.h\"\n    ],\n    \"build_by_default\": false,\n    \"target_sources\": [\n      {\n        \"language\": \"unknown\",\n        \"compiler\": [\n          \"/usr/bin/sh\",\n          \"/home/benknoble/code/git/generate-configlist.sh\",\n          \"/home/benknoble/code/git\",\n          \"@OUTPUT@\",\n          \"@DEPFILE@\"\n        ],\n        \"parameters\": [],\n        \"sources\": [],\n        \"generated_sources\": []\n      }\n    ],\n    \"extra_files\": [],\n    \"subproject\": null,\n    \"dependencies\": [],\n    \"depends\": [],\n    \"installed\": false\n  },\n\nwhich doesn't mention the .d file anywhere. The _only_ reference to it is\nbuild2/build.ninja. This doesn't change (nor are there more references to the\ngenerate-config script) that I can find inside build2/ after any of these steps,\nwhich is odd.\n\nI can't think of any good next debugging steps, so I'm open to ideas on this\noddity.\n"},{"id":"535737","messageId":"aYwzAt-dugh_acj9@pks.im","threadId":"64940","inReplyTo":"20260209215015.25867-1-ben.knoble+github@gmail.com","subject":"Re: [PATCH] meson: regenerate config-list.h when Documentation changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-11T07:42:58Z","receivedAt":"2026-02-11T07:43:09Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Feb 09, 2026 at 04:50:06PM -0500, D. Ben Knoble wrote:\n> > On Sat, Feb 07, 2026 at 04:59:17PM -0500, D. Ben Knoble wrote:\n[snip]\n> Only, things are behaving oddly. For example:\n> \n>     λ meson setup build2\n>     λ ninja -C build2\n> \n> works fine, but\n> \n>     λ ls -l build2/config*\n>     -rw-r--r-- 1 benknoble benknoble 17169  9 févr. 16:39 build2/config-list.h\n> \n> I don't see the dependency file.\n\n> Further, re-building seems to get stuck (I get\n> similar symptoms if I add or remove a relevant config.adoc file, but let's keep\n> it simple for now):\n> \n>     λ ninja -C build2\n>     ninja: Entering directory `build2'\n>     [1/28] Generating GIT-VERSION-FILE with a custom command (wrapped by meson to set env)\n\nWith \"stuck\" you mean that it doesn't do anything, or that it doesn't\nactually rebuild?\n\nI guess it kind of makes sense that a new file wouldn't trigger a\nrebuild, even though I would have expected a removed one to trigger one.\nAfter all, the dependency file only tracks the set of _existing_ files\nso that we know when to rebuild, and of course the dependency file only\ngets regenerated in case any of those files changes.\n\nThe thing is that build systems like Meson really want to know the list\nof files ahead of time so that they can have an optimal build graph. So\nwe could of course list all the files that we actually depend on. But I\nguess that's something we want to avoid?\n\nThere's another, alternative approach: you can have a separate build\nstep that's marked as `build_always_stale: true` that lists all the\nconfig files. This step would then always run, and it would only update\nits target file in case any of the files has changed.\n\nCombined with the depfile we'd then rebuild in all cases:\n\n  - When a file gets added or removed, as that would cause the\n    `build_always_stale` target to be rewritten.\n\n  - When any of the files changes, because that would cause the\n    dependencies in the depfile to change.\n\nSomething like the attached patch (note that I don't perform the\nnecessary changes for the Makefile). I confirmed that it works for all\nof the above cases.\n\nThanks!\n\nPatrick\n\n--- >8 ---\n\ndiff --git a/generate-configlist.sh b/generate-configlist.sh\nindex 75c39ade20..17605e6f77 100755\n--- a/generate-configlist.sh\n+++ b/generate-configlist.sh\n@@ -1,13 +1,6 @@\n #!/bin/sh\n \n-SOURCE_DIR=\"$1\"\n-OUTPUT=\"$2\"\n-\n-if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n-then\n-\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n-\texit 1\n-fi\n+set -e\n \n print_config_list () {\n \tcat <<EOF\n@@ -30,9 +23,50 @@ EOF\n EOF\n }\n \n-{\n-\techo \"/* Automatically generated by generate-configlist.sh */\"\n-\techo\n-\techo\n-\tprint_config_list\n-} >\"$OUTPUT\"\n+case \"$1\" in\n+generate)\n+\tSOURCE_DIR=\"$2\"\n+\tOUTPUT=\"$3\"\n+\tDEPFILE=\"$4\"\n+\n+\tif test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n+\tthen\n+\t\techo >&2 \"USAGE: $0 generate <SOURCE_DIR> <OUTPUT>\"\n+\t\texit 1\n+\tfi\n+\n+\tif test -n \"$DEPFILE\"\n+\tthen\n+\t\tprintf \"$OUTPUT: %s\\n\" \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n+\t\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc >\"$DEPFILE\"\n+\tfi\n+\n+\t{\n+\t\techo \"/* Automatically generated by generate-configlist.sh */\"\n+\t\techo\n+\t\techo\n+\t\tprint_config_list\n+\t} >\"$OUTPUT\"\n+\t;;\n+deps)\n+\tSOURCE_DIR=\"$2\"\n+\tOUTPUT=\"$3\"\n+\n+\tif test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n+\tthen\n+\t\techo >&2 \"USAGE: $0 deps <SOURCE_DIR> <OUTPUT>\"\n+\t\texit 1\n+\tfi\n+\n+\tTMPFILE=$(mktemp \"$OUTPUT\".XXXXXX)\n+\tprintf \"%s\\n\" \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n+\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc | sort >\"$TMPFILE\"\n+\n+\tif ! test -f \"$OUTPUT\" || ! cmp \"$TMPFILE\" \"$OUTPUT\" >/dev/null\n+\tthen\n+\t\tmv \"$TMPFILE\" \"$OUTPUT\"\n+\telse\n+\t\trm \"$TMPFILE\"\n+\tfi\n+\t;;\n+esac\ndiff --git a/meson.build b/meson.build\nindex dd52efd1c8..6b9147a39a 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -716,14 +716,29 @@ if not get_option('breaking_changes')\n   builtin_sources += 'builtin/pack-redundant.c'\n endif\n \n+configlist_deps = custom_target(\n+  output: 'config-list.h.deps',\n+  command: [\n+    meson.current_source_dir() + '/generate-configlist.sh',\n+    'deps',\n+    meson.current_source_dir(),\n+    '@OUTPUT@',\n+  ],\n+  build_always_stale: true,\n+)\n+\n builtin_sources += custom_target(\n   output: 'config-list.h',\n   command: [\n     shell,\n     meson.current_source_dir() + '/generate-configlist.sh',\n+    'generate',\n     meson.current_source_dir(),\n     '@OUTPUT@',\n+    '@OUTPUT@.d',\n   ],\n+  depends: [ configlist_deps, ],\n+  depfile: 'config-list.h.d',\n   env: script_environment,\n )\n \n"},{"id":"535743","messageId":"4a566010-821b-4078-9563-9ca00ada55a0@gmail.com","threadId":"64940","inReplyTo":"aYwzAt-dugh_acj9@pks.im","subject":"Re: [PATCH] meson: regenerate config-list.h when Documentation changes","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-02-11T09:44:48Z","receivedAt":"2026-02-11T09:44:54Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"On 11/02/2026 07:42, Patrick Steinhardt wrote:\n> On Mon, Feb 09, 2026 at 04:50:06PM -0500, D. Ben Knoble wrote:\n>>> On Sat, Feb 07, 2026 at 04:59:17PM -0500, D. Ben Knoble wrote:\n> [snip]\n>> Only, things are behaving oddly. For example:\n>>\n>>      λ meson setup build2\n>>      λ ninja -C build2\n>>\n>> works fine, but\n>>\n>>      λ ls -l build2/config*\n>>      -rw-r--r-- 1 benknoble benknoble 17169  9 févr. 16:39 build2/config-list.h\n>>\n>> I don't see the dependency file.\n> \n>> Further, re-building seems to get stuck (I get\n>> similar symptoms if I add or remove a relevant config.adoc file, but let's keep\n>> it simple for now):\n>>\n>>      λ ninja -C build2\n>>      ninja: Entering directory `build2'\n>>      [1/28] Generating GIT-VERSION-FILE with a custom command (wrapped by meson to set env)\n> \n> With \"stuck\" you mean that it doesn't do anything, or that it doesn't\n> actually rebuild?\n> \n> I guess it kind of makes sense that a new file wouldn't trigger a\n> rebuild, even though I would have expected a removed one to trigger one.\n> After all, the dependency file only tracks the set of _existing_ files\n> so that we know when to rebuild, and of course the dependency file only\n> gets regenerated in case any of those files changes.\n\nIf anyone adds a new file under Documentation/config/ they will need to \nupdate Documentation/config.adoc which should then trigger the rebuild. \nThat rebuld will then add the new file to the list of dependencies. If \nthey remove a file we should pick that up with the dependencies that are \nalready listed.\n\nDo we need to create the depfile when meson is setup? What does meson do \nwhen the depfile is missing?\n\n> The thing is that build systems like Meson really want to know the list\n> of files ahead of time so that they can have an optimal build graph. So\n> we could of course list all the files that we actually depend on. But I\n> guess that's something we want to avoid?\n> \n> There's another, alternative approach: you can have a separate build\n> step that's marked as `build_always_stale: true` that lists all the\n> config files. This step would then always run, and it would only update\n> its target file in case any of the files has changed.\n\nIt would be really nice if we can avoid regenerating the depfile with \nevery build.\n\nThanks\n\nPhillip\n\n> Combined with the depfile we'd then rebuild in all cases:\n> \n>    - When a file gets added or removed, as that would cause the\n>      `build_always_stale` target to be rewritten.\n> \n>    - When any of the files changes, because that would cause the\n>      dependencies in the depfile to change.\n> \n> Something like the attached patch (note that I don't perform the\n> necessary changes for the Makefile). I confirmed that it works for all\n> of the above cases.\n> \n> Thanks!\n> \n> Patrick\n> \n> --- >8 ---\n> \n> diff --git a/generate-configlist.sh b/generate-configlist.sh\n> index 75c39ade20..17605e6f77 100755\n> --- a/generate-configlist.sh\n> +++ b/generate-configlist.sh\n> @@ -1,13 +1,6 @@\n>   #!/bin/sh\n>   \n> -SOURCE_DIR=\"$1\"\n> -OUTPUT=\"$2\"\n> -\n> -if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n> -then\n> -\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n> -\texit 1\n> -fi\n> +set -e\n>   \n>   print_config_list () {\n>   \tcat <<EOF\n> @@ -30,9 +23,50 @@ EOF\n>   EOF\n>   }\n>   \n> -{\n> -\techo \"/* Automatically generated by generate-configlist.sh */\"\n> -\techo\n> -\techo\n> -\tprint_config_list\n> -} >\"$OUTPUT\"\n> +case \"$1\" in\n> +generate)\n> +\tSOURCE_DIR=\"$2\"\n> +\tOUTPUT=\"$3\"\n> +\tDEPFILE=\"$4\"\n> +\n> +\tif test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n> +\tthen\n> +\t\techo >&2 \"USAGE: $0 generate <SOURCE_DIR> <OUTPUT>\"\n> +\t\texit 1\n> +\tfi\n> +\n> +\tif test -n \"$DEPFILE\"\n> +\tthen\n> +\t\tprintf \"$OUTPUT: %s\\n\" \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> +\t\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc >\"$DEPFILE\"\n> +\tfi\n> +\n> +\t{\n> +\t\techo \"/* Automatically generated by generate-configlist.sh */\"\n> +\t\techo\n> +\t\techo\n> +\t\tprint_config_list\n> +\t} >\"$OUTPUT\"\n> +\t;;\n> +deps)\n> +\tSOURCE_DIR=\"$2\"\n> +\tOUTPUT=\"$3\"\n> +\n> +\tif test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n> +\tthen\n> +\t\techo >&2 \"USAGE: $0 deps <SOURCE_DIR> <OUTPUT>\"\n> +\t\texit 1\n> +\tfi\n> +\n> +\tTMPFILE=$(mktemp \"$OUTPUT\".XXXXXX)\n> +\tprintf \"%s\\n\" \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> +\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc | sort >\"$TMPFILE\"\n> +\n> +\tif ! test -f \"$OUTPUT\" || ! cmp \"$TMPFILE\" \"$OUTPUT\" >/dev/null\n> +\tthen\n> +\t\tmv \"$TMPFILE\" \"$OUTPUT\"\n> +\telse\n> +\t\trm \"$TMPFILE\"\n> +\tfi\n> +\t;;\n> +esac\n> diff --git a/meson.build b/meson.build\n> index dd52efd1c8..6b9147a39a 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -716,14 +716,29 @@ if not get_option('breaking_changes')\n>     builtin_sources += 'builtin/pack-redundant.c'\n>   endif\n>   \n> +configlist_deps = custom_target(\n> +  output: 'config-list.h.deps',\n> +  command: [\n> +    meson.current_source_dir() + '/generate-configlist.sh',\n> +    'deps',\n> +    meson.current_source_dir(),\n> +    '@OUTPUT@',\n> +  ],\n> +  build_always_stale: true,\n> +)\n> +\n>   builtin_sources += custom_target(\n>     output: 'config-list.h',\n>     command: [\n>       shell,\n>       meson.current_source_dir() + '/generate-configlist.sh',\n> +    'generate',\n>       meson.current_source_dir(),\n>       '@OUTPUT@',\n> +    '@OUTPUT@.d',\n>     ],\n> +  depends: [ configlist_deps, ],\n> +  depfile: 'config-list.h.d',\n>     env: script_environment,\n>   )\n>   \n> \n\n"},{"id":"535754","messageId":"81ff4cc8-676e-43fe-8193-609887b887d6@gmail.com","threadId":"64940","inReplyTo":"4a566010-821b-4078-9563-9ca00ada55a0@gmail.com","subject":"Re: [PATCH] meson: regenerate config-list.h when Documentation changes","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-02-11T10:57:10Z","receivedAt":"2026-02-11T10:57:14Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"On 11/02/2026 09:44, Phillip Wood wrote:\n> On 11/02/2026 07:42, Patrick Steinhardt wrote:\n>> On Mon, Feb 09, 2026 at 04:50:06PM -0500, D. Ben Knoble wrote:\n>>>> On Sat, Feb 07, 2026 at 04:59:17PM -0500, D. Ben Knoble wrote:\n>> [snip]\n>>> Only, things are behaving oddly. For example:\n>>>\n>>>      λ meson setup build2\n>>>      λ ninja -C build2\n>>>\n>>> works fine, but\n>>>\n>>>      λ ls -l build2/config*\n>>>      -rw-r--r-- 1 benknoble benknoble 17169  9 févr. 16:39 build2/ \n>>> config-list.h\n>>>\n>>> I don't see the dependency file.\n\nI've just had a play with this and I don't see the dependency file \neither - I wonder if ninja deletes it after it has read it.\n\nIf I delete Documentation/config/add.adoc then config-list.h is rebuilt. \nHowever if I edit generate-configlist.sh it is not rebuilt - I guess we \nneed to add the script to the dependency file.\n\nThanks\n\nPhillip\n\n>>> Further, re-building seems to get stuck (I get\n>>> similar symptoms if I add or remove a relevant config.adoc file, but \n>>> let's keep\n>>> it simple for now):\n>>>\n>>>      λ ninja -C build2\n>>>      ninja: Entering directory `build2'\n>>>      [1/28] Generating GIT-VERSION-FILE with a custom command \n>>> (wrapped by meson to set env)\n>>\n>> With \"stuck\" you mean that it doesn't do anything, or that it doesn't\n>> actually rebuild?\n>>\n>> I guess it kind of makes sense that a new file wouldn't trigger a\n>> rebuild, even though I would have expected a removed one to trigger one.\n>> After all, the dependency file only tracks the set of _existing_ files\n>> so that we know when to rebuild, and of course the dependency file only\n>> gets regenerated in case any of those files changes.\n> \n> If anyone adds a new file under Documentation/config/ they will need to \n> update Documentation/config.adoc which should then trigger the rebuild. \n> That rebuld will then add the new file to the list of dependencies. If \n> they remove a file we should pick that up with the dependencies that are \n> already listed.\n> \n> Do we need to create the depfile when meson is setup? What does meson do \n> when the depfile is missing?\n> \n>> The thing is that build systems like Meson really want to know the list\n>> of files ahead of time so that they can have an optimal build graph. So\n>> we could of course list all the files that we actually depend on. But I\n>> guess that's something we want to avoid?\n>>\n>> There's another, alternative approach: you can have a separate build\n>> step that's marked as `build_always_stale: true` that lists all the\n>> config files. This step would then always run, and it would only update\n>> its target file in case any of the files has changed.\n> \n> It would be really nice if we can avoid regenerating the depfile with \n> every build.\n> \n> Thanks\n> \n> Phillip\n> \n>> Combined with the depfile we'd then rebuild in all cases:\n>>\n>>    - When a file gets added or removed, as that would cause the\n>>      `build_always_stale` target to be rewritten.\n>>\n>>    - When any of the files changes, because that would cause the\n>>      dependencies in the depfile to change.\n>>\n>> Something like the attached patch (note that I don't perform the\n>> necessary changes for the Makefile). I confirmed that it works for all\n>> of the above cases.\n>>\n>> Thanks!\n>>\n>> Patrick\n>>\n>> --- >8 ---\n>>\n>> diff --git a/generate-configlist.sh b/generate-configlist.sh\n>> index 75c39ade20..17605e6f77 100755\n>> --- a/generate-configlist.sh\n>> +++ b/generate-configlist.sh\n>> @@ -1,13 +1,6 @@\n>>   #!/bin/sh\n>> -SOURCE_DIR=\"$1\"\n>> -OUTPUT=\"$2\"\n>> -\n>> -if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n>> -then\n>> -    echo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n>> -    exit 1\n>> -fi\n>> +set -e\n>>   print_config_list () {\n>>       cat <<EOF\n>> @@ -30,9 +23,50 @@ EOF\n>>   EOF\n>>   }\n>> -{\n>> -    echo \"/* Automatically generated by generate-configlist.sh */\"\n>> -    echo\n>> -    echo\n>> -    print_config_list\n>> -} >\"$OUTPUT\"\n>> +case \"$1\" in\n>> +generate)\n>> +    SOURCE_DIR=\"$2\"\n>> +    OUTPUT=\"$3\"\n>> +    DEPFILE=\"$4\"\n>> +\n>> +    if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \n>> \"$OUTPUT\"\n>> +    then\n>> +        echo >&2 \"USAGE: $0 generate <SOURCE_DIR> <OUTPUT>\"\n>> +        exit 1\n>> +    fi\n>> +\n>> +    if test -n \"$DEPFILE\"\n>> +    then\n>> +        printf \"$OUTPUT: %s\\n\" \"$SOURCE_DIR\"/Documentation/ \n>> *config.adoc \\\n>> +            \"$SOURCE_DIR\"/Documentation/config/*.adoc >\"$DEPFILE\"\n>> +    fi\n>> +\n>> +    {\n>> +        echo \"/* Automatically generated by generate-configlist.sh */\"\n>> +        echo\n>> +        echo\n>> +        print_config_list\n>> +    } >\"$OUTPUT\"\n>> +    ;;\n>> +deps)\n>> +    SOURCE_DIR=\"$2\"\n>> +    OUTPUT=\"$3\"\n>> +\n>> +    if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \n>> \"$OUTPUT\"\n>> +    then\n>> +        echo >&2 \"USAGE: $0 deps <SOURCE_DIR> <OUTPUT>\"\n>> +        exit 1\n>> +    fi\n>> +\n>> +    TMPFILE=$(mktemp \"$OUTPUT\".XXXXXX)\n>> +    printf \"%s\\n\" \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n>> +        \"$SOURCE_DIR\"/Documentation/config/*.adoc | sort >\"$TMPFILE\"\n>> +\n>> +    if ! test -f \"$OUTPUT\" || ! cmp \"$TMPFILE\" \"$OUTPUT\" >/dev/null\n>> +    then\n>> +        mv \"$TMPFILE\" \"$OUTPUT\"\n>> +    else\n>> +        rm \"$TMPFILE\"\n>> +    fi\n>> +    ;;\n>> +esac\n>> diff --git a/meson.build b/meson.build\n>> index dd52efd1c8..6b9147a39a 100644\n>> --- a/meson.build\n>> +++ b/meson.build\n>> @@ -716,14 +716,29 @@ if not get_option('breaking_changes')\n>>     builtin_sources += 'builtin/pack-redundant.c'\n>>   endif\n>> +configlist_deps = custom_target(\n>> +  output: 'config-list.h.deps',\n>> +  command: [\n>> +    meson.current_source_dir() + '/generate-configlist.sh',\n>> +    'deps',\n>> +    meson.current_source_dir(),\n>> +    '@OUTPUT@',\n>> +  ],\n>> +  build_always_stale: true,\n>> +)\n>> +\n>>   builtin_sources += custom_target(\n>>     output: 'config-list.h',\n>>     command: [\n>>       shell,\n>>       meson.current_source_dir() + '/generate-configlist.sh',\n>> +    'generate',\n>>       meson.current_source_dir(),\n>>       '@OUTPUT@',\n>> +    '@OUTPUT@.d',\n>>     ],\n>> +  depends: [ configlist_deps, ],\n>> +  depfile: 'config-list.h.d',\n>>     env: script_environment,\n>>   )\n>>\n> \n\n"},{"id":"535755","messageId":"aYxguUQ6A1cuphCe@pks.im","threadId":"64940","inReplyTo":"4a566010-821b-4078-9563-9ca00ada55a0@gmail.com","subject":"Re: [PATCH] meson: regenerate config-list.h when Documentation changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-11T10:58:01Z","receivedAt":"2026-02-11T10:58:07Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Feb 11, 2026 at 09:44:48AM +0000, Phillip Wood wrote:\n> On 11/02/2026 07:42, Patrick Steinhardt wrote:\n> > On Mon, Feb 09, 2026 at 04:50:06PM -0500, D. Ben Knoble wrote:\n> > > > On Sat, Feb 07, 2026 at 04:59:17PM -0500, D. Ben Knoble wrote:\n> > [snip]\n> > > Only, things are behaving oddly. For example:\n> > > \n> > >      λ meson setup build2\n> > >      λ ninja -C build2\n> > > \n> > > works fine, but\n> > > \n> > >      λ ls -l build2/config*\n> > >      -rw-r--r-- 1 benknoble benknoble 17169  9 févr. 16:39 build2/config-list.h\n> > > \n> > > I don't see the dependency file.\n> > \n> > > Further, re-building seems to get stuck (I get\n> > > similar symptoms if I add or remove a relevant config.adoc file, but let's keep\n> > > it simple for now):\n> > > \n> > >      λ ninja -C build2\n> > >      ninja: Entering directory `build2'\n> > >      [1/28] Generating GIT-VERSION-FILE with a custom command (wrapped by meson to set env)\n> > \n> > With \"stuck\" you mean that it doesn't do anything, or that it doesn't\n> > actually rebuild?\n> > \n> > I guess it kind of makes sense that a new file wouldn't trigger a\n> > rebuild, even though I would have expected a removed one to trigger one.\n> > After all, the dependency file only tracks the set of _existing_ files\n> > so that we know when to rebuild, and of course the dependency file only\n> > gets regenerated in case any of those files changes.\n> \n> If anyone adds a new file under Documentation/config/ they will need to\n> update Documentation/config.adoc which should then trigger the rebuild. That\n> rebuld will then add the new file to the list of dependencies. If they\n> remove a file we should pick that up with the dependencies that are already\n> listed.\n\nOh? Well, if that's the case then the additional changes should indeed\nnot be required.\n\n> Do we need to create the depfile when meson is setup? What does meson do\n> when the depfile is missing?\n\nThe first diff I sent already takes care of generating the depfile. I\nguess the complaint was that simply removing/adding a file didn't cause\na rebuild, but based on your finding that's not an issue if folks would\nhave to modify \"config.adoc\" anyway.\n\n> > The thing is that build systems like Meson really want to know the list\n> > of files ahead of time so that they can have an optimal build graph. So\n> > we could of course list all the files that we actually depend on. But I\n> > guess that's something we want to avoid?\n> > \n> > There's another, alternative approach: you can have a separate build\n> > step that's marked as `build_always_stale: true` that lists all the\n> > config files. This step would then always run, and it would only update\n> > its target file in case any of the files has changed.\n> \n> It would be really nice if we can avoid regenerating the depfile with every\n> build.\n\nAgreed. So maybe the first patch I sent is sufficient after all?\n\nThanks!\n\nPatrick\n"},{"id":"535756","messageId":"aYxhRNQSpctbUB7x@pks.im","threadId":"64940","inReplyTo":"81ff4cc8-676e-43fe-8193-609887b887d6@gmail.com","subject":"Re: [PATCH] meson: regenerate config-list.h when Documentation changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-11T11:00:20Z","receivedAt":"2026-02-11T11:00:26Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Feb 11, 2026 at 10:57:10AM +0000, Phillip Wood wrote:\n> On 11/02/2026 09:44, Phillip Wood wrote:\n> > On 11/02/2026 07:42, Patrick Steinhardt wrote:\n> > > On Mon, Feb 09, 2026 at 04:50:06PM -0500, D. Ben Knoble wrote:\n> > > > > On Sat, Feb 07, 2026 at 04:59:17PM -0500, D. Ben Knoble wrote:\n> > > [snip]\n> > > > Only, things are behaving oddly. For example:\n> > > > \n> > > >      λ meson setup build2\n> > > >      λ ninja -C build2\n> > > > \n> > > > works fine, but\n> > > > \n> > > >      λ ls -l build2/config*\n> > > >      -rw-r--r-- 1 benknoble benknoble 17169  9 févr. 16:39\n> > > > build2/ config-list.h\n> > > > \n> > > > I don't see the dependency file.\n> \n> I've just had a play with this and I don't see the dependency file either -\n> I wonder if ninja deletes it after it has read it.\n\nYeah, that's expected. Meson will prune the depfile after consuming it.\n\n> If I delete Documentation/config/add.adoc then config-list.h is rebuilt.\n> However if I edit generate-configlist.sh it is not rebuilt - I guess we need\n> to add the script to the dependency file.\n\nTrue. This is typically handled automatically by Meson, but in our case\nit doesn't know that the string we pass to the shell refers to a script,\nand that it should thus cause a rebuild if it changes.\n\nPatrick\n"},{"id":"535771","messageId":"171c0724-7891-41d7-8a70-94fbbf8b43b2@gmail.com","threadId":"64940","inReplyTo":"aYxguUQ6A1cuphCe@pks.im","subject":"Re: [PATCH] meson: regenerate config-list.h when Documentation changes","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-02-11T14:05:10Z","receivedAt":"2026-02-11T14:05:14Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"On 11/02/2026 10:58, Patrick Steinhardt wrote:\n> On Wed, Feb 11, 2026 at 09:44:48AM +0000, Phillip Wood wrote:\n>> On 11/02/2026 07:42, Patrick Steinhardt wrote:\n>>> On Mon, Feb 09, 2026 at 04:50:06PM -0500, D. Ben Knoble wrote:\n>>>>> On Sat, Feb 07, 2026 at 04:59:17PM -0500, D. Ben Knoble wrote:\n>>> [snip]\n>>>> Only, things are behaving oddly. For example:\n>>>>\n>>>>       λ meson setup build2\n>>>>       λ ninja -C build2\n>>>>\n>>>> works fine, but\n>>>>\n>>>>       λ ls -l build2/config*\n>>>>       -rw-r--r-- 1 benknoble benknoble 17169  9 févr. 16:39 build2/config-list.h\n>>>>\n>>>> I don't see the dependency file.\n>>>\n>>>> Further, re-building seems to get stuck (I get\n>>>> similar symptoms if I add or remove a relevant config.adoc file, but let's keep\n>>>> it simple for now):\n>>>>\n>>>>       λ ninja -C build2\n>>>>       ninja: Entering directory `build2'\n>>>>       [1/28] Generating GIT-VERSION-FILE with a custom command (wrapped by meson to set env)\n>>>\n>>> With \"stuck\" you mean that it doesn't do anything, or that it doesn't\n>>> actually rebuild?\n>>>\n>>> I guess it kind of makes sense that a new file wouldn't trigger a\n>>> rebuild, even though I would have expected a removed one to trigger one.\n>>> After all, the dependency file only tracks the set of _existing_ files\n>>> so that we know when to rebuild, and of course the dependency file only\n>>> gets regenerated in case any of those files changes.\n>>\n>> If anyone adds a new file under Documentation/config/ they will need to\n>> update Documentation/config.adoc which should then trigger the rebuild. That\n>> rebuld will then add the new file to the list of dependencies. If they\n>> remove a file we should pick that up with the dependencies that are already\n>> listed.\n> \n> Oh? Well, if that's the case then the additional changes should indeed\n> not be required.\n\nI think so. The only problem I can think of is that if you delete a \nfile, build, restore the file without changing anything else and build \nagain then config-list.h will not be rebuilt because the deleted file \nwould have been removed from the list of dependencies by the previous build.\n\n>>\n>> It would be really nice if we can avoid regenerating the depfile with every\n>> build.\n> \n> Agreed. So maybe the first patch I sent is sufficient after all?\n\nWe need to add the script to the list of dependencies and reading the \ncomments in \nhttps://github.com/ninja-build/ninja/blob/master/src/depfile_parser.in.cc \nwe should be backslash escaping space, hash and backslash in the \nfilename when we write the dependencies. Apart from that I think it is ok.\n\nI guess the alternative is to bite the bullet and list these \ndependencies explicitly as we do for other targets.\n\nThanks\n\nPhillip\n\n"},{"id":"535796","messageId":"CALnO6CB2KXUKdJ2nOOGLAe2fxkj+c5yF-f34dao=p6nTAEQwfQ@mail.gmail.com","threadId":"64940","inReplyTo":"aYwzAt-dugh_acj9@pks.im","subject":"Re: [PATCH] meson: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-11T19:58:27Z","receivedAt":"2026-02-11T19:58:39Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"I'm not totally sure where the discussion ended up (what's actionable\nisn't clear to me), but let me respond to at least this bit:\n\nOn Wed, Feb 11, 2026 at 2:43 AM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> On Mon, Feb 09, 2026 at 04:50:06PM -0500, D. Ben Knoble wrote:\n> > > On Sat, Feb 07, 2026 at 04:59:17PM -0500, D. Ben Knoble wrote:\n> [snip]\n> > Only, things are behaving oddly. For example:\n> >\n> >     λ meson setup build2\n> >     λ ninja -C build2\n> >\n> > works fine, but\n> >\n> >     λ ls -l build2/config*\n> >     -rw-r--r-- 1 benknoble benknoble 17169  9 févr. 16:39 build2/config-list.h\n> >\n> > I don't see the dependency file.\n>\n> > Further, re-building seems to get stuck (I get\n> > similar symptoms if I add or remove a relevant config.adoc file, but let's keep\n> > it simple for now):\n> >\n> >     λ ninja -C build2\n> >     ninja: Entering directory `build2'\n> >     [1/28] Generating GIT-VERSION-FILE with a custom command (wrapped by meson to set env)\n>\n> With \"stuck\" you mean that it doesn't do anything, or that it doesn't\n> actually rebuild?\n\nI mean, that's all the output I get, and the build seems unable to\nmake progress without the depfile present. Maybe I'm misreading the\nabove output, so let me try again with a different kind of change that\nwould cause recompilation:\n\n    meson setup build2 && ninja -C build2\n    touch git.c\n    ninja -C build2\n\nIndeed, this time it definitely works ([6/6] Linking…), so I'm\n_probably_ misinterpreting the output.\n\n> I guess it kind of makes sense that a new file wouldn't trigger a\n> rebuild, even though I would have expected a removed one to trigger one.\n> After all, the dependency file only tracks the set of _existing_ files\n> so that we know when to rebuild, and of course the dependency file only\n> gets regenerated in case any of those files changes.\n\nTrying this bit again, yeah, config-list.h doesn't get rebuilt if I do\n`touch Documentation/fooconfig.adoc` (I think make would rebuild\nthough). And I can't tell if that's due to the weird [1/28] output or\ndue to something else, since I can't \"see\" if Meson recomputed the\ndepfile or not; with the depfile gone, it seems like there's nothing\npresent to tell Meson (ninja) when to rebuild, which is weird to me.\nIt seems this is expected, but it makes it difficult for me to tell\nwhat's going on here.\n\nAfter `touch Documentation/config.adoc`, ninja executes 7 steps,\nincluding rebuilding the config-list.h, at which point it also knows\nto rebuild after touching \"fooconfig.adoc\" again. So maybe that's\nexpected?\n\nFWIW, I ran into this because the staleness in the proposed commit\ncaused some trouble while bisecting a (spurious-due-to-staleness) test\nfailure, too. Hopefully with the fix in place I won't need to compile\ntwice during a bisect, ha\n"},{"id":"535797","messageId":"CALnO6CCoSKKxFZVPbWpTdxkW0xfxwZgJNv1wS2Qz7GGhAKkeAQ@mail.gmail.com","threadId":"64940","inReplyTo":"171c0724-7891-41d7-8a70-94fbbf8b43b2@gmail.com","subject":"Re: [PATCH] meson: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-11T20:15:00Z","receivedAt":"2026-02-11T20:15:12Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Wed, Feb 11, 2026 at 9:05 AM Phillip Wood <phillip.wood123@gmail.com> wrote:\n>\n> On 11/02/2026 10:58, Patrick Steinhardt wrote:\n> > On Wed, Feb 11, 2026 at 09:44:48AM +0000, Phillip Wood wrote:\n> >> On 11/02/2026 07:42, Patrick Steinhardt wrote:\n> >>> On Mon, Feb 09, 2026 at 04:50:06PM -0500, D. Ben Knoble wrote:\n> >>>>> On Sat, Feb 07, 2026 at 04:59:17PM -0500, D. Ben Knoble wrote:\n> >>> [snip]\n> >>>> Only, things are behaving oddly. For example:\n> >>>>\n> >>>>       λ meson setup build2\n> >>>>       λ ninja -C build2\n> >>>>\n> >>>> works fine, but\n> >>>>\n> >>>>       λ ls -l build2/config*\n> >>>>       -rw-r--r-- 1 benknoble benknoble 17169  9 févr. 16:39 build2/config-list.h\n> >>>>\n> >>>> I don't see the dependency file.\n> >>>\n> >>>> Further, re-building seems to get stuck (I get\n> >>>> similar symptoms if I add or remove a relevant config.adoc file, but let's keep\n> >>>> it simple for now):\n> >>>>\n> >>>>       λ ninja -C build2\n> >>>>       ninja: Entering directory `build2'\n> >>>>       [1/28] Generating GIT-VERSION-FILE with a custom command (wrapped by meson to set env)\n> >>>\n> >>> With \"stuck\" you mean that it doesn't do anything, or that it doesn't\n> >>> actually rebuild?\n> >>>\n> >>> I guess it kind of makes sense that a new file wouldn't trigger a\n> >>> rebuild, even though I would have expected a removed one to trigger one.\n> >>> After all, the dependency file only tracks the set of _existing_ files\n> >>> so that we know when to rebuild, and of course the dependency file only\n> >>> gets regenerated in case any of those files changes.\n> >>\n> >> If anyone adds a new file under Documentation/config/ they will need to\n> >> update Documentation/config.adoc which should then trigger the rebuild. That\n> >> rebuld will then add the new file to the list of dependencies. If they\n> >> remove a file we should pick that up with the dependencies that are already\n> >> listed.\n> >\n> > Oh? Well, if that's the case then the additional changes should indeed\n> > not be required.\n>\n> I think so. The only problem I can think of is that if you delete a\n> file, build, restore the file without changing anything else and build\n> again then config-list.h will not be rebuilt because the deleted file\n> would have been removed from the list of dependencies by the previous build.\n>\n> >>\n> >> It would be really nice if we can avoid regenerating the depfile with every\n> >> build.\n> >\n> > Agreed. So maybe the first patch I sent is sufficient after all?\n>\n> We need to add the script to the list of dependencies and reading the\n> comments in\n> https://github.com/ninja-build/ninja/blob/master/src/depfile_parser.in.cc\n> we should be backslash escaping space, hash and backslash in the\n> filename when we write the dependencies. Apart from that I think it is ok.\n\nRe-reading, I now see something actionable:\n- use Patrick's original patch\n- add the script itself to dependencies\n- quote dependencies correctly\n\nThanks\n\n> I guess the alternative is to bite the bullet and list these\n> dependencies explicitly as we do for other targets.\n>\n> Thanks\n>\n> Phillip\n>\n"},{"id":"535815","messageId":"0a344f1f3ee4a5d95c6f46df030b9936db4354a1.1770853297.git.ben.knoble+github@gmail.com","threadId":"64940","inReplyTo":"c9ae171eed6bd5b0fa6671b10a5ad0da024f36d0.1770649805.git.ben.knoble+github@gmail.com","subject":"[PATCH v3] meson: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-11T23:51:02Z","receivedAt":"2026-02-11T23:51:37Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"The Meson-based build doesn't know when to rebuild config-list.h, so the\nheader is sometimes stale.\n\nFor example, an old build directory might have config-list.h from before\n4173df5187 (submodule: introduce extensions.submodulePathConfig,\n2026-01-12), which added submodule.<name>.gitdir to the list. Without\nit, t9902-completion.sh fails. Regenerating the config-list.h artifact\nfrom sources fixes the artifact and the test.\n\nTeach the meson build to depend on the Documentation files that\ngenerate-configlist.sh reads by having it an additional output as a list\nof dependency files, since Meson does not have (or want) builtin support\nfor globbing like Make.\n\nHelped-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n---\n\nNotes (benknoble/commits):\n    Changes from v2 (<c9ae171eed6bd5b0fa6671b10a5ad0da024f36d0.1770649805.git.ben.knoble+github@gmail.com>):\n    \n    • Pick up (and tweak) Patrick's depfile proposal\n    • Include the script itself as a dependency\n    • Escape output paths (spaces, octothorpes, and backslashes) for Ninja\n    \n    I'm not 100% sure I've actually done the escaping correctly, though,\n    since Ninja's source says that a space preceded by 2N backslashes\n    represents 2N backslashes at the end of a filename, and\n    \n        λ printf '%s\\n' 'foo\\' | sed 's/[# \\\\]/\\\\&/g' | xxd\n        00000000: 666f 6f5c 5c0a                           foo\\\\.\n    \n    So would they interpret that as the filename 'foo\\\\' instead of 'foo\\' ?\n    (Or, no because the 2N slashes aren't followed by a SP, but a NL?)\n\n generate-configlist.sh | 10 +++++++++-\n meson.build            |  4 +++-\n 2 files changed, 12 insertions(+), 2 deletions(-)\n\ndiff --git a/generate-configlist.sh b/generate-configlist.sh\nindex 75c39ade20..091efd4564 100755\n--- a/generate-configlist.sh\n+++ b/generate-configlist.sh\n@@ -2,10 +2,11 @@\n \n SOURCE_DIR=\"$1\"\n OUTPUT=\"$2\"\n+DEPFILE=\"$3\"\n \n if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n then\n-\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n+\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT> [<DEPFILE>]\"\n \texit 1\n fi\n \n@@ -36,3 +37,10 @@ print_config_list () {\n \techo\n \tprint_config_list\n } >\"$OUTPUT\"\n+\n+if test -n \"$DEPFILE\"\n+then\n+\tprintf \"$OUTPUT: %s\\n\" \"$0\" \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n+\t    \"$SOURCE_DIR\"/Documentation/config/*.adoc |\n+\t    sed 's/[# \\\\]/\\\\&/g' >\"$DEPFILE\"\n+fi\ndiff --git a/meson.build b/meson.build\nindex 3a1d12caa4..fb5d7367f5 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -720,11 +720,13 @@ endif\n \n builtin_sources += custom_target(\n   output: 'config-list.h',\n+  depfile: 'config-list.h.d',\n   command: [\n     shell,\n-    meson.current_source_dir() + '/generate-configlist.sh',\n+    meson.current_source_dir() / 'generate-configlist.sh',\n     meson.current_source_dir(),\n     '@OUTPUT@',\n+    '@DEPFILE@',\n   ],\n   env: script_environment,\n )\n\nbase-commit: 19a08e0c02faf1c5b4efd1add85598cf8390ff7e\nprerequisite-patch-id: 364ba1899740b93be5957262d3583348d030e8fa\n-- \n2.52.0.rc0.1058.g68d811a4ee.dirty\n\n"},{"id":"535835","messageId":"aY2J6lcBC4Gcy-SK@pks.im","threadId":"64940","inReplyTo":"0a344f1f3ee4a5d95c6f46df030b9936db4354a1.1770853297.git.ben.knoble+github@gmail.com","subject":"Re: [PATCH v3] meson: regenerate config-list.h when Documentation changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-12T08:06:02Z","receivedAt":"2026-02-12T08:06:13Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Feb 11, 2026 at 06:51:02PM -0500, D. Ben Knoble wrote:\n> Notes (benknoble/commits):\n>     Changes from v2 (<c9ae171eed6bd5b0fa6671b10a5ad0da024f36d0.1770649805.git.ben.knoble+github@gmail.com>):\n>     \n>     • Pick up (and tweak) Patrick's depfile proposal\n>     • Include the script itself as a dependency\n>     • Escape output paths (spaces, octothorpes, and backslashes) for Ninja\n>     \n>     I'm not 100% sure I've actually done the escaping correctly, though,\n>     since Ninja's source says that a space preceded by 2N backslashes\n>     represents 2N backslashes at the end of a filename, and\n\nI guess you refer to [1], more specifically this quote:\n\n  Rather than implement all of above, we follow what GCC/Clang produces:\n\n      Backslashes escape a space or hash sign.\n\n      When a space is preceded by 2N+1 backslashes, it is represents N\n      backslashes followed by space.\n\n      When a space is preceded by 2N backslashes, it represents 2N\n      backslashes at the end of a filename.\n\n      A hash sign is escaped by a single backslash. All other\n      backslashes remain unchanged.\n\n>         λ printf '%s\\n' 'foo\\' | sed 's/[# \\\\]/\\\\&/g' | xxd\n>         00000000: 666f 6f5c 5c0a                           foo\\\\.\n>     \n>     So would they interpret that as the filename 'foo\\\\' instead of 'foo\\' ?\n>     (Or, no because the 2N slashes aren't followed by a SP, but a NL?)\n\nI think it would be interpreted as \"foo\\\\\". I would say that we really\ndon't need to go too much into detail here. I very much hope that no\nsane person would have literal \"\\ \" in their paths. One might wonder\nabout Windows, where backslashes are common. But filenames cannot start\nwith a space there, so this is fine.\n\nSo I'd say we should only care about quoting ' ' and '#', nothing else.\nWe can still iterate going forward if we see that we're too naive.\n\n>  generate-configlist.sh | 10 +++++++++-\n>  meson.build            |  4 +++-\n>  2 files changed, 12 insertions(+), 2 deletions(-)\n> \n> diff --git a/generate-configlist.sh b/generate-configlist.sh\n> index 75c39ade20..091efd4564 100755\n> --- a/generate-configlist.sh\n> +++ b/generate-configlist.sh\n> @@ -36,3 +37,10 @@ print_config_list () {\n>  \techo\n>  \tprint_config_list\n>  } >\"$OUTPUT\"\n> +\n> +if test -n \"$DEPFILE\"\n> +then\n> +\tprintf \"$OUTPUT: %s\\n\" \"$0\" \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n\nI think it's a tiny bit hacky that we output the script itself as a\ndependency here, and that it would be cleaner to do this via\n`depend_files` in the target itself.\n\n> +\t    \"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> +\t    sed 's/[# \\\\]/\\\\&/g' >\"$DEPFILE\"\n> +fi\n\nFrom the above rules I would think that we should simply ignore\nbackslashes here. As the last rule says, \"All other backslashes remain\nunchanged.\".\n\n> diff --git a/meson.build b/meson.build\n> index 3a1d12caa4..fb5d7367f5 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -720,11 +720,13 @@ endif\n>  \n>  builtin_sources += custom_target(\n>    output: 'config-list.h',\n> +  depfile: 'config-list.h.d',\n>    command: [\n>      shell,\n> -    meson.current_source_dir() + '/generate-configlist.sh',\n> +    meson.current_source_dir() / 'generate-configlist.sh',\n>      meson.current_source_dir(),\n>      '@OUTPUT@',\n> +    '@DEPFILE@',\n\nI didn't know about `@DEPFILE@`, nice.\n\nThanks!\n\nPatrick\n\n[1]: https://github.com/ninja-build/ninja/blob/cc60300ab94dae9bb28fece3c9b7c397235b17de/src/depfile_parser.in.cc#L27\n"},{"id":"535836","messageId":"aY2K-_ZHyDBBh3_B@pks.im","threadId":"64940","inReplyTo":"CALnO6CB2KXUKdJ2nOOGLAe2fxkj+c5yF-f34dao=p6nTAEQwfQ@mail.gmail.com","subject":"Re: [PATCH] meson: regenerate config-list.h when Documentation changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-12T08:10:35Z","receivedAt":"2026-02-12T08:10:41Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Feb 11, 2026 at 02:58:27PM -0500, D. Ben Knoble wrote:\n> I'm not totally sure where the discussion ended up (what's actionable\n> isn't clear to me), but let me respond to at least this bit:\n> \n> On Wed, Feb 11, 2026 at 2:43 AM Patrick Steinhardt <ps@pks.im> wrote:\n> >\n> > On Mon, Feb 09, 2026 at 04:50:06PM -0500, D. Ben Knoble wrote:\n> > > > On Sat, Feb 07, 2026 at 04:59:17PM -0500, D. Ben Knoble wrote:\n> > [snip]\n> > > Only, things are behaving oddly. For example:\n> > >\n> > >     λ meson setup build2\n> > >     λ ninja -C build2\n> > >\n> > > works fine, but\n> > >\n> > >     λ ls -l build2/config*\n> > >     -rw-r--r-- 1 benknoble benknoble 17169  9 févr. 16:39 build2/config-list.h\n> > >\n> > > I don't see the dependency file.\n> >\n> > > Further, re-building seems to get stuck (I get\n> > > similar symptoms if I add or remove a relevant config.adoc file, but let's keep\n> > > it simple for now):\n> > >\n> > >     λ ninja -C build2\n> > >     ninja: Entering directory `build2'\n> > >     [1/28] Generating GIT-VERSION-FILE with a custom command (wrapped by meson to set env)\n> >\n> > With \"stuck\" you mean that it doesn't do anything, or that it doesn't\n> > actually rebuild?\n> \n> I mean, that's all the output I get, and the build seems unable to\n> make progress without the depfile present. Maybe I'm misreading the\n> above output, so let me try again with a different kind of change that\n> would cause recompilation:\n\nI think you're simply getting confused by Ninja's output.\n\nNinja knows to short-circuit compilation in case regenerating a target\nthat is used as input for another target will not cause the file to\nchange. So what the \"[1/28]\" says is that we're regenerating the\n\"GIT-VERSION-FILE\", and if it would change we would have to recompile a\nbunch of other targets. But we see that it didn't change, and as a\nconsequence we can skip compiling remaining targets.\n\n> > I guess it kind of makes sense that a new file wouldn't trigger a\n> > rebuild, even though I would have expected a removed one to trigger one.\n> > After all, the dependency file only tracks the set of _existing_ files\n> > so that we know when to rebuild, and of course the dependency file only\n> > gets regenerated in case any of those files changes.\n> \n> Trying this bit again, yeah, config-list.h doesn't get rebuilt if I do\n> `touch Documentation/fooconfig.adoc` (I think make would rebuild\n> though). And I can't tell if that's due to the weird [1/28] output or\n> due to something else, since I can't \"see\" if Meson recomputed the\n> depfile or not; with the depfile gone, it seems like there's nothing\n> present to tell Meson (ninja) when to rebuild, which is weird to me.\n> It seems this is expected, but it makes it difficult for me to tell\n> what's going on here.\n> \n> After `touch Documentation/config.adoc`, ninja executes 7 steps,\n> including rebuilding the config-list.h, at which point it also knows\n> to rebuild after touching \"fooconfig.adoc\" again. So maybe that's\n> expected?\n\nI assume that you simply didn't have a depfile yet initially, and\nbecause the script itself isn't part of the deps Meson didn't know to\nreexecute it as it changed to gain support for the depfile.\n\nNot sure though, but from all I can see things work as expected now with\nthe current patch that you've sent.\n\nPatrick\n"},{"id":"535853","messageId":"19d86fb2-cbbe-4753-831c-a6ed49722103@gmail.com","threadId":"64940","inReplyTo":"0a344f1f3ee4a5d95c6f46df030b9936db4354a1.1770853297.git.ben.knoble+github@gmail.com","subject":"Re: [PATCH v3] meson: regenerate config-list.h when Documentation changes","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-02-12T10:29:39Z","receivedAt":"2026-02-12T10:29:45Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Ben\n\nOn 11/02/2026 23:51, D. Ben Knoble wrote:\n> The Meson-based build doesn't know when to rebuild config-list.h, so the\n> header is sometimes stale.\n> \n> For example, an old build directory might have config-list.h from before\n> 4173df5187 (submodule: introduce extensions.submodulePathConfig,\n> 2026-01-12), which added submodule.<name>.gitdir to the list. Without\n> it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n> from sources fixes the artifact and the test.\n> \n> Teach the meson build to depend on the Documentation files that\n> generate-configlist.sh reads by having it an additional output as a list\n> of dependency files, since Meson does not have (or want) builtin support\n> for globbing like Make.\n\nIt would be useful to mention that we assume that if a user adds a new \nfile under Documentation/config then they will also edit one of the \nexisting files to include that new file and that will trigger a rebuild.\n\n> Helped-by: Patrick Steinhardt <ps@pks.im>\n> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n> ---\n> \n> Notes (benknoble/commits):\n>      Changes from v2 (<c9ae171eed6bd5b0fa6671b10a5ad0da024f36d0.1770649805.git.ben.knoble+github@gmail.com>):\n>      \n>      • Pick up (and tweak) Patrick's depfile proposal\n>      • Include the script itself as a dependency\n>      • Escape output paths (spaces, octothorpes, and backslashes) for Ninja\n>      \n>      I'm not 100% sure I've actually done the escaping correctly, though,\n>      since Ninja's source says that a space preceded by 2N backslashes\n>      represents 2N backslashes at the end of a filename, and\n>      \n>          λ printf '%s\\n' 'foo\\' | sed 's/[# \\\\]/\\\\&/g' | xxd\n>          00000000: 666f 6f5c 5c0a                           foo\\\\.\n>      \n>      So would they interpret that as the filename 'foo\\\\' instead of 'foo\\' ?\n>      (Or, no because the 2N slashes aren't followed by a SP, but a NL?)\n\nHaving re-read the ninja source I agree with Patrick that we should not \nbe escaping backslashes\n\n> +if test -n \"$DEPFILE\"\n> +then\n> +\tprintf \"$OUTPUT: %s\\n\" \"$0\" \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> +\t    \"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> +\t    sed 's/[# \\\\]/\\\\&/g' >\"$DEPFILE\"\n\nThis will escape the space after \"$OUTPUT:\" which is not what we want.\n\n\tprintf '%s\\n' ... | sed \"s/[# ]/\\\\&/g; s|^|$OUTPUT|\" >\"$DEPFILE\"\n\nshould work so long as $OUTPUT does not contain any '|' characters.\n\nThanks\n\nPhillip\n\n> +fi\n> diff --git a/meson.build b/meson.build\n> index 3a1d12caa4..fb5d7367f5 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -720,11 +720,13 @@ endif\n>   \n>   builtin_sources += custom_target(\n>     output: 'config-list.h',\n> +  depfile: 'config-list.h.d',\n>     command: [\n>       shell,\n> -    meson.current_source_dir() + '/generate-configlist.sh',\n> +    meson.current_source_dir() / 'generate-configlist.sh',\n>       meson.current_source_dir(),\n>       '@OUTPUT@',\n> +    '@DEPFILE@',\n>     ],\n>     env: script_environment,\n>   )\n> \n> base-commit: 19a08e0c02faf1c5b4efd1add85598cf8390ff7e\n> prerequisite-patch-id: 364ba1899740b93be5957262d3583348d030e8fa\n\n"},{"id":"535865","messageId":"0ff07837-643b-41ac-b1d6-f49f6668c202@gmail.com","threadId":"64940","inReplyTo":"19d86fb2-cbbe-4753-831c-a6ed49722103@gmail.com","subject":"Re: [PATCH v3] meson: regenerate config-list.h when Documentation changes","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-02-12T14:14:20Z","receivedAt":"2026-02-12T14:14:28Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"On 12/02/2026 10:29, Phillip Wood wrote:\n> \n>      printf '%s\\n' ... | sed \"s/[# ]/\\\\&/g; s|^|$OUTPUT|\" >\"$DEPFILE\"\n\nSorry that's missing \": \" after $OUTPUT\n\nThanks\n\nPhillip\n\n"},{"id":"535872","messageId":"F7A2C039-32D1-4F1E-BFF7-2030FFEB06A6@gmail.com","threadId":"64940","inReplyTo":"0a344f1f3ee4a5d95c6f46df030b9936db4354a1.1770853297.git.ben.knoble+github@gmail.com","subject":"Re: [PATCH v3] meson: regenerate config-list.h when Documentation changes","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2026-02-12T15:56:19Z","receivedAt":"2026-02-12T15:56:31Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"Apologies, this has a rather obvious bug:\n\n> \n> Le 11 févr. 2026 à 18:51, D. Ben Knoble <ben.knoble+github@gmail.com> a écrit :\n> \n> ﻿The Meson-based build doesn't know when to rebuild config-list.h, so the\n> header is sometimes stale.\n> \n> For example, an old build directory might have config-list.h from before\n> 4173df5187 (submodule: introduce extensions.submodulePathConfig,\n> 2026-01-12), which added submodule.<name>.gitdir to the list. Without\n> it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n> from sources fixes the artifact and the test.\n> \n> Teach the meson build to depend on the Documentation files that\n> generate-configlist.sh reads by having it an additional output as a list\n> of dependency files, since Meson does not have (or want) builtin support\n> for globbing like Make.\n> \n> Helped-by: Patrick Steinhardt <ps@pks.im>\n> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n> ---\n> \n> Notes (benknoble/commits):\n>    Changes from v2 (<c9ae171eed6bd5b0fa6671b10a5ad0da024f36d0.1770649805.git.ben.knoble+github@gmail.com>):\n> \n>    • Pick up (and tweak) Patrick's depfile proposal\n>    • Include the script itself as a dependency\n>    • Escape output paths (spaces, octothorpes, and backslashes) for Ninja\n> \n>    I'm not 100% sure I've actually done the escaping correctly, though,\n>    since Ninja's source says that a space preceded by 2N backslashes\n>    represents 2N backslashes at the end of a filename, and\n> \n>        λ printf '%s\\n' 'foo\\' | sed 's/[# \\\\]/\\\\&/g' | xxd\n>        00000000: 666f 6f5c 5c0a                           foo\\\\.\n> \n>    So would they interpret that as the filename 'foo\\\\' instead of 'foo\\' ?\n>    (Or, no because the 2N slashes aren't followed by a SP, but a NL?)\n> \n> generate-configlist.sh | 10 +++++++++-\n> meson.build            |  4 +++-\n> 2 files changed, 12 insertions(+), 2 deletions(-)\n> \n> diff --git a/generate-configlist.sh b/generate-configlist.sh\n> index 75c39ade20..091efd4564 100755\n> --- a/generate-configlist.sh\n> +++ b/generate-configlist.sh\n> @@ -2,10 +2,11 @@\n> \n> SOURCE_DIR=\"$1\"\n> OUTPUT=\"$2\"\n> +DEPFILE=\"$3\"\n> \n> if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n> then\n> -    echo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n> +    echo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT> [<DEPFILE>]\"\n>    exit 1\n> fi\n> \n> @@ -36,3 +37,10 @@ print_config_list () {\n>    echo\n>    print_config_list\n> } >\"$OUTPUT\"\n> +\n> +if test -n \"$DEPFILE\"\n> +then\n> +    printf \"$OUTPUT: %s\\n\" \"$0\" \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> +        \"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> +        sed 's/[# \\\\]/\\\\&/g' >\"$DEPFILE\"\n\nThis also escapes the space after the OUTPUT: prefix. Will try to find a different way. "},{"id":"536136","messageId":"9cdcc9de04f0f8fff657f0474b31c063466ed808.1771280837.git.ben.knoble+github@gmail.com","threadId":"64940","inReplyTo":"0a344f1f3ee4a5d95c6f46df030b9936db4354a1.1770853297.git.ben.knoble+github@gmail.com","subject":"[PATCH v4] meson: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-16T22:28:57Z","receivedAt":"2026-02-16T22:29:12Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"The Meson-based build doesn't know when to rebuild config-list.h, so the\nheader is sometimes stale.\n\nFor example, an old build directory might have config-list.h from before\n4173df5187 (submodule: introduce extensions.submodulePathConfig,\n2026-01-12), which added submodule.<name>.gitdir to the list. Without\nit, t9902-completion.sh fails. Regenerating the config-list.h artifact\nfrom sources fixes the artifact and the test.\n\nTeach the meson build to depend on the Documentation files that\ngenerate-configlist.sh reads by having it an additional output as a list\nof dependency files, since Meson does not have (or want) builtin support\nfor globbing like Make. We assume that if a user adds a new file under\nDocumentation/config then they will also edit one of the existing files\nto include that new file, and that will trigger a rebuild.\n\nAlso mark the generator script as a dependency.\n\nCombining the following commands helps debug dependencies:\n\n    ninja -C <builddir> -t deps config-list.h\n    ninja -C <builddir> -t browse config-list.h\n\nThe former lists all the dependencies discovered from our output \".d\"\nfile (the config documentation) and the latter shows the dependency on\nthe script itself, among other useful edges in the dependency graph.\n\nHelped-by: Patrick Steinhardt <ps@pks.im>\nHelped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nSigned-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n---\n\nNotes (benknoble/commits):\n    Changes from v3 (<0a344f1f3ee4a5d95c6f46df030b9936db4354a1.1770853297.git.ben.knoble+github@gmail.com>):\n    \n    • Include the script itself as a dependency via depfile\n    • Fix output path escaping (spaces, octothorpes; drop backslashes) for\n      Ninja (I've used a loop because I couldn't find a portable construct\n      that could escape only the remainder of the lines in the way I\n      wanted).\n    • Mention our assumptions about Documentation updates triggering\n      rebuilds\n    • Also include some debugging information in the commit message\n\n generate-configlist.sh | 12 +++++++++++-\n meson.build            |  5 ++++-\n 2 files changed, 15 insertions(+), 2 deletions(-)\n\ndiff --git a/generate-configlist.sh b/generate-configlist.sh\nindex 75c39ade209..63a2e8b6938 100755\n--- a/generate-configlist.sh\n+++ b/generate-configlist.sh\n@@ -2,10 +2,11 @@\n \n SOURCE_DIR=\"$1\"\n OUTPUT=\"$2\"\n+DEPFILE=\"$3\"\n \n if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n then\n-\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n+\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT> [<DEPFILE>]\"\n \texit 1\n fi\n \n@@ -36,3 +37,12 @@ print_config_list ()\n \techo\n \tprint_config_list\n } >\"$OUTPUT\"\n+\n+if test -n \"$DEPFILE\"\n+then\n+\tfor doc in \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n+\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc\n+\tdo\n+\t\tprintf \"$OUTPUT: %s\\n\" \"$(printf '%s\\n' \"$doc\" | sed 's/[# ]/\\\\&/g')\"\n+\tdone >\"$DEPFILE\"\n+fi\ndiff --git a/meson.build b/meson.build\nindex 3a1d12caa4b..e4b8f1e33d2 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -720,11 +720,14 @@ endif\n \n builtin_sources += custom_target(\n   output: 'config-list.h',\n+  depfile: 'config-list.h.d',\n+  depend_files: [ 'generate-configlist.sh' ],\n   command: [\n     shell,\n-    meson.current_source_dir() + '/generate-configlist.sh',\n+    meson.current_source_dir() / 'generate-configlist.sh',\n     meson.current_source_dir(),\n     '@OUTPUT@',\n+    '@DEPFILE@',\n   ],\n   env: script_environment,\n )\n\nDiff-intervalle contre v3 :\n1:  0a344f1f3ee ! 1:  9cdcc9de04f meson: regenerate config-list.h when Documentation changes\n    @@ Commit message\n         Teach the meson build to depend on the Documentation files that\n         generate-configlist.sh reads by having it an additional output as a list\n         of dependency files, since Meson does not have (or want) builtin support\n    -    for globbing like Make.\n    +    for globbing like Make. We assume that if a user adds a new file under\n    +    Documentation/config then they will also edit one of the existing files\n    +    to include that new file, and that will trigger a rebuild.\n    +\n    +    Also mark the generator script as a dependency.\n    +\n    +    Combining the following commands helps debug dependencies:\n    +\n    +        ninja -C <builddir> -t deps config-list.h\n    +        ninja -C <builddir> -t browse config-list.h\n    +\n    +    The former lists all the dependencies discovered from our output \".d\"\n    +    file (the config documentation) and the latter shows the dependency on\n    +    the script itself, among other useful edges in the dependency graph.\n     \n         Helped-by: Patrick Steinhardt <ps@pks.im>\n    +    Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n     \n     \n      ## Notes (benknoble/commits) ##\n    -    Changes from v2 (<c9ae171eed6bd5b0fa6671b10a5ad0da024f36d0.1770649805.git.ben.knoble+github@gmail.com>):\n    +    Changes from v3 (<0a344f1f3ee4a5d95c6f46df030b9936db4354a1.1770853297.git.ben.knoble+github@gmail.com>):\n     \n    -    • Pick up (and tweak) Patrick's depfile proposal\n    -    • Include the script itself as a dependency\n    -    • Escape output paths (spaces, octothorpes, and backslashes) for Ninja\n    -\n    -    I'm not 100% sure I've actually done the escaping correctly, though,\n    -    since Ninja's source says that a space preceded by 2N backslashes\n    -    represents 2N backslashes at the end of a filename, and\n    -\n    -        λ printf '%s\\n' 'foo\\' | sed 's/[# \\\\]/\\\\&/g' | xxd\n    -        00000000: 666f 6f5c 5c0a                           foo\\\\.\n    -\n    -    So would they interpret that as the filename 'foo\\\\' instead of 'foo\\' ?\n    -    (Or, no because the 2N slashes aren't followed by a SP, but a NL?)\n    +    • Include the script itself as a dependency via depfile\n    +    • Fix output path escaping (spaces, octothorpes; drop backslashes) for\n    +      Ninja (I've used a loop because I couldn't find a portable construct\n    +      that could escape only the remainder of the lines in the way I\n    +      wanted).\n    +    • Mention our assumptions about Documentation updates triggering\n    +      rebuilds\n    +    • Also include some debugging information in the commit message\n     \n      ## generate-configlist.sh ##\n     @@\n    @@ generate-configlist.sh: print_config_list ()\n     +\n     +if test -n \"$DEPFILE\"\n     +then\n    -+\tprintf \"$OUTPUT: %s\\n\" \"$0\" \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n    -+\t    \"$SOURCE_DIR\"/Documentation/config/*.adoc |\n    -+\t    sed 's/[# \\\\]/\\\\&/g' >\"$DEPFILE\"\n    ++\tfor doc in \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n    ++\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc\n    ++\tdo\n    ++\t\tprintf \"$OUTPUT: %s\\n\" \"$(printf '%s\\n' \"$doc\" | sed 's/[# ]/\\\\&/g')\"\n    ++\tdone >\"$DEPFILE\"\n     +fi\n     \n      ## meson.build ##\n    @@ meson.build: endif\n      builtin_sources += custom_target(\n        output: 'config-list.h',\n     +  depfile: 'config-list.h.d',\n    ++  depend_files: [ 'generate-configlist.sh' ],\n        command: [\n          shell,\n     -    meson.current_source_dir() + '/generate-configlist.sh',\n\nbase-commit: 19a08e0c02faf1c5b4efd1add85598cf8390ff7e\nprerequisite-patch-id: 364ba1899740b93be5957262d3583348d030e8fa\n-- \n2.48.1\n\n"},{"id":"536138","messageId":"286624E8-94CD-4C65-BB91-BF8338B8A79A@gmail.com","threadId":"64940","inReplyTo":"9cdcc9de04f0f8fff657f0474b31c063466ed808.1771280837.git.ben.knoble+github@gmail.com","subject":"Re: [PATCH v4] meson: regenerate config-list.h when Documentation changes","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2026-02-17T00:33:19Z","receivedAt":"2026-02-17T00:33:32Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"\n> Le 16 févr. 2026 à 17:29, D. Ben Knoble <ben.knoble+github@gmail.com> a écrit :\n> \n> ﻿The Meson-based build doesn't know when to rebuild config-list.h, so the\n> header is sometimes stale.\n> \n> For example, an old build directory might have config-list.h from before\n> 4173df5187 (submodule: introduce extensions.submodulePathConfig,\n> 2026-01-12), which added submodule.<name>.gitdir to the list. Without\n> it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n> from sources fixes the artifact and the test.\n> \n> Teach the meson build to depend on the Documentation files that\n> generate-configlist.sh reads by having it an additional output as a list\n> of dependency files, since Meson does not have (or want) builtin support\n> for globbing like Make. We assume that if a user adds a new file under\n> Documentation/config then they will also edit one of the existing files\n> to include that new file, and that will trigger a rebuild.\n> \n> Also mark the generator script as a dependency.\n> \n> Combining the following commands helps debug dependencies:\n> \n>    ninja -C <builddir> -t deps config-list.h\n>    ninja -C <builddir> -t browse config-list.h\n> \n> The former lists all the dependencies discovered from our output \".d\"\n> file (the config documentation) and the latter shows the dependency on\n> the script itself, among other useful edges in the dependency graph.\n> \n> Helped-by: Patrick Steinhardt <ps@pks.im>\n> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n> ---\n> \n> Notes (benknoble/commits):\n>    Changes from v3 (<0a344f1f3ee4a5d95c6f46df030b9936db4354a1.1770853297.git.ben.knoble+github@gmail.com>):\n> \n>    • Include the script itself as a dependency via depfile\n>    • Fix output path escaping (spaces, octothorpes; drop backslashes) for\n>      Ninja (I've used a loop because I couldn't find a portable construct\n>      that could escape only the remainder of the lines in the way I\n>      wanted).\n>    • Mention our assumptions about Documentation updates triggering\n>      rebuilds\n>    • Also include some debugging information in the commit message\n> \n> generate-configlist.sh | 12 +++++++++++-\n> meson.build            |  5 ++++-\n> 2 files changed, 15 insertions(+), 2 deletions(-)\n> \n> diff --git a/generate-configlist.sh b/generate-configlist.sh\n> index 75c39ade209..63a2e8b6938 100755\n> --- a/generate-configlist.sh\n> +++ b/generate-configlist.sh\n> @@ -2,10 +2,11 @@\n> \n> SOURCE_DIR=\"$1\"\n> OUTPUT=\"$2\"\n> +DEPFILE=\"$3\"\n> \n> if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n> then\n> -    echo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n> +    echo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT> [<DEPFILE>]\"\n>    exit 1\n> fi\n> \n> @@ -36,3 +37,12 @@ print_config_list ()\n>    echo\n>    print_config_list\n> } >\"$OUTPUT\"\n> +\n> +if test -n \"$DEPFILE\"\n> +then\n> +    for doc in \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> +        \"$SOURCE_DIR\"/Documentation/config/*.adoc\n> +    do\n> +        printf \"$OUTPUT: %s\\n\" \"$(printf '%s\\n' \"$doc\" | sed 's/[# ]/\\\\&/g')\"\n> +    done >\"$DEPFILE\"\n> +fi\n> diff --git a/meson.build b/meson.build\n> index 3a1d12caa4b..e4b8f1e33d2 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -720,11 +720,14 @@ endif\n> \n> builtin_sources += custom_target(\n>   output: 'config-list.h',\n> +  depfile: 'config-list.h.d',\n> +  depend_files: [ 'generate-configlist.sh' ],\n>   command: [\n>     shell,\n> -    meson.current_source_dir() + '/generate-configlist.sh',\n> +    meson.current_source_dir() / 'generate-configlist.sh',\n>     meson.current_source_dir(),\n>     '@OUTPUT@',\n> +    '@DEPFILE@',\n>   ],\n>   env: script_environment,\n> )\n> \n> Diff-intervalle contre v3 :\n> 1:  0a344f1f3ee ! 1:  9cdcc9de04f meson: regenerate config-list.h when Documentation changes\n>    @@ Commit message\n>         Teach the meson build to depend on the Documentation files that\n>         generate-configlist.sh reads by having it an additional output as a list\n>         of dependency files, since Meson does not have (or want) builtin support\n>    -    for globbing like Make.\n>    +    for globbing like Make. We assume that if a user adds a new file under\n>    +    Documentation/config then they will also edit one of the existing files\n>    +    to include that new file, and that will trigger a rebuild.\n>    +\n>    +    Also mark the generator script as a dependency.\n>    +\n>    +    Combining the following commands helps debug dependencies:\n>    +\n>    +        ninja -C <builddir> -t deps config-list.h\n>    +        ninja -C <builddir> -t browse config-list.h\n>    +\n>    +    The former lists all the dependencies discovered from our output \".d\"\n>    +    file (the config documentation) and the latter shows the dependency on\n>    +    the script itself, among other useful edges in the dependency graph.\n> \n>         Helped-by: Patrick Steinhardt <ps@pks.im>\n>    +    Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n> \n> \n>      ## Notes (benknoble/commits) ##\n>    -    Changes from v2 (<c9ae171eed6bd5b0fa6671b10a5ad0da024f36d0.1770649805.git.ben.knoble+github@gmail.com>):\n>    +    Changes from v3 (<0a344f1f3ee4a5d95c6f46df030b9936db4354a1.1770853297.git.ben.knoble+github@gmail.com>):\n> \n>    -    • Pick up (and tweak) Patrick's depfile proposal\n>    -    • Include the script itself as a dependency\n>    -    • Escape output paths (spaces, octothorpes, and backslashes) for Ninja\n>    -\n>    -    I'm not 100% sure I've actually done the escaping correctly, though,\n>    -    since Ninja's source says that a space preceded by 2N backslashes\n>    -    represents 2N backslashes at the end of a filename, and\n>    -\n>    -        λ printf '%s\\n' 'foo\\' | sed 's/[# \\\\]/\\\\&/g' | xxd\n>    -        00000000: 666f 6f5c 5c0a                           foo\\\\.\n>    -\n>    -    So would they interpret that as the filename 'foo\\\\' instead of 'foo\\' ?\n>    -    (Or, no because the 2N slashes aren't followed by a SP, but a NL?)\n>    +    • Include the script itself as a dependency via depfile\n>    +    • Fix output path escaping (spaces, octothorpes; drop backslashes) for\n>    +      Ninja (I've used a loop because I couldn't find a portable construct\n>    +      that could escape only the remainder of the lines in the way I\n>    +      wanted).\n>    +    • Mention our assumptions about Documentation updates triggering\n>    +      rebuilds\n>    +    • Also include some debugging information in the commit message\n> \n>      ## generate-configlist.sh ##\n>     @@\n>    @@ generate-configlist.sh: print_config_list ()\n>     +\n>     +if test -n \"$DEPFILE\"\n>     +then\n>    -+    printf \"$OUTPUT: %s\\n\" \"$0\" \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n>    -+        \"$SOURCE_DIR\"/Documentation/config/*.adoc |\n>    -+        sed 's/[# \\\\]/\\\\&/g' >\"$DEPFILE\"\n>    ++    for doc in \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n>    ++        \"$SOURCE_DIR\"/Documentation/config/*.adoc\n>    ++    do\n>    ++        printf \"$OUTPUT: %s\\n\" \"$(printf '%s\\n' \"$doc\" | sed 's/[# ]/\\\\&/g')\"\n>    ++    done >\"$DEPFILE\"\n>     +fi\n> \n>      ## meson.build ##\n>    @@ meson.build: endif\n>      builtin_sources += custom_target(\n>        output: 'config-list.h',\n>     +  depfile: 'config-list.h.d',\n>    ++  depend_files: [ 'generate-configlist.sh' ],\n>        command: [\n>          shell,\n>     -    meson.current_source_dir() + '/generate-configlist.sh',\n> \n> base-commit: 19a08e0c02faf1c5b4efd1add85598cf8390ff7e\n> prerequisite-patch-id: 364ba1899740b93be5957262d3583348d030e8fa\n> --\n> 2.48.1\n\nHmm. I’m pretty sure this worked locally but I’m seeing some CI failures on GitHub. Will investigate. "},{"id":"536143","messageId":"aZQSf9yaNa693IFF@pks.im","threadId":"64940","inReplyTo":"9cdcc9de04f0f8fff657f0474b31c063466ed808.1771280837.git.ben.knoble+github@gmail.com","subject":"Re: [PATCH v4] meson: regenerate config-list.h when Documentation changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-17T07:02:23Z","receivedAt":"2026-02-17T07:02:36Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Feb 16, 2026 at 05:28:57PM -0500, D. Ben Knoble wrote:\n> The Meson-based build doesn't know when to rebuild config-list.h, so the\n> header is sometimes stale.\n> \n> For example, an old build directory might have config-list.h from before\n> 4173df5187 (submodule: introduce extensions.submodulePathConfig,\n> 2026-01-12), which added submodule.<name>.gitdir to the list. Without\n> it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n> from sources fixes the artifact and the test.\n> \n> Teach the meson build to depend on the Documentation files that\n> generate-configlist.sh reads by having it an additional output as a list\n> of dependency files, since Meson does not have (or want) builtin support\n> for globbing like Make. We assume that if a user adds a new file under\n> Documentation/config then they will also edit one of the existing files\n> to include that new file, and that will trigger a rebuild.\n> \n> Also mark the generator script as a dependency.\n> \n> Combining the following commands helps debug dependencies:\n> \n>     ninja -C <builddir> -t deps config-list.h\n>     ninja -C <builddir> -t browse config-list.h\n> \n> The former lists all the dependencies discovered from our output \".d\"\n> file (the config documentation) and the latter shows the dependency on\n> the script itself, among other useful edges in the dependency graph.\n\nGood hint, thanks for putting it here.\n\n> diff --git a/generate-configlist.sh b/generate-configlist.sh\n> index 75c39ade209..63a2e8b6938 100755\n> --- a/generate-configlist.sh\n> +++ b/generate-configlist.sh\n> @@ -36,3 +37,12 @@ print_config_list ()\n>  \techo\n>  \tprint_config_list\n>  } >\"$OUTPUT\"\n> +\n> +if test -n \"$DEPFILE\"\n> +then\n> +\tfor doc in \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> +\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc\n> +\tdo\n> +\t\tprintf \"$OUTPUT: %s\\n\" \"$(printf '%s\\n' \"$doc\" | sed 's/[# ]/\\\\&/g')\"\n\nTiny nit: can't we simplify this to \"$(echo \"$doc\" | sed ...)\"?\n\n> diff --git a/meson.build b/meson.build\n> index 3a1d12caa4b..e4b8f1e33d2 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -720,11 +720,14 @@ endif\n>  \n>  builtin_sources += custom_target(\n>    output: 'config-list.h',\n> +  depfile: 'config-list.h.d',\n> +  depend_files: [ 'generate-configlist.sh' ],\n>    command: [\n>      shell,\n> -    meson.current_source_dir() + '/generate-configlist.sh',\n> +    meson.current_source_dir() / 'generate-configlist.sh',\n>      meson.current_source_dir(),\n>      '@OUTPUT@',\n> +    '@DEPFILE@',\n>    ],\n>    env: script_environment,\n>  )\n\nAnd this looks as expected now, too. I also verified locally that this\ncorrectly rebuilds things when either the script or any of the files\nchange.\n\nI wonder whether we also want to have a second patch on top to adjust\nour Makefile? E.g. something like this:\n\ndiff --git a/Makefile b/Makefile\nindex 47ed9fa7fd..ed82775ec2 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2688,8 +2688,10 @@ $(BUILT_INS): git$X\n \n config-list.h: generate-configlist.sh\n \n-config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n-\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n+config-list.h: generate-configlist.sh\n+\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n+\n+-include .depend/config-list.h.d\n \n command-list.h: generate-cmdlist.sh command-list.txt\n \n\nPlease feel free to skip this part though.\n\nThanks!\n\nPatrick\n"},{"id":"536144","messageId":"aZQSqtxf_alZnYXD@pks.im","threadId":"64940","inReplyTo":"286624E8-94CD-4C65-BB91-BF8338B8A79A@gmail.com","subject":"Re: [PATCH v4] meson: regenerate config-list.h when Documentation changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-17T07:03:06Z","receivedAt":"2026-02-17T07:03:12Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Feb 16, 2026 at 07:33:19PM -0500, Ben Knoble wrote:\n> Hmm. I’m pretty sure this worked locally but I’m seeing some CI\n> failures on GitHub. Will investigate.\n\nWhere did you see the failures? The changes look good to me, and things\nwork as expected on my machine, so I'm wondering what the root cause is.\nA test run at [1] in GitLab's CI is also successful (ignore the\nMSVC+Meson failures, a fix for these is being reviewed on the mailing\nlist already).\n\nPatrick\n\n[1]: https://gitlab.com/gitlab-org/git/-/merge_requests/505\n"},{"id":"536161","messageId":"833b54f7-bb6b-4bb7-a5ec-fc0fa679abf8@gmail.com","threadId":"64940","inReplyTo":"9cdcc9de04f0f8fff657f0474b31c063466ed808.1771280837.git.ben.knoble+github@gmail.com","subject":"Re: [PATCH v4] meson: regenerate config-list.h when Documentation changes","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-02-17T09:20:24Z","receivedAt":"2026-02-17T09:20:27Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"\n\nOn 16/02/2026 22:28, D. Ben Knoble wrote:\n> The Meson-based build doesn't know when to rebuild config-list.h, so the\n> header is sometimes stale.\n> \n> For example, an old build directory might have config-list.h from before\n> 4173df5187 (submodule: introduce extensions.submodulePathConfig,\n> 2026-01-12), which added submodule.<name>.gitdir to the list. Without\n> it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n> from sources fixes the artifact and the test.\n> \n> Teach the meson build to depend on the Documentation files that\n> generate-configlist.sh reads by having it an additional output as a list\n> of dependency files, since Meson does not have (or want) builtin support\n> for globbing like Make. We assume that if a user adds a new file under\n> Documentation/config then they will also edit one of the existing files\n> to include that new file, and that will trigger a rebuild.\n> \n> Also mark the generator script as a dependency.\n> \n> Combining the following commands helps debug dependencies:\n> \n>      ninja -C <builddir> -t deps config-list.h\n>      ninja -C <builddir> -t browse config-list.h\n> \n> The former lists all the dependencies discovered from our output \".d\"\n> file (the config documentation) and the latter shows the dependency on\n> the script itself, among other useful edges in the dependency graph.\n> \n> Helped-by: Patrick Steinhardt <ps@pks.im>\n> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n\nThanks for the nicely written commit message.\n\n> +if test -n \"$DEPFILE\"\n> +then\n> +\tfor doc in \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> +\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc\n> +\tdo\n> +\t\tprintf \"$OUTPUT: %s\\n\" \"$(printf '%s\\n' \"$doc\" | sed 's/[# ]/\\\\&/g')\"\\\\\n\nThis forks two processes for every file which is a bit inefficient and \nwill be especially slow on windows. If we quote $OUTPUT first we should \nbe able to use a single sed process for all the files\n\n\tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\"| sed 's|[/\\]|\\\\&|g')\"\n\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n\nThanks\n\nPhillip\n\n"},{"id":"536181","messageId":"CALnO6CAGfd2orSzjvxfAYx=xBnB=QdOwT-f5g0pQrcxO_19BGQ@mail.gmail.com","threadId":"64940","inReplyTo":"aZQSf9yaNa693IFF@pks.im","subject":"Re: [PATCH v4] meson: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-17T13:28:10Z","receivedAt":"2026-02-17T13:28:22Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Tue, Feb 17, 2026 at 2:02 AM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> On Mon, Feb 16, 2026 at 05:28:57PM -0500, D. Ben Knoble wrote:\n> > The Meson-based build doesn't know when to rebuild config-list.h, so the\n> > header is sometimes stale.\n> >\n> > For example, an old build directory might have config-list.h from before\n> > 4173df5187 (submodule: introduce extensions.submodulePathConfig,\n> > 2026-01-12), which added submodule.<name>.gitdir to the list. Without\n> > it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n> > from sources fixes the artifact and the test.\n> >\n> > Teach the meson build to depend on the Documentation files that\n> > generate-configlist.sh reads by having it an additional output as a list\n> > of dependency files, since Meson does not have (or want) builtin support\n> > for globbing like Make. We assume that if a user adds a new file under\n> > Documentation/config then they will also edit one of the existing files\n> > to include that new file, and that will trigger a rebuild.\n> >\n> > Also mark the generator script as a dependency.\n> >\n> > Combining the following commands helps debug dependencies:\n> >\n> >     ninja -C <builddir> -t deps config-list.h\n> >     ninja -C <builddir> -t browse config-list.h\n> >\n> > The former lists all the dependencies discovered from our output \".d\"\n> > file (the config documentation) and the latter shows the dependency on\n> > the script itself, among other useful edges in the dependency graph.\n>\n> Good hint, thanks for putting it here.\n>\n> > diff --git a/generate-configlist.sh b/generate-configlist.sh\n> > index 75c39ade209..63a2e8b6938 100755\n> > --- a/generate-configlist.sh\n> > +++ b/generate-configlist.sh\n> > @@ -36,3 +37,12 @@ print_config_list ()\n> >       echo\n> >       print_config_list\n> >  } >\"$OUTPUT\"\n> > +\n> > +if test -n \"$DEPFILE\"\n> > +then\n> > +     for doc in \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> > +             \"$SOURCE_DIR\"/Documentation/config/*.adoc\n> > +     do\n> > +             printf \"$OUTPUT: %s\\n\" \"$(printf '%s\\n' \"$doc\" | sed 's/[# ]/\\\\&/g')\"\n>\n> Tiny nit: can't we simplify this to \"$(echo \"$doc\" | sed ...)\"?\n\nGiven how unportable echo is [1], I'd prefer to keep printf.\n\n[1]: https://github.com/benknoble/echocho, for one. If the doc started\nwith \"-e\" for example the results might be unreliable.\n\n\n> > diff --git a/meson.build b/meson.build\n> > index 3a1d12caa4b..e4b8f1e33d2 100644\n> > --- a/meson.build\n> > +++ b/meson.build\n> > @@ -720,11 +720,14 @@ endif\n> >\n> >  builtin_sources += custom_target(\n> >    output: 'config-list.h',\n> > +  depfile: 'config-list.h.d',\n> > +  depend_files: [ 'generate-configlist.sh' ],\n> >    command: [\n> >      shell,\n> > -    meson.current_source_dir() + '/generate-configlist.sh',\n> > +    meson.current_source_dir() / 'generate-configlist.sh',\n> >      meson.current_source_dir(),\n> >      '@OUTPUT@',\n> > +    '@DEPFILE@',\n> >    ],\n> >    env: script_environment,\n> >  )\n>\n> And this looks as expected now, too. I also verified locally that this\n> correctly rebuilds things when either the script or any of the files\n> change.\n>\n> I wonder whether we also want to have a second patch on top to adjust\n> our Makefile? E.g. something like this:\n>\n> diff --git a/Makefile b/Makefile\n> index 47ed9fa7fd..ed82775ec2 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2688,8 +2688,10 @@ $(BUILT_INS): git$X\n>\n>  config-list.h: generate-configlist.sh\n>\n> -config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n> -       $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n> +config-list.h: generate-configlist.sh\n> +       $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n> +\n> +-include .depend/config-list.h.d\n>\n>  command-list.h: generate-cmdlist.sh command-list.txt\n>\n>\n> Please feel free to skip this part though.\n>\n> Thanks!\n>\n> Patrick\n\nThat seems reasonable. I'll add to the next version.\n"},{"id":"536182","messageId":"CALnO6CDSgeOMeu-acjdB=oX985xkQZFpMMA85hHS1NXsin8RmA@mail.gmail.com","threadId":"64940","inReplyTo":"aZQSqtxf_alZnYXD@pks.im","subject":"Re: [PATCH v4] meson: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2026-02-17T13:28:57Z","receivedAt":"2026-02-17T13:29:09Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Tue, Feb 17, 2026 at 2:03 AM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> On Mon, Feb 16, 2026 at 07:33:19PM -0500, Ben Knoble wrote:\n> > Hmm. I’m pretty sure this worked locally but I’m seeing some CI\n> > failures on GitHub. Will investigate.\n>\n> Where did you see the failures? The changes look good to me, and things\n> work as expected on my machine, so I'm wondering what the root cause is.\n> A test run at [1] in GitLab's CI is also successful (ignore the\n> MSVC+Meson failures, a fix for these is being reviewed on the mailing\n> list already).\n>\n> Patrick\n>\n> [1]: https://gitlab.com/gitlab-org/git/-/merge_requests/505\n\nI must have misread my mobile notifications; I _thought_ [1] was\nfailing, but it must have been a different branch I accidentally\npushed to GitHub :) CI for this branch succeeded.\n\n[1]: https://github.com/benknoble/git/actions/runs/22081407078\n\n-- \nD. Ben Knoble\n"},{"id":"536183","messageId":"CALnO6CBqbJ3s6XO0s_bTagJxT0N8nseyJb1T-H7+B6qqWNKoUg@mail.gmail.com","threadId":"64940","inReplyTo":"833b54f7-bb6b-4bb7-a5ec-fc0fa679abf8@gmail.com","subject":"Re: [PATCH v4] meson: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-17T13:38:00Z","receivedAt":"2026-02-17T13:38:12Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Tue, Feb 17, 2026 at 4:20 AM Phillip Wood <phillip.wood123@gmail.com> wrote:\n> On 16/02/2026 22:28, D. Ben Knoble wrote:\n> > +if test -n \"$DEPFILE\"\n> > +then\n> > +     for doc in \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> > +             \"$SOURCE_DIR\"/Documentation/config/*.adoc\n> > +     do\n> > +             printf \"$OUTPUT: %s\\n\" \"$(printf '%s\\n' \"$doc\" | sed 's/[# ]/\\\\&/g')\"\\\\\n>\n> This forks two processes for every file which is a bit inefficient and\n> will be especially slow on windows.\n\nYeah. I couldn't find a way I trusted to behave in the presence of\nstrange characters, though…\n\n> If we quote $OUTPUT first we should\n> be able to use a single sed process for all the files\n>\n>         QUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\"| sed 's|[/\\]|\\\\&|g')\"\n>         printf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n>                 \"$SOURCE_DIR\"/Documentation/config/*.adoc |\n>         sed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n\n…and this version matches a concept I considered. Let me think aloud.\n\nTo quote output, we backslash-escape any \"/\" and \"\\\"; we are going to\nuse it in the replacement side of sed's substitute command with \"/\"\ndelimiters.\n\nMy manual says \"&\" and \"\\[0-9]\" are also special in the replacement\nstring. We have no backreferences for the latter, but my sed on macOS\ncomplains about bad backreferences in cases like\n\n    echo abc | sed 's/^/foo\\1/'\n\nOTOH, escaping backslashes already covers such backreferences. So I\nthink we'd need something closer to\n\n    sed 's,[&/\\],\\\\&,g'\n\n? If you agree with that reasoning, I'll include this in the next\nversion. (I'll also try this out a bit first.)\n\nPS in patterns with so many \"vertical\" characters, I find the commas a\nbit easier to read than pipes :)\n"},{"id":"536190","messageId":"cfea5749-af95-4a46-8a3d-9022d28edb2c@gmail.com","threadId":"64940","inReplyTo":"CALnO6CBqbJ3s6XO0s_bTagJxT0N8nseyJb1T-H7+B6qqWNKoUg@mail.gmail.com","subject":"Re: [PATCH v4] meson: regenerate config-list.h when Documentation changes","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-02-17T15:11:24Z","receivedAt":"2026-02-17T15:11:28Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"On 17/02/2026 13:38, D. Ben Knoble wrote:\n> On Tue, Feb 17, 2026 at 4:20 AM Phillip Wood <phillip.wood123@gmail.com> wrote:\n>> On 16/02/2026 22:28, D. Ben Knoble wrote:\n>>> +if test -n \"$DEPFILE\"\n>>> +then\n>>> +     for doc in \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n>>> +             \"$SOURCE_DIR\"/Documentation/config/*.adoc\n>>> +     do\n>>> +             printf \"$OUTPUT: %s\\n\" \"$(printf '%s\\n' \"$doc\" | sed 's/[# ]/\\\\&/g')\"\\\\\n>>\n>> This forks two processes for every file which is a bit inefficient and\n>> will be especially slow on windows.\n> \n> Yeah. I couldn't find a way I trusted to behave in the presence of\n> strange characters, though…\n> \n>> If we quote $OUTPUT first we should\n>> be able to use a single sed process for all the files\n>>\n>>          QUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\"| sed 's|[/\\]|\\\\&|g')\"\n>>          printf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n>>                  \"$SOURCE_DIR\"/Documentation/config/*.adoc |\n>>          sed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n> \n> …and this version matches a concept I considered. Let me think aloud.\n> \n> To quote output, we backslash-escape any \"/\" and \"\\\"; we are going to\n> use it in the replacement side of sed's substitute command with \"/\"\n> delimiters.\n> \n> My manual says \"&\" and \"\\[0-9]\" are also special in the replacement\n> string.\n\nOh, I should have remembered '&' needed escaping as well\n\n  We have no backreferences for the latter, but my sed on macOS\n> complains about bad backreferences in cases like\n> \n>      echo abc | sed 's/^/foo\\1/'\n> \n> OTOH, escaping backslashes already covers such backreferences. So I\n> think we'd need something closer to\n> \n>      sed 's,[&/\\],\\\\&,g'\n> \n> ? If you agree with that reasoning, I'll include this in the next\n> version. (I'll also try this out a bit first.)\n\nThat looks good to me\n\n> PS in patterns with so many \"vertical\" characters, I find the commas a\n> bit easier to read than pipes :)\n\nYes, that does make it clearer\n\nThanks\n\nPhillip\n"},{"id":"536223","messageId":"xmqq4infazkc.fsf@gitster.g","threadId":"64940","inReplyTo":"CALnO6CAGfd2orSzjvxfAYx=xBnB=QdOwT-f5g0pQrcxO_19BGQ@mail.gmail.com","subject":"Re: [PATCH v4] meson: regenerate config-list.h when Documentation changes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-17T20:24:19Z","receivedAt":"2026-02-17T20:24:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"D. Ben Knoble\" <ben.knoble+github@gmail.com> writes:\n\n>> > +     for doc in \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n>> > +             \"$SOURCE_DIR\"/Documentation/config/*.adoc\n>> > +     do\n>> > +             printf \"$OUTPUT: %s\\n\" \"$(printf '%s\\n' \"$doc\" | sed 's/[# ]/\\\\&/g')\"\n>>\n>> Tiny nit: can't we simplify this to \"$(echo \"$doc\" | sed ...)\"?\n>\n> Given how unportable echo is [1], I'd prefer to keep printf.\n>\n> [1]: https://github.com/benknoble/echocho, for one. If the doc started\n> with \"-e\" for example the results might be unreliable.\n\nTo cause trouble, wouldn't it be necessary for \"$doc\" to be exactly\n\"-e\", not \"started with\"?\n\nAnd when does $SOURCE_DIR begin with \"-e\" anyway?  It sounds more or\nless academic irrelevancy.\n\nWhatn I am more curious about is the \"#\"s and spaces being the only\nbytes that needs quoting.  As SOURCE_DIR pretty much under end-user's\ncontrol (otherwise you wouldn't be worried about it starting with -e),\nwouldn't we have other problematic bytes we need to worry about?\n\n"},{"id":"536293","messageId":"611a94cd988e3795bc63dba2f1b270aa0d058bd2.1771425395.git.ben.knoble+github@gmail.com","threadId":"64940","inReplyTo":"9cdcc9de04f0f8fff657f0474b31c063466ed808.1771280837.git.ben.knoble+github@gmail.com","subject":"[PATCH v5] build: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-18T14:37:59Z","receivedAt":"2026-02-18T14:38:25Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"The Meson-based build doesn't know when to rebuild config-list.h, so the\nheader is sometimes stale.\n\nFor example, an old build directory might have config-list.h from before\n4173df5187 (submodule: introduce extensions.submodulePathConfig,\n2026-01-12), which added submodule.<name>.gitdir to the list. Without\nit, t9902-completion.sh fails. Regenerating the config-list.h artifact\nfrom sources fixes the artifact and the test.\n\nTeach the meson build to depend on the Documentation files that\ngenerate-configlist.sh reads by having it an additional output as a list\nof dependency files, since Meson does not have (or want) builtin support\nfor globbing like Make. We assume that if a user adds a new file under\nDocumentation/config then they will also edit one of the existing files\nto include that new file, and that will trigger a rebuild. Also mark the\ngenerator script as a dependency.\n\nWhile we're at it, teach the Makefile to use the same \"the script knows\nit's dependencies\" logic.\n\nFor Meson, combining the following commands helps debug dependencies:\n\n    ninja -C <builddir> -t deps config-list.h\n    ninja -C <builddir> -t browse config-list.h\n\nThe former lists all the dependencies discovered from our output \".d\"\nfile (the config documentation) and the latter shows the dependency on\nthe script itself, among other useful edges in the dependency graph.\n\nHelped-by: Patrick Steinhardt <ps@pks.im>\nHelped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nSigned-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n---\n\nNotes (benknoble/commits):\n    Changes from v4 (<9cdcc9de04f0f8fff657f0474b31c063466ed808.1771280837.git.ben.knoble+github@gmail.com>):\n    \n    • Include Patrick's suggested Makefile changes. Note there's no quiet\n      equivalent for mdkir that isn't for the current target's containing\n      directory…\n    • Make depfile output efficient again, thanks to Phillip.\n    \n    I've kept printf instead of echo (from Patrick/Junio) because I think it\n    is easier to reason about (\"it works\" vs. \"did I use this in a way that\n    might cause problems\").\n    \n    Junio asked about other problematic bytes: the other one I could think\n    of (since all the inputs should be paths, anyway) is newlines. I gave\n    meson's depfile.py a glance [1], and it looks like they don't handle\n    newlines in paths. Other whitespace doesn't appear to be an issue (see\n    \"elif c in {' ', '\\n'}\"); I think _most_ characters are just added to\n    the filename.\n    \n    [1]: https://github.com/mesonbuild/meson/blob/master/mesonbuild/depfile.py\n\n Makefile               |  5 +++--\n generate-configlist.sh | 11 ++++++++++-\n meson.build            |  5 ++++-\n 3 files changed, 17 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 7f37ad8f58..6f926ffb1f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2688,9 +2688,10 @@ $(BUILT_INS): git$X\n \tcp $< $@\n \n config-list.h: generate-configlist.sh\n+\t@mkdir -p .depend\n+\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n \n-config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n-\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n+-include .depend/config-list.h.d\n \n command-list.h: generate-cmdlist.sh command-list.txt\n \ndiff --git a/generate-configlist.sh b/generate-configlist.sh\nindex 75c39ade20..39ac8845ab 100755\n--- a/generate-configlist.sh\n+++ b/generate-configlist.sh\n@@ -2,10 +2,11 @@\n \n SOURCE_DIR=\"$1\"\n OUTPUT=\"$2\"\n+DEPFILE=\"$3\"\n \n if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n then\n-\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n+\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT> [<DEPFILE>]\"\n \texit 1\n fi\n \n@@ -36,3 +37,11 @@ print_config_list () {\n \techo\n \tprint_config_list\n } >\"$OUTPUT\"\n+\n+if test -n \"$DEPFILE\"\n+then\n+\tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n+\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n+\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n+\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n+fi\ndiff --git a/meson.build b/meson.build\nindex 762e2d0fc0..74b459b004 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -720,11 +720,14 @@ endif\n \n builtin_sources += custom_target(\n   output: 'config-list.h',\n+  depfile: 'config-list.h.d',\n+  depend_files: [ 'generate-configlist.sh' ],\n   command: [\n     shell,\n-    meson.current_source_dir() + '/generate-configlist.sh',\n+    meson.current_source_dir() / 'generate-configlist.sh',\n     meson.current_source_dir(),\n     '@OUTPUT@',\n+    '@DEPFILE@',\n   ],\n   env: script_environment,\n )\n\nDiff-intervalle contre v4 :\n1:  e2f4e1f9ba < -:  ---------- completion: add stash import, export\n2:  9cdcc9de04 ! 1:  611a94cd98 meson: regenerate config-list.h when Documentation changes\n    @@ Metadata\n     Author: D. Ben Knoble <ben.knoble+github@gmail.com>\n     \n      ## Commit message ##\n    -    meson: regenerate config-list.h when Documentation changes\n    +    build: regenerate config-list.h when Documentation changes\n     \n         The Meson-based build doesn't know when to rebuild config-list.h, so the\n         header is sometimes stale.\n    @@ Commit message\n         of dependency files, since Meson does not have (or want) builtin support\n         for globbing like Make. We assume that if a user adds a new file under\n         Documentation/config then they will also edit one of the existing files\n    -    to include that new file, and that will trigger a rebuild.\n    +    to include that new file, and that will trigger a rebuild. Also mark the\n    +    generator script as a dependency.\n     \n    -    Also mark the generator script as a dependency.\n    +    While we're at it, teach the Makefile to use the same \"the script knows\n    +    it's dependencies\" logic.\n     \n    -    Combining the following commands helps debug dependencies:\n    +    For Meson, combining the following commands helps debug dependencies:\n     \n             ninja -C <builddir> -t deps config-list.h\n             ninja -C <builddir> -t browse config-list.h\n    @@ Commit message\n     \n     \n      ## Notes (benknoble/commits) ##\n    -    Changes from v3 (<0a344f1f3ee4a5d95c6f46df030b9936db4354a1.1770853297.git.ben.knoble+github@gmail.com>):\n    +    Changes from v4 (<9cdcc9de04f0f8fff657f0474b31c063466ed808.1771280837.git.ben.knoble+github@gmail.com>):\n     \n    -    • Include the script itself as a dependency via depfile\n    -    • Fix output path escaping (spaces, octothorpes; drop backslashes) for\n    -      Ninja (I've used a loop because I couldn't find a portable construct\n    -      that could escape only the remainder of the lines in the way I\n    -      wanted).\n    -    • Mention our assumptions about Documentation updates triggering\n    -      rebuilds\n    -    • Also include some debugging information in the commit message\n    +    • Include Patrick's suggested Makefile changes. Note there's no quiet\n    +      equivalent for mdkir that isn't for the current target's containing\n    +      directory…\n    +    • Make depfile output efficient again, thanks to Phillip.\n    +\n    +    I've kept printf instead of echo (from Patrick/Junio) because I think it\n    +    is easier to reason about (\"it works\" vs. \"did I use this in a way that\n    +    might cause problems\").\n    +\n    +    Junio asked about other problematic bytes: the other one I could think\n    +    of (since all the inputs should be paths, anyway) is newlines. I gave\n    +    meson's depfile.py a glance [1], and it looks like they don't handle\n    +    newlines in paths. Other whitespace doesn't appear to be an issue (see\n    +    \"elif c in {' ', '\\n'}\"); I think _most_ characters are just added to\n    +    the filename.\n    +\n    +    [1]: https://github.com/mesonbuild/meson/blob/master/mesonbuild/depfile.py\n    +\n    + ## Makefile ##\n    +@@ Makefile: $(BUILT_INS): git$X\n    + \tcp $< $@\n    + \n    + config-list.h: generate-configlist.sh\n    ++\t@mkdir -p .depend\n    ++\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n    + \n    +-config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n    +-\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n    ++-include .depend/config-list.h.d\n    + \n    + command-list.h: generate-cmdlist.sh command-list.txt\n    + \n     \n      ## generate-configlist.sh ##\n     @@\n    @@ generate-configlist.sh: print_config_list () {\n     +\n     +if test -n \"$DEPFILE\"\n     +then\n    -+\tfor doc in \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n    -+\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc\n    -+\tdo\n    -+\t\tprintf \"$OUTPUT: %s\\n\" \"$(printf '%s\\n' \"$doc\" | sed 's/[# ]/\\\\&/g')\"\n    -+\tdone >\"$DEPFILE\"\n    ++\tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n    ++\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n    ++\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n    ++\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n     +fi\n     \n      ## meson.build ##\n\nbase-commit: f7e9f6c205466443107228e036b20acb7baa8c50\n-- \n2.53.0\n\n"},{"id":"536393","messageId":"fe5bb243-6205-41d1-9dad-7a1e2e42fbec@gmail.com","threadId":"64940","inReplyTo":"611a94cd988e3795bc63dba2f1b270aa0d058bd2.1771425395.git.ben.knoble+github@gmail.com","subject":"Re: [PATCH v5] build: regenerate config-list.h when Documentation changes","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-02-19T10:19:01Z","receivedAt":"2026-02-19T10:19:04Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Ben\n\nI tested the meson changes by setting up source and build directories \nwith daft names to test the quoting.\n\n$ git worktree add --detach '/dev/shm/s#r#c dir'\n$ cd '/dev/shm/s#r#c dir'\n$ meson setup '/dev/shm/b#u&i ld'\n\nIf I build git and then remove Documentation/config/add.adoc \nconfig-list.h is regenerated, it is not regenerated if I do not change \nany of the config documentation files so it looks to be working \ncorrectly. I've not tested the Makefile changes.\n\nThanks for working on it\n\nPhillip\n\nOn 18/02/2026 14:37, D. Ben Knoble wrote:\n> The Meson-based build doesn't know when to rebuild config-list.h, so the\n> header is sometimes stale.\n> \n> For example, an old build directory might have config-list.h from before\n> 4173df5187 (submodule: introduce extensions.submodulePathConfig,\n> 2026-01-12), which added submodule.<name>.gitdir to the list. Without\n> it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n> from sources fixes the artifact and the test.\n> \n> Teach the meson build to depend on the Documentation files that\n> generate-configlist.sh reads by having it an additional output as a list\n> of dependency files, since Meson does not have (or want) builtin support\n> for globbing like Make. We assume that if a user adds a new file under\n> Documentation/config then they will also edit one of the existing files\n> to include that new file, and that will trigger a rebuild. Also mark the\n> generator script as a dependency.\n> \n> While we're at it, teach the Makefile to use the same \"the script knows\n> it's dependencies\" logic.\n> \n> For Meson, combining the following commands helps debug dependencies:\n> \n>      ninja -C <builddir> -t deps config-list.h\n>      ninja -C <builddir> -t browse config-list.h\n> \n> The former lists all the dependencies discovered from our output \".d\"\n> file (the config documentation) and the latter shows the dependency on\n> the script itself, among other useful edges in the dependency graph.\n> \n> Helped-by: Patrick Steinhardt <ps@pks.im>\n> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n> ---\n> \n> Notes (benknoble/commits):\n>      Changes from v4 (<9cdcc9de04f0f8fff657f0474b31c063466ed808.1771280837.git.ben.knoble+github@gmail.com>):\n>      \n>      • Include Patrick's suggested Makefile changes. Note there's no quiet\n>        equivalent for mdkir that isn't for the current target's containing\n>        directory…\n>      • Make depfile output efficient again, thanks to Phillip.\n>      \n>      I've kept printf instead of echo (from Patrick/Junio) because I think it\n>      is easier to reason about (\"it works\" vs. \"did I use this in a way that\n>      might cause problems\").\n>      \n>      Junio asked about other problematic bytes: the other one I could think\n>      of (since all the inputs should be paths, anyway) is newlines. I gave\n>      meson's depfile.py a glance [1], and it looks like they don't handle\n>      newlines in paths. Other whitespace doesn't appear to be an issue (see\n>      \"elif c in {' ', '\\n'}\"); I think _most_ characters are just added to\n>      the filename.\n>      \n>      [1]: https://github.com/mesonbuild/meson/blob/master/mesonbuild/depfile.py\n> \n>   Makefile               |  5 +++--\n>   generate-configlist.sh | 11 ++++++++++-\n>   meson.build            |  5 ++++-\n>   3 files changed, 17 insertions(+), 4 deletions(-)\n> \n> diff --git a/Makefile b/Makefile\n> index 7f37ad8f58..6f926ffb1f 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2688,9 +2688,10 @@ $(BUILT_INS): git$X\n>   \tcp $< $@\n>   \n>   config-list.h: generate-configlist.sh\n> +\t@mkdir -p .depend\n> +\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n>   \n> -config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n> -\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n> +-include .depend/config-list.h.d\n>   \n>   command-list.h: generate-cmdlist.sh command-list.txt\n>   \n> diff --git a/generate-configlist.sh b/generate-configlist.sh\n> index 75c39ade20..39ac8845ab 100755\n> --- a/generate-configlist.sh\n> +++ b/generate-configlist.sh\n> @@ -2,10 +2,11 @@\n>   \n>   SOURCE_DIR=\"$1\"\n>   OUTPUT=\"$2\"\n> +DEPFILE=\"$3\"\n>   \n>   if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n>   then\n> -\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n> +\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT> [<DEPFILE>]\"\n>   \texit 1\n>   fi\n>   \n> @@ -36,3 +37,11 @@ print_config_list () {\n>   \techo\n>   \tprint_config_list\n>   } >\"$OUTPUT\"\n> +\n> +if test -n \"$DEPFILE\"\n> +then\n> +\tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n> +\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> +\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> +\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n> +fi\n> diff --git a/meson.build b/meson.build\n> index 762e2d0fc0..74b459b004 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -720,11 +720,14 @@ endif\n>   \n>   builtin_sources += custom_target(\n>     output: 'config-list.h',\n> +  depfile: 'config-list.h.d',\n> +  depend_files: [ 'generate-configlist.sh' ],\n>     command: [\n>       shell,\n> -    meson.current_source_dir() + '/generate-configlist.sh',\n> +    meson.current_source_dir() / 'generate-configlist.sh',\n>       meson.current_source_dir(),\n>       '@OUTPUT@',\n> +    '@DEPFILE@',\n>     ],\n>     env: script_environment,\n>   )\n> \n> Diff-intervalle contre v4 :\n> 1:  e2f4e1f9ba < -:  ---------- completion: add stash import, export\n> 2:  9cdcc9de04 ! 1:  611a94cd98 meson: regenerate config-list.h when Documentation changes\n>      @@ Metadata\n>       Author: D. Ben Knoble <ben.knoble+github@gmail.com>\n>       \n>        ## Commit message ##\n>      -    meson: regenerate config-list.h when Documentation changes\n>      +    build: regenerate config-list.h when Documentation changes\n>       \n>           The Meson-based build doesn't know when to rebuild config-list.h, so the\n>           header is sometimes stale.\n>      @@ Commit message\n>           of dependency files, since Meson does not have (or want) builtin support\n>           for globbing like Make. We assume that if a user adds a new file under\n>           Documentation/config then they will also edit one of the existing files\n>      -    to include that new file, and that will trigger a rebuild.\n>      +    to include that new file, and that will trigger a rebuild. Also mark the\n>      +    generator script as a dependency.\n>       \n>      -    Also mark the generator script as a dependency.\n>      +    While we're at it, teach the Makefile to use the same \"the script knows\n>      +    it's dependencies\" logic.\n>       \n>      -    Combining the following commands helps debug dependencies:\n>      +    For Meson, combining the following commands helps debug dependencies:\n>       \n>               ninja -C <builddir> -t deps config-list.h\n>               ninja -C <builddir> -t browse config-list.h\n>      @@ Commit message\n>       \n>       \n>        ## Notes (benknoble/commits) ##\n>      -    Changes from v3 (<0a344f1f3ee4a5d95c6f46df030b9936db4354a1.1770853297.git.ben.knoble+github@gmail.com>):\n>      +    Changes from v4 (<9cdcc9de04f0f8fff657f0474b31c063466ed808.1771280837.git.ben.knoble+github@gmail.com>):\n>       \n>      -    • Include the script itself as a dependency via depfile\n>      -    • Fix output path escaping (spaces, octothorpes; drop backslashes) for\n>      -      Ninja (I've used a loop because I couldn't find a portable construct\n>      -      that could escape only the remainder of the lines in the way I\n>      -      wanted).\n>      -    • Mention our assumptions about Documentation updates triggering\n>      -      rebuilds\n>      -    • Also include some debugging information in the commit message\n>      +    • Include Patrick's suggested Makefile changes. Note there's no quiet\n>      +      equivalent for mdkir that isn't for the current target's containing\n>      +      directory…\n>      +    • Make depfile output efficient again, thanks to Phillip.\n>      +\n>      +    I've kept printf instead of echo (from Patrick/Junio) because I think it\n>      +    is easier to reason about (\"it works\" vs. \"did I use this in a way that\n>      +    might cause problems\").\n>      +\n>      +    Junio asked about other problematic bytes: the other one I could think\n>      +    of (since all the inputs should be paths, anyway) is newlines. I gave\n>      +    meson's depfile.py a glance [1], and it looks like they don't handle\n>      +    newlines in paths. Other whitespace doesn't appear to be an issue (see\n>      +    \"elif c in {' ', '\\n'}\"); I think _most_ characters are just added to\n>      +    the filename.\n>      +\n>      +    [1]: https://github.com/mesonbuild/meson/blob/master/mesonbuild/depfile.py\n>      +\n>      + ## Makefile ##\n>      +@@ Makefile: $(BUILT_INS): git$X\n>      + \tcp $< $@\n>      +\n>      + config-list.h: generate-configlist.sh\n>      ++\t@mkdir -p .depend\n>      ++\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n>      +\n>      +-config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n>      +-\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n>      ++-include .depend/config-list.h.d\n>      +\n>      + command-list.h: generate-cmdlist.sh command-list.txt\n>      +\n>       \n>        ## generate-configlist.sh ##\n>       @@\n>      @@ generate-configlist.sh: print_config_list () {\n>       +\n>       +if test -n \"$DEPFILE\"\n>       +then\n>      -+\tfor doc in \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n>      -+\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc\n>      -+\tdo\n>      -+\t\tprintf \"$OUTPUT: %s\\n\" \"$(printf '%s\\n' \"$doc\" | sed 's/[# ]/\\\\&/g')\"\n>      -+\tdone >\"$DEPFILE\"\n>      ++\tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n>      ++\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n>      ++\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n>      ++\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n>       +fi\n>       \n>        ## meson.build ##\n> \n> base-commit: f7e9f6c205466443107228e036b20acb7baa8c50\n\n"},{"id":"536403","messageId":"CALnO6CD7xGzVSKRWFJw-igz49PrYfyGyd6_pDP1QN8dTETMJVQ@mail.gmail.com","threadId":"64940","inReplyTo":"fe5bb243-6205-41d1-9dad-7a1e2e42fbec@gmail.com","subject":"Re: [PATCH v5] build: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-19T13:40:38Z","receivedAt":"2026-02-19T13:40:50Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Thu, Feb 19, 2026 at 5:19 AM Phillip Wood <phillip.wood123@gmail.com> wrote:\n>\n> Hi Ben\n>\n> I tested the meson changes by setting up source and build directories\n> with daft names to test the quoting.\n>\n> $ git worktree add --detach '/dev/shm/s#r#c dir'\n> $ cd '/dev/shm/s#r#c dir'\n> $ meson setup '/dev/shm/b#u&i ld'\n>\n> If I build git and then remove Documentation/config/add.adoc\n> config-list.h is regenerated, it is not regenerated if I do not change\n> any of the config documentation files so it looks to be working\n> correctly. I've not tested the Makefile changes.\n>\n> Thanks for working on it\n>\n> Phillip\n\nGreat, thanks!\n"},{"id":"536406","messageId":"aZcWq9SapNnRAXti@pks.im","threadId":"64940","inReplyTo":"611a94cd988e3795bc63dba2f1b270aa0d058bd2.1771425395.git.ben.knoble+github@gmail.com","subject":"Re: [PATCH v5] build: regenerate config-list.h when Documentation changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-19T13:56:59Z","receivedAt":"2026-02-19T13:57:06Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Feb 18, 2026 at 09:37:59AM -0500, D. Ben Knoble wrote:\n> diff --git a/generate-configlist.sh b/generate-configlist.sh\n> index 75c39ade20..39ac8845ab 100755\n> --- a/generate-configlist.sh\n> +++ b/generate-configlist.sh\n> @@ -36,3 +37,11 @@ print_config_list () {\n>  \techo\n>  \tprint_config_list\n>  } >\"$OUTPUT\"\n> +\n> +if test -n \"$DEPFILE\"\n\nWe could arguably drop conditional now that both the Makefile and Meson\npass that argument, but I don't mind it much.\n\n> +then\n> +\tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n> +\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> +\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> +\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n> +fi\n\nOkay, so we first quote the target output file once, and then we quote\nthe sources with a single call to sed(1), too. To not perform quoting\nof the target output file twice we don't include it in the printf call,\nbut instead prepend it to each line.\n\nLooks reasonable to me, and we spawn at most two sed(1) processes. Nice.\n\n> diff --git a/meson.build b/meson.build\n> index 762e2d0fc0..74b459b004 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -720,11 +720,14 @@ endif\n>  \n>  builtin_sources += custom_target(\n>    output: 'config-list.h',\n> +  depfile: 'config-list.h.d',\n> +  depend_files: [ 'generate-configlist.sh' ],\n>    command: [\n>      shell,\n> -    meson.current_source_dir() + '/generate-configlist.sh',\n> +    meson.current_source_dir() / 'generate-configlist.sh',\n>      meson.current_source_dir(),\n>      '@OUTPUT@',\n> +    '@DEPFILE@',\n>    ],\n>    env: script_environment,\n>  )\n> \n> Diff-intervalle contre v4 :\n> 1:  e2f4e1f9ba < -:  ---------- completion: add stash import, export\n\nThe range-diff is a bit broken, but that doesn't really matter much.\nOverall this patch looks good to me, thanks!\n\nPatrick\n"},{"id":"536411","messageId":"b40e96e3-7e22-454c-a69b-56af45795470@xiplink.com","threadId":"64940","inReplyTo":"611a94cd988e3795bc63dba2f1b270aa0d058bd2.1771425395.git.ben.knoble+github@gmail.com","subject":"Re: [PATCH v5] build: regenerate config-list.h when Documentation changes","fromName":"Marc Branchaud","fromEmail":"marcnarc@xiplink.com","sentAt":"2026-02-19T15:10:19Z","receivedAt":"2026-02-19T15:10:26Z","isPatch":true,"sender":{"key":"marcnarc@xiplink.com","avatar":"https://avatars.githubusercontent.com/u/14980203?v=4"},"body":"\nOn 2026-02-18 07:37, D. Ben Knoble wrote:\n> The Meson-based build doesn't know when to rebuild config-list.h, so the\n> header is sometimes stale.\n> \n> For example, an old build directory might have config-list.h from before\n> 4173df5187 (submodule: introduce extensions.submodulePathConfig,\n> 2026-01-12), which added submodule.<name>.gitdir to the list. Without\n> it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n> from sources fixes the artifact and the test.\n> \n> Teach the meson build to depend on the Documentation files that\n> generate-configlist.sh reads by having it an additional output as a list> of dependency files, since Meson does not have (or want) builtin support\n> for globbing like Make.\n\nThat sentence doesn't parse.  Maybe this?\n\nSince Meson does not have (or want) builtin support for globbing like \nMake, teach generate-configlist.sh to generate a dependency list of the \nDocumentation files it reads, and have the Meson build incorporate that.\n\n\t\tM.\n\n> We assume that if a user adds a new file under\n> Documentation/config then they will also edit one of the existing files\n> to include that new file, and that will trigger a rebuild. Also mark the\n> generator script as a dependency.\n> \n> While we're at it, teach the Makefile to use the same \"the script knows\n> it's dependencies\" logic.\n> \n> For Meson, combining the following commands helps debug dependencies:\n> \n>      ninja -C <builddir> -t deps config-list.h\n>      ninja -C <builddir> -t browse config-list.h\n> \n> The former lists all the dependencies discovered from our output \".d\"\n> file (the config documentation) and the latter shows the dependency on\n> the script itself, among other useful edges in the dependency graph.\n> \n> Helped-by: Patrick Steinhardt <ps@pks.im>\n> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n> ---\n> \n> Notes (benknoble/commits):\n>      Changes from v4 (<9cdcc9de04f0f8fff657f0474b31c063466ed808.1771280837.git.ben.knoble+github@gmail.com>):\n>      \n>      • Include Patrick's suggested Makefile changes. Note there's no quiet\n>        equivalent for mdkir that isn't for the current target's containing\n>        directory…\n>      • Make depfile output efficient again, thanks to Phillip.\n>      \n>      I've kept printf instead of echo (from Patrick/Junio) because I think it\n>      is easier to reason about (\"it works\" vs. \"did I use this in a way that\n>      might cause problems\").\n>      \n>      Junio asked about other problematic bytes: the other one I could think\n>      of (since all the inputs should be paths, anyway) is newlines. I gave\n>      meson's depfile.py a glance [1], and it looks like they don't handle\n>      newlines in paths. Other whitespace doesn't appear to be an issue (see\n>      \"elif c in {' ', '\\n'}\"); I think _most_ characters are just added to\n>      the filename.\n>      \n>      [1]: https://github.com/mesonbuild/meson/blob/master/mesonbuild/depfile.py\n> \n>   Makefile               |  5 +++--\n>   generate-configlist.sh | 11 ++++++++++-\n>   meson.build            |  5 ++++-\n>   3 files changed, 17 insertions(+), 4 deletions(-)\n> \n> diff --git a/Makefile b/Makefile\n> index 7f37ad8f58..6f926ffb1f 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2688,9 +2688,10 @@ $(BUILT_INS): git$X\n>   \tcp $< $@\n>   \n>   config-list.h: generate-configlist.sh\n> +\t@mkdir -p .depend\n> +\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n>   \n> -config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n> -\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n> +-include .depend/config-list.h.d\n>   \n>   command-list.h: generate-cmdlist.sh command-list.txt\n>   \n> diff --git a/generate-configlist.sh b/generate-configlist.sh\n> index 75c39ade20..39ac8845ab 100755\n> --- a/generate-configlist.sh\n> +++ b/generate-configlist.sh\n> @@ -2,10 +2,11 @@\n>   \n>   SOURCE_DIR=\"$1\"\n>   OUTPUT=\"$2\"\n> +DEPFILE=\"$3\"\n>   \n>   if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n>   then\n> -\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n> +\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT> [<DEPFILE>]\"\n>   \texit 1\n>   fi\n>   \n> @@ -36,3 +37,11 @@ print_config_list () {\n>   \techo\n>   \tprint_config_list\n>   } >\"$OUTPUT\"\n> +\n> +if test -n \"$DEPFILE\"\n> +then\n> +\tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n> +\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> +\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> +\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n> +fi\n> diff --git a/meson.build b/meson.build\n> index 762e2d0fc0..74b459b004 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -720,11 +720,14 @@ endif\n>   \n>   builtin_sources += custom_target(\n>     output: 'config-list.h',\n> +  depfile: 'config-list.h.d',\n> +  depend_files: [ 'generate-configlist.sh' ],\n>     command: [\n>       shell,\n> -    meson.current_source_dir() + '/generate-configlist.sh',\n> +    meson.current_source_dir() / 'generate-configlist.sh',\n>       meson.current_source_dir(),\n>       '@OUTPUT@',\n> +    '@DEPFILE@',\n>     ],\n>     env: script_environment,\n>   )\n> \n> Diff-intervalle contre v4 :\n> 1:  e2f4e1f9ba < -:  ---------- completion: add stash import, export\n> 2:  9cdcc9de04 ! 1:  611a94cd98 meson: regenerate config-list.h when Documentation changes\n>      @@ Metadata\n>       Author: D. Ben Knoble <ben.knoble+github@gmail.com>\n>       \n>        ## Commit message ##\n>      -    meson: regenerate config-list.h when Documentation changes\n>      +    build: regenerate config-list.h when Documentation changes\n>       \n>           The Meson-based build doesn't know when to rebuild config-list.h, so the\n>           header is sometimes stale.\n>      @@ Commit message\n>           of dependency files, since Meson does not have (or want) builtin support\n>           for globbing like Make. We assume that if a user adds a new file under\n>           Documentation/config then they will also edit one of the existing files\n>      -    to include that new file, and that will trigger a rebuild.\n>      +    to include that new file, and that will trigger a rebuild. Also mark the\n>      +    generator script as a dependency.\n>       \n>      -    Also mark the generator script as a dependency.\n>      +    While we're at it, teach the Makefile to use the same \"the script knows\n>      +    it's dependencies\" logic.\n>       \n>      -    Combining the following commands helps debug dependencies:\n>      +    For Meson, combining the following commands helps debug dependencies:\n>       \n>               ninja -C <builddir> -t deps config-list.h\n>               ninja -C <builddir> -t browse config-list.h\n>      @@ Commit message\n>       \n>       \n>        ## Notes (benknoble/commits) ##\n>      -    Changes from v3 (<0a344f1f3ee4a5d95c6f46df030b9936db4354a1.1770853297.git.ben.knoble+github@gmail.com>):\n>      +    Changes from v4 (<9cdcc9de04f0f8fff657f0474b31c063466ed808.1771280837.git.ben.knoble+github@gmail.com>):\n>       \n>      -    • Include the script itself as a dependency via depfile\n>      -    • Fix output path escaping (spaces, octothorpes; drop backslashes) for\n>      -      Ninja (I've used a loop because I couldn't find a portable construct\n>      -      that could escape only the remainder of the lines in the way I\n>      -      wanted).\n>      -    • Mention our assumptions about Documentation updates triggering\n>      -      rebuilds\n>      -    • Also include some debugging information in the commit message\n>      +    • Include Patrick's suggested Makefile changes. Note there's no quiet\n>      +      equivalent for mdkir that isn't for the current target's containing\n>      +      directory…\n>      +    • Make depfile output efficient again, thanks to Phillip.\n>      +\n>      +    I've kept printf instead of echo (from Patrick/Junio) because I think it\n>      +    is easier to reason about (\"it works\" vs. \"did I use this in a way that\n>      +    might cause problems\").\n>      +\n>      +    Junio asked about other problematic bytes: the other one I could think\n>      +    of (since all the inputs should be paths, anyway) is newlines. I gave\n>      +    meson's depfile.py a glance [1], and it looks like they don't handle\n>      +    newlines in paths. Other whitespace doesn't appear to be an issue (see\n>      +    \"elif c in {' ', '\\n'}\"); I think _most_ characters are just added to\n>      +    the filename.\n>      +\n>      +    [1]: https://github.com/mesonbuild/meson/blob/master/mesonbuild/depfile.py\n>      +\n>      + ## Makefile ##\n>      +@@ Makefile: $(BUILT_INS): git$X\n>      + \tcp $< $@\n>      +\n>      + config-list.h: generate-configlist.sh\n>      ++\t@mkdir -p .depend\n>      ++\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n>      +\n>      +-config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n>      +-\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n>      ++-include .depend/config-list.h.d\n>      +\n>      + command-list.h: generate-cmdlist.sh command-list.txt\n>      +\n>       \n>        ## generate-configlist.sh ##\n>       @@\n>      @@ generate-configlist.sh: print_config_list () {\n>       +\n>       +if test -n \"$DEPFILE\"\n>       +then\n>      -+\tfor doc in \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n>      -+\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc\n>      -+\tdo\n>      -+\t\tprintf \"$OUTPUT: %s\\n\" \"$(printf '%s\\n' \"$doc\" | sed 's/[# ]/\\\\&/g')\"\n>      -+\tdone >\"$DEPFILE\"\n>      ++\tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n>      ++\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n>      ++\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n>      ++\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n>       +fi\n>       \n>        ## meson.build ##\n> \n> base-commit: f7e9f6c205466443107228e036b20acb7baa8c50\n\n"},{"id":"536584","messageId":"CALnO6CB0db28NCeoq7zJU-BF=ruoTsD9_f48rgEuweumoT7--w@mail.gmail.com","threadId":"64940","inReplyTo":"aZcWq9SapNnRAXti@pks.im","subject":"Re: [PATCH v5] build: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-21T13:58:10Z","receivedAt":"2026-02-21T13:58:22Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Thu, Feb 19, 2026 at 8:57 AM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> On Wed, Feb 18, 2026 at 09:37:59AM -0500, D. Ben Knoble wrote:\n> > diff --git a/generate-configlist.sh b/generate-configlist.sh\n> > index 75c39ade20..39ac8845ab 100755\n> > --- a/generate-configlist.sh\n> > +++ b/generate-configlist.sh\n> > @@ -36,3 +37,11 @@ print_config_list () {\n> >       echo\n> >       print_config_list\n> >  } >\"$OUTPUT\"\n> > +\n> > +if test -n \"$DEPFILE\"\n>\n> We could arguably drop conditional now that both the Makefile and Meson\n> pass that argument, but I don't mind it much.\n\nI'm going to reroll a commit message, so I could drop this. OTOH, I\nthink we've got a working configuration, and maybe someone runs this\nscript occasionally to generate the list without wanting the deps.\nIdk.\n\n> > +then\n> > +     QUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n> > +     printf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> > +             \"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> > +             sed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n> > +fi\n>\n> Okay, so we first quote the target output file once, and then we quote\n> the sources with a single call to sed(1), too. To not perform quoting\n> of the target output file twice we don't include it in the printf call,\n> but instead prepend it to each line.\n>\n> Looks reasonable to me, and we spawn at most two sed(1) processes. Nice.\n>\n> > diff --git a/meson.build b/meson.build\n> > index 762e2d0fc0..74b459b004 100644\n> > --- a/meson.build\n> > +++ b/meson.build\n> > @@ -720,11 +720,14 @@ endif\n> >\n> >  builtin_sources += custom_target(\n> >    output: 'config-list.h',\n> > +  depfile: 'config-list.h.d',\n> > +  depend_files: [ 'generate-configlist.sh' ],\n> >    command: [\n> >      shell,\n> > -    meson.current_source_dir() + '/generate-configlist.sh',\n> > +    meson.current_source_dir() / 'generate-configlist.sh',\n> >      meson.current_source_dir(),\n> >      '@OUTPUT@',\n> > +    '@DEPFILE@',\n> >    ],\n> >    env: script_environment,\n> >  )\n> >\n> > Diff-intervalle contre v4 :\n> > 1:  e2f4e1f9ba < -:  ---------- completion: add stash import, export\n>\n> The range-diff is a bit broken, but that doesn't really matter much.\n\nGr. I must have tweaked something at the last second and missed this. Bummer.\n\n> Overall this patch looks good to me, thanks!\n>\n> Patrick\n\nThanks for the help and reviews!\n"},{"id":"536585","messageId":"CALnO6CBxVS199U+wcgw81GqXW4dv6=+L8TrjpvRNBYXgt1G1Ow@mail.gmail.com","threadId":"64940","inReplyTo":"b40e96e3-7e22-454c-a69b-56af45795470@xiplink.com","subject":"Re: [PATCH v5] build: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-21T13:58:57Z","receivedAt":"2026-02-21T13:59:09Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Thu, Feb 19, 2026 at 10:10 AM Marc Branchaud <marcnarc@xiplink.com> wrote:\n>\n>\n> On 2026-02-18 07:37, D. Ben Knoble wrote:\n> > The Meson-based build doesn't know when to rebuild config-list.h, so the\n> > header is sometimes stale.\n> >\n> > For example, an old build directory might have config-list.h from before\n> > 4173df5187 (submodule: introduce extensions.submodulePathConfig,\n> > 2026-01-12), which added submodule.<name>.gitdir to the list. Without\n> > it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n> > from sources fixes the artifact and the test.\n> >\n> > Teach the meson build to depend on the Documentation files that\n> > generate-configlist.sh reads by having it an additional output as a list\n> > of dependency files, since Meson does not have (or want) builtin support\n> > for globbing like Make.\n>\n> That sentence doesn't parse.  Maybe this?\n>\n> Since Meson does not have (or want) builtin support for globbing like\n> Make, teach generate-configlist.sh to generate a dependency list of the\n> Documentation files it reads, and have the Meson build incorporate that.\n>\n>                 M.\n\nThanks. That sentence is looking stranger than when I first wrote it. Will fix.\n"},{"id":"536587","messageId":"5dcd4e9308100a25603c50fecb36447c0ee4df62.1771682788.git.ben.knoble+github@gmail.com","threadId":"64940","inReplyTo":"611a94cd988e3795bc63dba2f1b270aa0d058bd2.1771425395.git.ben.knoble+github@gmail.com","subject":"[PATCH v6] build: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-21T14:07:17Z","receivedAt":"2026-02-21T14:07:31Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"The Meson-based build doesn't know when to rebuild config-list.h, so the\nheader is sometimes stale.\n\nFor example, an old build directory might have config-list.h from before\n4173df5187 (submodule: introduce extensions.submodulePathConfig,\n2026-01-12), which added submodule.<name>.gitdir to the list. Without\nit, t9902-completion.sh fails. Regenerating the config-list.h artifact\nfrom sources fixes the artifact and the test.\n\nSince Meson does not have (or want) builtin support for globbing like\nMake, teach generate-configlist.sh to also generate a list of\nDocumentation files its output depends on, and incorporate that into the\nMeson build.\n\nWe assume that if a user adds a new file under\nDocumentation/config then they will also edit one of the existing files\nto include that new file, and that will trigger a rebuild. Also mark the\ngenerator script as a dependency.\n\nWhile we're at it, teach the Makefile to use the same \"the script knows\nit's dependencies\" logic.\n\nFor Meson, combining the following commands helps debug dependencies:\n\n    ninja -C <builddir> -t deps config-list.h\n    ninja -C <builddir> -t browse config-list.h\n\nThe former lists all the dependencies discovered from our output \".d\"\nfile (the config documentation) and the latter shows the dependency on\nthe script itself, among other useful edges in the dependency graph.\n\nHelped-by: Patrick Steinhardt <ps@pks.im>\nHelped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nSigned-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n---\n\nNotes (benknoble/commits):\n    Changes from v5 (<611a94cd988e3795bc63dba2f1b270aa0d058bd2.1771425395.git.ben.knoble+github@gmail.com>):\n    \n    • Reword a confusing sentence in the commit message\n\n Makefile               |  5 +++--\n generate-configlist.sh | 11 ++++++++++-\n meson.build            |  5 ++++-\n 3 files changed, 17 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 7f37ad8f58..6f926ffb1f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2688,9 +2688,10 @@ $(BUILT_INS): git$X\n \tcp $< $@\n \n config-list.h: generate-configlist.sh\n+\t@mkdir -p .depend\n+\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n \n-config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n-\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n+-include .depend/config-list.h.d\n \n command-list.h: generate-cmdlist.sh command-list.txt\n \ndiff --git a/generate-configlist.sh b/generate-configlist.sh\nindex 75c39ade20..39ac8845ab 100755\n--- a/generate-configlist.sh\n+++ b/generate-configlist.sh\n@@ -2,10 +2,11 @@\n \n SOURCE_DIR=\"$1\"\n OUTPUT=\"$2\"\n+DEPFILE=\"$3\"\n \n if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n then\n-\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n+\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT> [<DEPFILE>]\"\n \texit 1\n fi\n \n@@ -36,3 +37,11 @@ print_config_list () {\n \techo\n \tprint_config_list\n } >\"$OUTPUT\"\n+\n+if test -n \"$DEPFILE\"\n+then\n+\tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n+\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n+\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n+\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n+fi\ndiff --git a/meson.build b/meson.build\nindex 762e2d0fc0..74b459b004 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -720,11 +720,14 @@ endif\n \n builtin_sources += custom_target(\n   output: 'config-list.h',\n+  depfile: 'config-list.h.d',\n+  depend_files: [ 'generate-configlist.sh' ],\n   command: [\n     shell,\n-    meson.current_source_dir() + '/generate-configlist.sh',\n+    meson.current_source_dir() / 'generate-configlist.sh',\n     meson.current_source_dir(),\n     '@OUTPUT@',\n+    '@DEPFILE@',\n   ],\n   env: script_environment,\n )\n\nDiff-intervalle contre v5 :\n1:  611a94cd98 ! 1:  5dcd4e9308 build: regenerate config-list.h when Documentation changes\n    @@ Commit message\n         it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n         from sources fixes the artifact and the test.\n     \n    -    Teach the meson build to depend on the Documentation files that\n    -    generate-configlist.sh reads by having it an additional output as a list\n    -    of dependency files, since Meson does not have (or want) builtin support\n    -    for globbing like Make. We assume that if a user adds a new file under\n    +    Since Meson does not have (or want) builtin support for globbing like\n    +    Make, teach generate-configlist.sh to also generate a list of\n    +    Documentation files its output depends on, and incorporate that into the\n    +    Meson build.\n    +\n    +    We assume that if a user adds a new file under\n         Documentation/config then they will also edit one of the existing files\n         to include that new file, and that will trigger a rebuild. Also mark the\n         generator script as a dependency.\n    @@ Commit message\n     \n     \n      ## Notes (benknoble/commits) ##\n    -    Changes from v4 (<9cdcc9de04f0f8fff657f0474b31c063466ed808.1771280837.git.ben.knoble+github@gmail.com>):\n    +    Changes from v5 (<611a94cd988e3795bc63dba2f1b270aa0d058bd2.1771425395.git.ben.knoble+github@gmail.com>):\n     \n    -    • Include Patrick's suggested Makefile changes. Note there's no quiet\n    -      equivalent for mdkir that isn't for the current target's containing\n    -      directory…\n    -    • Make depfile output efficient again, thanks to Phillip.\n    -\n    -    I've kept printf instead of echo (from Patrick/Junio) because I think it\n    -    is easier to reason about (\"it works\" vs. \"did I use this in a way that\n    -    might cause problems\").\n    -\n    -    Junio asked about other problematic bytes: the other one I could think\n    -    of (since all the inputs should be paths, anyway) is newlines. I gave\n    -    meson's depfile.py a glance [1], and it looks like they don't handle\n    -    newlines in paths. Other whitespace doesn't appear to be an issue (see\n    -    \"elif c in {' ', '\\n'}\"); I think _most_ characters are just added to\n    -    the filename.\n    -\n    -    [1]: https://github.com/mesonbuild/meson/blob/master/mesonbuild/depfile.py\n    +    • Reword a confusing sentence in the commit message\n     \n      ## Makefile ##\n     @@ Makefile: $(BUILT_INS): git$X\n\nbase-commit: 4a7958ca1415077ce9b1d0a38223ede55da779d9\n-- \n2.53.0\n\n"},{"id":"536691","messageId":"aZv1qIBz9khlxSGC@pks.im","threadId":"64940","inReplyTo":"5dcd4e9308100a25603c50fecb36447c0ee4df62.1771682788.git.ben.knoble+github@gmail.com","subject":"Re: [PATCH v6] build: regenerate config-list.h when Documentation changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-23T06:37:28Z","receivedAt":"2026-02-23T06:37:35Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Sat, Feb 21, 2026 at 09:07:17AM -0500, D. Ben Knoble wrote:\n> Notes (benknoble/commits):\n>     Changes from v5 (<611a94cd988e3795bc63dba2f1b270aa0d058bd2.1771425395.git.ben.knoble+github@gmail.com>):\n>     \n>     • Reword a confusing sentence in the commit message\n\nThanks, this version looks ready to me.\n\nPatrick\n"},{"id":"536692","messageId":"aZv54vN9DdGsvre/@szeder.dev","threadId":"64940","inReplyTo":"5dcd4e9308100a25603c50fecb36447c0ee4df62.1771682788.git.ben.knoble+github@gmail.com","subject":"Re: [PATCH v6] build: regenerate config-list.h when Documentation changes","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2026-02-23T06:55:30Z","receivedAt":"2026-02-23T06:55:43Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sat, Feb 21, 2026 at 09:07:17AM -0500, D. Ben Knoble wrote:\n> The Meson-based build doesn't know when to rebuild config-list.h, so the\n> header is sometimes stale.\n> \n> For example, an old build directory might have config-list.h from before\n> 4173df5187 (submodule: introduce extensions.submodulePathConfig,\n> 2026-01-12), which added submodule.<name>.gitdir to the list. Without\n> it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n> from sources fixes the artifact and the test.\n> \n> Since Meson does not have (or want) builtin support for globbing like\n> Make, teach generate-configlist.sh to also generate a list of\n> Documentation files its output depends on, and incorporate that into the\n> Meson build.\n> \n> We assume that if a user adds a new file under\n> Documentation/config then they will also edit one of the existing files\n> to include that new file, and that will trigger a rebuild. Also mark the\n> generator script as a dependency.\n> \n> While we're at it, teach the Makefile to use the same \"the script knows\n> it's dependencies\" logic.\n> \n> For Meson, combining the following commands helps debug dependencies:\n> \n>     ninja -C <builddir> -t deps config-list.h\n>     ninja -C <builddir> -t browse config-list.h\n> \n> The former lists all the dependencies discovered from our output \".d\"\n> file (the config documentation) and the latter shows the dependency on\n> the script itself, among other useful edges in the dependency graph.\n> \n> Helped-by: Patrick Steinhardt <ps@pks.im>\n> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n> ---\n> \n> Notes (benknoble/commits):\n>     Changes from v5 (<611a94cd988e3795bc63dba2f1b270aa0d058bd2.1771425395.git.ben.knoble+github@gmail.com>):\n>     \n>     • Reword a confusing sentence in the commit message\n> \n>  Makefile               |  5 +++--\n>  generate-configlist.sh | 11 ++++++++++-\n>  meson.build            |  5 ++++-\n>  3 files changed, 17 insertions(+), 4 deletions(-)\n> \n> diff --git a/Makefile b/Makefile\n> index 7f37ad8f58..6f926ffb1f 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2688,9 +2688,10 @@ $(BUILT_INS): git$X\n>  \tcp $< $@\n>  \n>  config-list.h: generate-configlist.sh\n> +\t@mkdir -p .depend\n> +\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n>  \n> -config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n> -\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n> +-include .depend/config-list.h.d\n\nThis breaks the build when something disappears from\nDocumentation/config/:\n\n  $ git checkout origin/seen\n  HEAD is now at 57edfa3ce8 Merge branch 'ty/setup-error-tightening' into seen\n  $ ls -l Documentation/config/hook.adoc \n  -rw-rw-r-- 1 szeder szeder 3828 Feb 23 07:50 Documentation/config/hook.adoc\n  $ git grep hook.adoc\n  Documentation/git-hook.adoc:include::config/hook.adoc[]\n  Documentation/howto/meson.build:  'rebuild-from-update-hook.adoc',\n  Documentation/meson.build:  'git-hook.adoc' : 1,\n  $ make V=1 config-list.h\n  /bin/sh ./generate-configlist.sh . config-list.h .depend/config-list.h.d\n  $ git checkout 0aabf70f60\n  Previous HEAD position was 57edfa3ce8 Merge branch 'ty/setup-error-tightening' into seen\n  HEAD is now at 0aabf70f60 build: regenerate config-list.h when Documentation changes\n  $ ls -l Documentation/config/hook.adoc \n  ls: cannot access 'Documentation/config/hook.adoc': No such file or directory\n  $ git grep hook.adoc\n  Documentation/howto/meson.build:  'rebuild-from-update-hook.adoc',\n  Documentation/meson.build:  'git-hook.adoc' : 1,\n  $ make V=1 config-list.h\n  GIT_VERSION=2.53.0.119.g0aabf70f60\n  make: *** No rule to make target 'Documentation/config/hook.adoc', needed by 'config-list.h'.  Stop.\n  $ grep hook.adoc .depend/config-list.h.d \n  config-list.h: ./Documentation/config/hook.adoc\n\n\n>  command-list.h: generate-cmdlist.sh command-list.txt\n>  \n> diff --git a/generate-configlist.sh b/generate-configlist.sh\n> index 75c39ade20..39ac8845ab 100755\n> --- a/generate-configlist.sh\n> +++ b/generate-configlist.sh\n> @@ -2,10 +2,11 @@\n>  \n>  SOURCE_DIR=\"$1\"\n>  OUTPUT=\"$2\"\n> +DEPFILE=\"$3\"\n>  \n>  if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n>  then\n> -\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n> +\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT> [<DEPFILE>]\"\n>  \texit 1\n>  fi\n>  \n> @@ -36,3 +37,11 @@ print_config_list () {\n>  \techo\n>  \tprint_config_list\n>  } >\"$OUTPUT\"\n> +\n> +if test -n \"$DEPFILE\"\n> +then\n> +\tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n> +\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> +\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> +\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n> +fi\n> diff --git a/meson.build b/meson.build\n> index 762e2d0fc0..74b459b004 100644\n> --- a/meson.build\n> +++ b/meson.build\n> @@ -720,11 +720,14 @@ endif\n>  \n>  builtin_sources += custom_target(\n>    output: 'config-list.h',\n> +  depfile: 'config-list.h.d',\n> +  depend_files: [ 'generate-configlist.sh' ],\n>    command: [\n>      shell,\n> -    meson.current_source_dir() + '/generate-configlist.sh',\n> +    meson.current_source_dir() / 'generate-configlist.sh',\n>      meson.current_source_dir(),\n>      '@OUTPUT@',\n> +    '@DEPFILE@',\n>    ],\n>    env: script_environment,\n>  )\n> \n> Diff-intervalle contre v5 :\n> 1:  611a94cd98 ! 1:  5dcd4e9308 build: regenerate config-list.h when Documentation changes\n>     @@ Commit message\n>          it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n>          from sources fixes the artifact and the test.\n>      \n>     -    Teach the meson build to depend on the Documentation files that\n>     -    generate-configlist.sh reads by having it an additional output as a list\n>     -    of dependency files, since Meson does not have (or want) builtin support\n>     -    for globbing like Make. We assume that if a user adds a new file under\n>     +    Since Meson does not have (or want) builtin support for globbing like\n>     +    Make, teach generate-configlist.sh to also generate a list of\n>     +    Documentation files its output depends on, and incorporate that into the\n>     +    Meson build.\n>     +\n>     +    We assume that if a user adds a new file under\n>          Documentation/config then they will also edit one of the existing files\n>          to include that new file, and that will trigger a rebuild. Also mark the\n>          generator script as a dependency.\n>     @@ Commit message\n>      \n>      \n>       ## Notes (benknoble/commits) ##\n>     -    Changes from v4 (<9cdcc9de04f0f8fff657f0474b31c063466ed808.1771280837.git.ben.knoble+github@gmail.com>):\n>     +    Changes from v5 (<611a94cd988e3795bc63dba2f1b270aa0d058bd2.1771425395.git.ben.knoble+github@gmail.com>):\n>      \n>     -    • Include Patrick's suggested Makefile changes. Note there's no quiet\n>     -      equivalent for mdkir that isn't for the current target's containing\n>     -      directory…\n>     -    • Make depfile output efficient again, thanks to Phillip.\n>     -\n>     -    I've kept printf instead of echo (from Patrick/Junio) because I think it\n>     -    is easier to reason about (\"it works\" vs. \"did I use this in a way that\n>     -    might cause problems\").\n>     -\n>     -    Junio asked about other problematic bytes: the other one I could think\n>     -    of (since all the inputs should be paths, anyway) is newlines. I gave\n>     -    meson's depfile.py a glance [1], and it looks like they don't handle\n>     -    newlines in paths. Other whitespace doesn't appear to be an issue (see\n>     -    \"elif c in {' ', '\\n'}\"); I think _most_ characters are just added to\n>     -    the filename.\n>     -\n>     -    [1]: https://github.com/mesonbuild/meson/blob/master/mesonbuild/depfile.py\n>     +    • Reword a confusing sentence in the commit message\n>      \n>       ## Makefile ##\n>      @@ Makefile: $(BUILT_INS): git$X\n> \n> base-commit: 4a7958ca1415077ce9b1d0a38223ede55da779d9\n> -- \n> 2.53.0\n> \n"},{"id":"536886","messageId":"8AB2DD1B-FAFA-4510-82FA-BBD76B442676@gmail.com","threadId":"64940","inReplyTo":"aZv54vN9DdGsvre/@szeder.dev","subject":"Re: [PATCH v6] build: regenerate config-list.h when Documentation changes","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2026-02-23T21:41:48Z","receivedAt":"2026-02-23T21:42:00Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"\n> Le 23 févr. 2026 à 01:55, SZEDER Gábor <szeder.dev@gmail.com> a écrit :\n> \n> ﻿On Sat, Feb 21, 2026 at 09:07:17AM -0500, D. Ben Knoble wrote:\n>> The Meson-based build doesn't know when to rebuild config-list.h, so the\n>> header is sometimes stale.\n>> \n>> For example, an old build directory might have config-list.h from before\n>> 4173df5187 (submodule: introduce extensions.submodulePathConfig,\n>> 2026-01-12), which added submodule.<name>.gitdir to the list. Without\n>> it, t9902-completion.sh fails. Regenerating the config-list.h artifact\n>> from sources fixes the artifact and the test.\n>> \n>> Since Meson does not have (or want) builtin support for globbing like\n>> Make, teach generate-configlist.sh to also generate a list of\n>> Documentation files its output depends on, and incorporate that into the\n>> Meson build.\n>> \n>> We assume that if a user adds a new file under\n>> Documentation/config then they will also edit one of the existing files\n>> to include that new file, and that will trigger a rebuild. Also mark the\n>> generator script as a dependency.\n>> \n>> While we're at it, teach the Makefile to use the same \"the script knows\n>> it's dependencies\" logic.\n>> \n>> For Meson, combining the following commands helps debug dependencies:\n>> \n>>    ninja -C <builddir> -t deps config-list.h\n>>    ninja -C <builddir> -t browse config-list.h\n>> \n>> The former lists all the dependencies discovered from our output \".d\"\n>> file (the config documentation) and the latter shows the dependency on\n>> the script itself, among other useful edges in the dependency graph.\n>> \n>> Helped-by: Patrick Steinhardt <ps@pks.im>\n>> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n>> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n>> ---\n>> \n>> Notes (benknoble/commits):\n>>    Changes from v5 (<611a94cd988e3795bc63dba2f1b270aa0d058bd2.1771425395.git.ben.knoble+github@gmail.com>):\n>> \n>>    • Reword a confusing sentence in the commit message\n>> \n>> Makefile               |  5 +++--\n>> generate-configlist.sh | 11 ++++++++++-\n>> meson.build            |  5 ++++-\n>> 3 files changed, 17 insertions(+), 4 deletions(-)\n>> \n>> diff --git a/Makefile b/Makefile\n>> index 7f37ad8f58..6f926ffb1f 100644\n>> --- a/Makefile\n>> +++ b/Makefile\n>> @@ -2688,9 +2688,10 @@ $(BUILT_INS): git$X\n>>    cp $< $@\n>> \n>> config-list.h: generate-configlist.sh\n>> +    @mkdir -p .depend\n>> +    $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n>> \n>> -config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n>> -    $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n>> +-include .depend/config-list.h.d\n> \n> This breaks the build when something disappears from\n> Documentation/config/:\n> \n>  $ git checkout origin/seen\n>  HEAD is now at 57edfa3ce8 Merge branch 'ty/setup-error-tightening' into seen\n>  $ ls -l Documentation/config/hook.adoc\n>  -rw-rw-r-- 1 szeder szeder 3828 Feb 23 07:50 Documentation/config/hook.adoc\n>  $ git grep hook.adoc\n>  Documentation/git-hook.adoc:include::config/hook.adoc[]\n>  Documentation/howto/meson.build:  'rebuild-from-update-hook.adoc',\n>  Documentation/meson.build:  'git-hook.adoc' : 1,\n>  $ make V=1 config-list.h\n>  /bin/sh ./generate-configlist.sh . config-list.h .depend/config-list.h.d\n>  $ git checkout 0aabf70f60\n>  Previous HEAD position was 57edfa3ce8 Merge branch 'ty/setup-error-tightening' into seen\n>  HEAD is now at 0aabf70f60 build: regenerate config-list.h when Documentation changes\n>  $ ls -l Documentation/config/hook.adoc\n>  ls: cannot access 'Documentation/config/hook.adoc': No such file or directory\n>  $ git grep hook.adoc\n>  Documentation/howto/meson.build:  'rebuild-from-update-hook.adoc',\n>  Documentation/meson.build:  'git-hook.adoc' : 1,\n>  $ make V=1 config-list.h\n>  GIT_VERSION=2.53.0.119.g0aabf70f60\n>  make: *** No rule to make target 'Documentation/config/hook.adoc', needed by 'config-list.h'.  Stop.\n>  $ grep hook.adoc .depend/config-list.h.d\n>  config-list.h: ./Documentation/config/hook.adoc\n\nIndeed. This might arise while bisecting, which was my original motivation. Thoughts on a path forward? At least this issue (to me) is clearer than a spurious test failure :)"},{"id":"536958","messageId":"aZ12Lk85bSajirCY@pks.im","threadId":"64940","inReplyTo":"8AB2DD1B-FAFA-4510-82FA-BBD76B442676@gmail.com","subject":"Re: [PATCH v6] build: regenerate config-list.h when Documentation changes","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-24T09:58:06Z","receivedAt":"2026-02-24T09:58:13Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Feb 23, 2026 at 04:41:48PM -0500, Ben Knoble wrote:\n> > Le 23 févr. 2026 à 01:55, SZEDER Gábor <szeder.dev@gmail.com> a écrit :\n> > ﻿On Sat, Feb 21, 2026 at 09:07:17AM -0500, D. Ben Knoble wrote:\n> >> diff --git a/Makefile b/Makefile\n> >> index 7f37ad8f58..6f926ffb1f 100644\n> >> --- a/Makefile\n> >> +++ b/Makefile\n> >> @@ -2688,9 +2688,10 @@ $(BUILT_INS): git$X\n> >>    cp $< $@\n> >> \n> >> config-list.h: generate-configlist.sh\n> >> +    @mkdir -p .depend\n> >> +    $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n> >> \n> >> -config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n> >> -    $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n> >> +-include .depend/config-list.h.d\n> > \n> > This breaks the build when something disappears from\n> > Documentation/config/:\n> > \n> >  $ git checkout origin/seen\n> >  HEAD is now at 57edfa3ce8 Merge branch 'ty/setup-error-tightening' into seen\n> >  $ ls -l Documentation/config/hook.adoc\n> >  -rw-rw-r-- 1 szeder szeder 3828 Feb 23 07:50 Documentation/config/hook.adoc\n> >  $ git grep hook.adoc\n> >  Documentation/git-hook.adoc:include::config/hook.adoc[]\n> >  Documentation/howto/meson.build:  'rebuild-from-update-hook.adoc',\n> >  Documentation/meson.build:  'git-hook.adoc' : 1,\n> >  $ make V=1 config-list.h\n> >  /bin/sh ./generate-configlist.sh . config-list.h .depend/config-list.h.d\n> >  $ git checkout 0aabf70f60\n> >  Previous HEAD position was 57edfa3ce8 Merge branch 'ty/setup-error-tightening' into seen\n> >  HEAD is now at 0aabf70f60 build: regenerate config-list.h when Documentation changes\n> >  $ ls -l Documentation/config/hook.adoc\n> >  ls: cannot access 'Documentation/config/hook.adoc': No such file or directory\n> >  $ git grep hook.adoc\n> >  Documentation/howto/meson.build:  'rebuild-from-update-hook.adoc',\n> >  Documentation/meson.build:  'git-hook.adoc' : 1,\n> >  $ make V=1 config-list.h\n> >  GIT_VERSION=2.53.0.119.g0aabf70f60\n> >  make: *** No rule to make target 'Documentation/config/hook.adoc', needed by 'config-list.h'.  Stop.\n> >  $ grep hook.adoc .depend/config-list.h.d\n> >  config-list.h: ./Documentation/config/hook.adoc\n> \n> Indeed. This might arise while bisecting, which was my original\n> motivation. Thoughts on a path forward? At least this issue (to me) is\n> clearer than a spurious test failure :)\n\nFor Meson this case works alright. So maybe we just drop the changes to\nthe Makefile and call it a day?\n\nAn alternative would be to have the following patch on top:\n\ndiff --git a/generate-configlist.sh b/generate-configlist.sh\nindex 39ac8845ab..e28054f9e0 100755\n--- a/generate-configlist.sh\n+++ b/generate-configlist.sh\n@@ -41,7 +41,12 @@ EOF\n if test -n \"$DEPFILE\"\n then\n \tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n-\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n-\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n-\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n+\t{\n+\t\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n+\t\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n+\t\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\"\n+\t\tprintf '%s:\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n+\t\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n+\t\t\tsed -e 's/[# ]/\\\\&/g'\n+\t} >\"$DEPFILE\"\n fi\n\nWhat it does is to also create an empty target for all of the\ndependencies. Which is in fact what GCC/Clang also do when you pass -MP:\n\n    $ cat main.c\n    #include \"foo.h\"\n    int main()\n    {\n        puts(\"foobar\");\n        return 0;\n    }\n\n    $ clang -MMD -MP main.c\n    $ cat main.d\n    main.o: main.c foo.h\n    foo.h:\n\nPatrick\n"},{"id":"536964","messageId":"39acbf7e-86f4-4dbe-8b58-3c04fccd7984@gmail.com","threadId":"64940","inReplyTo":"aZ12Lk85bSajirCY@pks.im","subject":"Re: [PATCH v6] build: regenerate config-list.h when Documentation changes","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-02-24T11:00:54Z","receivedAt":"2026-02-24T11:01:00Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"\n\nOn 24/02/2026 09:58, Patrick Steinhardt wrote:\n> On Mon, Feb 23, 2026 at 04:41:48PM -0500, Ben Knoble wrote:\n>>> Le 23 févr. 2026 à 01:55, SZEDER Gábor <szeder.dev@gmail.com> a écrit :\n>>> ﻿On Sat, Feb 21, 2026 at 09:07:17AM -0500, D. Ben Knoble wrote:\n>>>> diff --git a/Makefile b/Makefile\n>>>> index 7f37ad8f58..6f926ffb1f 100644\n>>>> --- a/Makefile\n>>>> +++ b/Makefile\n>>>> @@ -2688,9 +2688,10 @@ $(BUILT_INS): git$X\n>>>>     cp $< $@\n>>>>\n>>>> config-list.h: generate-configlist.sh\n>>>> +    @mkdir -p .depend\n>>>> +    $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n>>>>\n>>>> -config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n>>>> -    $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n>>>> +-include .depend/config-list.h.d\n>>>\n>>> This breaks the build when something disappears from\n>>> Documentation/config/:\n>>>\n>>>   $ git checkout origin/seen\n>>>   HEAD is now at 57edfa3ce8 Merge branch 'ty/setup-error-tightening' into seen\n>>>   $ ls -l Documentation/config/hook.adoc\n>>>   -rw-rw-r-- 1 szeder szeder 3828 Feb 23 07:50 Documentation/config/hook.adoc\n>>>   $ git grep hook.adoc\n>>>   Documentation/git-hook.adoc:include::config/hook.adoc[]\n>>>   Documentation/howto/meson.build:  'rebuild-from-update-hook.adoc',\n>>>   Documentation/meson.build:  'git-hook.adoc' : 1,\n>>>   $ make V=1 config-list.h\n>>>   /bin/sh ./generate-configlist.sh . config-list.h .depend/config-list.h.d\n>>>   $ git checkout 0aabf70f60\n>>>   Previous HEAD position was 57edfa3ce8 Merge branch 'ty/setup-error-tightening' into seen\n>>>   HEAD is now at 0aabf70f60 build: regenerate config-list.h when Documentation changes\n>>>   $ ls -l Documentation/config/hook.adoc\n>>>   ls: cannot access 'Documentation/config/hook.adoc': No such file or directory\n>>>   $ git grep hook.adoc\n>>>   Documentation/howto/meson.build:  'rebuild-from-update-hook.adoc',\n>>>   Documentation/meson.build:  'git-hook.adoc' : 1,\n>>>   $ make V=1 config-list.h\n>>>   GIT_VERSION=2.53.0.119.g0aabf70f60\n>>>   make: *** No rule to make target 'Documentation/config/hook.adoc', needed by 'config-list.h'.  Stop.\n>>>   $ grep hook.adoc .depend/config-list.h.d\n>>>   config-list.h: ./Documentation/config/hook.adoc\n>>\n>> Indeed. This might arise while bisecting, which was my original\n>> motivation. Thoughts on a path forward? At least this issue (to me) is\n>> clearer than a spurious test failure :)\n> \n> For Meson this case works alright. So maybe we just drop the changes to\n> the Makefile and call it a day?\n> \n> An alternative would be to have the following patch on top:\n> \n> diff --git a/generate-configlist.sh b/generate-configlist.sh\n> index 39ac8845ab..e28054f9e0 100755\n> --- a/generate-configlist.sh\n> +++ b/generate-configlist.sh\n> @@ -41,7 +41,12 @@ EOF\n>   if test -n \"$DEPFILE\"\n>   then\n>   \tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n> -\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> -\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> -\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n> +\t{\n> +\t\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> +\t\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> +\t\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\"\n> +\t\tprintf '%s:\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> +\t\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> +\t\t\tsed -e 's/[# ]/\\\\&/g'\n> +\t} >\"$DEPFILE\"\n>   fi\n> \n> What it does is to also create an empty target for all of the\n> dependencies. Which is in fact what GCC/Clang also do when you pass -MP:\n\nOh, I was wondering how they got around the problem we're seeing here. \nWhile it seems ninja is happy it ignore missing dependencies in \ndepfiles, are we sure the build systems meson uses on other platforms \nare as well? If not it might be worth adding this, rather than just \ndropping the Makefile changes.\n\nThanks\n\nPhillip\n\n> \n>      $ cat main.c\n>      #include \"foo.h\"\n>      int main()\n>      {\n>          puts(\"foobar\");\n>          return 0;\n>      }\n> \n>      $ clang -MMD -MP main.c\n>      $ cat main.d\n>      main.o: main.c foo.h\n>      foo.h:\n> \n> Patrick\n\n"},{"id":"536974","messageId":"CALnO6CBsj_2+pZG+bqbrE3tQH=6_kqdtCnNPm8MfJ2XZOA9e3Q@mail.gmail.com","threadId":"64940","inReplyTo":"39acbf7e-86f4-4dbe-8b58-3c04fccd7984@gmail.com","subject":"Re: [PATCH v6] build: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2026-02-24T14:12:57Z","receivedAt":"2026-02-24T14:13:09Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Tue, Feb 24, 2026 at 6:00 AM Phillip Wood <phillip.wood123@gmail.com> wrote:\n>\n>\n>\n> On 24/02/2026 09:58, Patrick Steinhardt wrote:\n> > On Mon, Feb 23, 2026 at 04:41:48PM -0500, Ben Knoble wrote:\n> >>> Le 23 févr. 2026 à 01:55, SZEDER Gábor <szeder.dev@gmail.com> a écrit :\n> >>> ﻿On Sat, Feb 21, 2026 at 09:07:17AM -0500, D. Ben Knoble wrote:\n> >>>> diff --git a/Makefile b/Makefile\n> >>>> index 7f37ad8f58..6f926ffb1f 100644\n> >>>> --- a/Makefile\n> >>>> +++ b/Makefile\n> >>>> @@ -2688,9 +2688,10 @@ $(BUILT_INS): git$X\n> >>>>     cp $< $@\n> >>>>\n> >>>> config-list.h: generate-configlist.sh\n> >>>> +    @mkdir -p .depend\n> >>>> +    $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n> >>>>\n> >>>> -config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n> >>>> -    $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n> >>>> +-include .depend/config-list.h.d\n> >>>\n> >>> This breaks the build when something disappears from\n> >>> Documentation/config/:\n> >>>\n> >>>   $ git checkout origin/seen\n> >>>   HEAD is now at 57edfa3ce8 Merge branch 'ty/setup-error-tightening' into seen\n> >>>   $ ls -l Documentation/config/hook.adoc\n> >>>   -rw-rw-r-- 1 szeder szeder 3828 Feb 23 07:50 Documentation/config/hook.adoc\n> >>>   $ git grep hook.adoc\n> >>>   Documentation/git-hook.adoc:include::config/hook.adoc[]\n> >>>   Documentation/howto/meson.build:  'rebuild-from-update-hook.adoc',\n> >>>   Documentation/meson.build:  'git-hook.adoc' : 1,\n> >>>   $ make V=1 config-list.h\n> >>>   /bin/sh ./generate-configlist.sh . config-list.h .depend/config-list.h.d\n> >>>   $ git checkout 0aabf70f60\n> >>>   Previous HEAD position was 57edfa3ce8 Merge branch 'ty/setup-error-tightening' into seen\n> >>>   HEAD is now at 0aabf70f60 build: regenerate config-list.h when Documentation changes\n> >>>   $ ls -l Documentation/config/hook.adoc\n> >>>   ls: cannot access 'Documentation/config/hook.adoc': No such file or directory\n> >>>   $ git grep hook.adoc\n> >>>   Documentation/howto/meson.build:  'rebuild-from-update-hook.adoc',\n> >>>   Documentation/meson.build:  'git-hook.adoc' : 1,\n> >>>   $ make V=1 config-list.h\n> >>>   GIT_VERSION=2.53.0.119.g0aabf70f60\n> >>>   make: *** No rule to make target 'Documentation/config/hook.adoc', needed by 'config-list.h'.  Stop.\n> >>>   $ grep hook.adoc .depend/config-list.h.d\n> >>>   config-list.h: ./Documentation/config/hook.adoc\n> >>\n> >> Indeed. This might arise while bisecting, which was my original\n> >> motivation. Thoughts on a path forward? At least this issue (to me) is\n> >> clearer than a spurious test failure :)\n> >\n> > For Meson this case works alright. So maybe we just drop the changes to\n> > the Makefile and call it a day?\n> >\n> > An alternative would be to have the following patch on top:\n> >\n> > diff --git a/generate-configlist.sh b/generate-configlist.sh\n> > index 39ac8845ab..e28054f9e0 100755\n> > --- a/generate-configlist.sh\n> > +++ b/generate-configlist.sh\n> > @@ -41,7 +41,12 @@ EOF\n> >   if test -n \"$DEPFILE\"\n> >   then\n> >       QUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n> > -     printf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> > -             \"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> > -             sed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n> > +     {\n> > +             printf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> > +                     \"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> > +                     sed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\"\n> > +             printf '%s:\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n> > +                     \"$SOURCE_DIR\"/Documentation/config/*.adoc |\n> > +                     sed -e 's/[# ]/\\\\&/g'\n> > +     } >\"$DEPFILE\"\n> >   fi\n> >\n> > What it does is to also create an empty target for all of the\n> > dependencies. Which is in fact what GCC/Clang also do when you pass -MP:\n>\n> Oh, I was wondering how they got around the problem we're seeing here.\n> While it seems ninja is happy it ignore missing dependencies in\n> depfiles, are we sure the build systems meson uses on other platforms\n> are as well? If not it might be worth adding this, rather than just\n> dropping the Makefile changes.\n>\n> Thanks\n>\n> Phillip\n>\n> >\n> >      $ cat main.c\n> >      #include \"foo.h\"\n> >      int main()\n> >      {\n> >          puts(\"foobar\");\n> >          return 0;\n> >      }\n> >\n> >      $ clang -MMD -MP main.c\n> >      $ cat main.d\n> >      main.o: main.c foo.h\n> >      foo.h:\n> >\n> > Patrick\n\nYep, I agree with Phillip: I have a feeling Meson intends folks to\nproduce output like GCC/Clang do, so let's honor that (even if it's\nnot well-documented IMO). Will add.\n\n-- \nD. Ben Knoble\n"},{"id":"536976","messageId":"4ef96c6bbf698a08df1df87b7cb053b6d0d00822.1771943954.git.ben.knoble+github@gmail.com","threadId":"64940","inReplyTo":"5dcd4e9308100a25603c50fecb36447c0ee4df62.1771682788.git.ben.knoble+github@gmail.com","subject":"[PATCH v7] build: regenerate config-list.h when Documentation changes","fromName":"D. Ben Knoble","fromEmail":"ben.knoble+github@gmail.com","sentAt":"2026-02-24T14:39:44Z","receivedAt":"2026-02-24T14:40:22Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"The Meson-based build doesn't know when to rebuild config-list.h, so the\nheader is sometimes stale.\n\nFor example, an old build directory might have config-list.h from before\n4173df5187 (submodule: introduce extensions.submodulePathConfig,\n2026-01-12), which added submodule.<name>.gitdir to the list. Without\nit, t9902-completion.sh fails. Regenerating the config-list.h artifact\nfrom sources fixes the artifact and the test.\n\nSince Meson does not have (or want) builtin support for globbing like\nMake, teach generate-configlist.sh to also generate a list of\nDocumentation files its output depends on, and incorporate that into the\nMeson build. We honor the undocumented GCC/Clang contract of outputting\nempty targets for all the dependencies (like they do with -MP). That is,\ngenerate lines like\n\n    build/config-list.h: $SOURCE_DIR/Documentation/config.adoc\n    $SOURCE_DIR/Documentation/config.adoc:\n\nWe assume that if a user adds a new file under\nDocumentation/config then they will also edit one of the existing files\nto include that new file, and that will trigger a rebuild. Also mark the\ngenerator script as a dependency.\n\nWhile we're at it, teach the Makefile to use the same \"the script knows\nit's dependencies\" logic.\n\nFor Meson, combining the following commands helps debug dependencies:\n\n    ninja -C <builddir> -t deps config-list.h\n    ninja -C <builddir> -t browse config-list.h\n\nThe former lists all the dependencies discovered from our output \".d\"\nfile (the config documentation) and the latter shows the dependency on\nthe script itself, among other useful edges in the dependency graph.\n\nHelped-by: Patrick Steinhardt <ps@pks.im>\nHelped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\nSigned-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n---\n\nNotes (benknoble/commits):\n    Changes from v6 (<5dcd4e9308100a25603c50fecb36447c0ee4df62.1771682788.git.ben.knoble+github@gmail.com>):\n    \n    • Fix Make-based builds when a dependency is removed by generating the\n      expected empty targets. (Thanks to a report from Szeder Gábor.)\n\n Makefile               |  5 +++--\n generate-configlist.sh | 16 +++++++++++++++-\n meson.build            |  5 ++++-\n 3 files changed, 22 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 7f37ad8f58..6f926ffb1f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2688,9 +2688,10 @@ $(BUILT_INS): git$X\n \tcp $< $@\n \n config-list.h: generate-configlist.sh\n+\t@mkdir -p .depend\n+\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@ .depend/config-list.h.d\n \n-config-list.h: Documentation/*config.adoc Documentation/config/*.adoc\n-\t$(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh . $@\n+-include .depend/config-list.h.d\n \n command-list.h: generate-cmdlist.sh command-list.txt\n \ndiff --git a/generate-configlist.sh b/generate-configlist.sh\nindex 75c39ade20..e28054f9e0 100755\n--- a/generate-configlist.sh\n+++ b/generate-configlist.sh\n@@ -2,10 +2,11 @@\n \n SOURCE_DIR=\"$1\"\n OUTPUT=\"$2\"\n+DEPFILE=\"$3\"\n \n if test -z \"$SOURCE_DIR\" || ! test -d \"$SOURCE_DIR\" || test -z \"$OUTPUT\"\n then\n-\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT>\"\n+\techo >&2 \"USAGE: $0 <SOURCE_DIR> <OUTPUT> [<DEPFILE>]\"\n \texit 1\n fi\n \n@@ -36,3 +37,16 @@ print_config_list () {\n \techo\n \tprint_config_list\n } >\"$OUTPUT\"\n+\n+if test -n \"$DEPFILE\"\n+then\n+\tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n+\t{\n+\t\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n+\t\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n+\t\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\"\n+\t\tprintf '%s:\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n+\t\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n+\t\t\tsed -e 's/[# ]/\\\\&/g'\n+\t} >\"$DEPFILE\"\n+fi\ndiff --git a/meson.build b/meson.build\nindex 6f155beafa..4b536e0124 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -722,11 +722,14 @@ endif\n \n builtin_sources += custom_target(\n   output: 'config-list.h',\n+  depfile: 'config-list.h.d',\n+  depend_files: [ 'generate-configlist.sh' ],\n   command: [\n     shell,\n-    meson.current_source_dir() + '/generate-configlist.sh',\n+    meson.current_source_dir() / 'generate-configlist.sh',\n     meson.current_source_dir(),\n     '@OUTPUT@',\n+    '@DEPFILE@',\n   ],\n   env: script_environment,\n )\n\nDiff-intervalle contre v6 :\n1:  7ffbde5f8a ! 1:  4ef96c6bbf build: regenerate config-list.h when Documentation changes\n    @@ Commit message\n         Since Meson does not have (or want) builtin support for globbing like\n         Make, teach generate-configlist.sh to also generate a list of\n         Documentation files its output depends on, and incorporate that into the\n    -    Meson build.\n    +    Meson build. We honor the undocumented GCC/Clang contract of outputting\n    +    empty targets for all the dependencies (like they do with -MP). That is,\n    +    generate lines like\n    +\n    +        build/config-list.h: $SOURCE_DIR/Documentation/config.adoc\n    +        $SOURCE_DIR/Documentation/config.adoc:\n     \n         We assume that if a user adds a new file under\n         Documentation/config then they will also edit one of the existing files\n    @@ Commit message\n     \n     \n      ## Notes (benknoble/commits) ##\n    -    Changes from v5 (<611a94cd988e3795bc63dba2f1b270aa0d058bd2.1771425395.git.ben.knoble+github@gmail.com>):\n    +    Changes from v6 (<5dcd4e9308100a25603c50fecb36447c0ee4df62.1771682788.git.ben.knoble+github@gmail.com>):\n     \n    -    • Reword a confusing sentence in the commit message\n    +    • Fix Make-based builds when a dependency is removed by generating the\n    +      expected empty targets. (Thanks to a report from Szeder Gábor.)\n     \n      ## Makefile ##\n     @@ Makefile: $(BUILT_INS): git$X\n    @@ generate-configlist.sh: print_config_list () {\n     +if test -n \"$DEPFILE\"\n     +then\n     +\tQUOTED_OUTPUT=\"$(printf '%s\\n' \"$OUTPUT\" | sed 's,[&/\\],\\\\&,g')\"\n    -+\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n    -+\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n    -+\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\" >\"$DEPFILE\"\n    ++\t{\n    ++\t\tprintf '%s\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n    ++\t\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n    ++\t\t\tsed -e 's/[# ]/\\\\&/g' -e \"s/^/$QUOTED_OUTPUT: /\"\n    ++\t\tprintf '%s:\\n' \"$SOURCE_DIR\"/Documentation/*config.adoc \\\n    ++\t\t\t\"$SOURCE_DIR\"/Documentation/config/*.adoc |\n    ++\t\t\tsed -e 's/[# ]/\\\\&/g'\n    ++\t} >\"$DEPFILE\"\n     +fi\n     \n      ## meson.build ##\n\nbase-commit: 309c995771be952610fdcff99f7fea96934ce045\n-- \n2.53.0.537.g7ffbde5f8a.dirty\n\n"},{"id":"537123","messageId":"xmqqv7fkachw.fsf@gitster.g","threadId":"64940","inReplyTo":"4ef96c6bbf698a08df1df87b7cb053b6d0d00822.1771943954.git.ben.knoble+github@gmail.com","subject":"Re: [PATCH v7] build: regenerate config-list.h when Documentation changes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-25T18:45:15Z","receivedAt":"2026-02-25T18:45:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"D. Ben Knoble\" <ben.knoble+github@gmail.com> writes:\n\n> The Meson-based build doesn't know when to rebuild config-list.h, so the\n> header is sometimes stale.\n> ...\n> Helped-by: Patrick Steinhardt <ps@pks.im>\n> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n> ---\n>\n> Notes (benknoble/commits):\n>     Changes from v6 (<5dcd4e9308100a25603c50fecb36447c0ee4df62.1771682788.git.ben.knoble+github@gmail.com>):\n>     \n>     • Fix Make-based builds when a dependency is removed by generating the\n>       expected empty targets. (Thanks to a report from Szeder Gábor.)\n\nOK, now we are pretty much completed and ready to merge it down to\n'next'?  Let me mark it as such.\n\nThanks.\n"},{"id":"537175","messageId":"046864AD-F37F-4DE5-B692-167B8B570DFC@gmail.com","threadId":"64940","inReplyTo":"xmqqv7fkachw.fsf@gitster.g","subject":"Re: [PATCH v7] build: regenerate config-list.h when Documentation changes","fromName":"Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2026-02-26T03:20:28Z","receivedAt":"2026-02-26T03:20:40Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"\n> Le 25 févr. 2026 à 13:45, Junio C Hamano <gitster@pobox.com> a écrit :\n> \n> ﻿\"D. Ben Knoble\" <ben.knoble+github@gmail.com> writes:\n> \n>> The Meson-based build doesn't know when to rebuild config-list.h, so the\n>> header is sometimes stale.\n>> ...\n>> Helped-by: Patrick Steinhardt <ps@pks.im>\n>> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n>> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n>> ---\n>> \n>> Notes (benknoble/commits):\n>>    Changes from v6 (<5dcd4e9308100a25603c50fecb36447c0ee4df62.1771682788.git.ben.knoble+github@gmail.com>):\n>> \n>>    • Fix Make-based builds when a dependency is removed by generating the\n>>      expected empty targets. (Thanks to a report from Szeder Gábor.)\n> \n> OK, now we are pretty much completed and ready to merge it down to\n> 'next'?  Let me mark it as such.\n> \n> Thanks.\n\nI certainly hope so. Thanks.\n\nFamily are in town and new kittens come home Saturday, so replies may come slowly. But of course I will be responsive to lingering issues uncovered. "}]}