{"thread":{"id":"64954","subject":"[PATCH] meson: fix building mergetool docs","startedAt":"2026-02-09T10:08:59Z","lastAt":"2026-02-09T12:32:40Z","messageCount":2,"participants":["Phillip Wood","Patrick Steinhardt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"535513","messageId":"604c79018992dee019205741934508091cdd1e47.1770631599.git.phillip.wood@dunelm.org.uk","threadId":"64954","inReplyTo":null,"subject":"[PATCH] meson: fix building mergetool docs","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-02-09T10:08:43Z","receivedAt":"2026-02-09T10:08:59Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"From: Phillip Wood <phillip.wood@dunelm.org.uk>\n\nBuilding the documentation with meson when the build directory is\nnot an immediate subdirectory of the source directory prints the\nfollowing error\n\n[2/1349] Generating Documentation/mer... command (wrapped by meson to set env)\n../../Documentation/generate-mergetool-list.sh: line 15: ../git-mergetool--lib.sh: No such file or directory\n\nThe build does not fail because the failure is upstream of a pipe. Fix\nthe error by passing the correct source directory when meson runs\n\"generate-mergetool-list.sh\". As that script sets $MERGE_TOOLS_DIR\nwe do not need to set it in the environment when running the script.\n\nSigned-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n---\nWe should probably change the script so that error is not ignored\nas well. I also wonder if we should use something more exotic than\n\"build\" as the meson build directory in our CI though that wont make\nany difference if the script does not fail.\n\nBase-Commit: 3e0db84c88c57e70ac8be8c196dfa92c5d656fbc\nPublished-As: https://github.com/phillipwood/git/releases/tag/pw%2Fmeson-fix-mergetool-docs%2Fv1\nView-Changes-At: https://github.com/phillipwood/git/compare/3e0db84c8...604c79018\nFetch-It-Via: git fetch https://github.com/phillipwood/git pw/meson-fix-mergetool-docs/v1\n\n Documentation/meson.build | 5 +----\n 1 file changed, 1 insertion(+), 4 deletions(-)\n\ndiff --git a/Documentation/meson.build b/Documentation/meson.build\nindex f02dbc20cbc..d0e557c2078 100644\n--- a/Documentation/meson.build\n+++ b/Documentation/meson.build\n@@ -353,13 +353,10 @@ foreach mode : [ 'diff', 'merge' ]\n     command: [\n       shell,\n       '@INPUT@',\n-      '..',\n+      meson.project_source_root(),\n       mode,\n       '@OUTPUT@'\n     ],\n-    env: [\n-      'MERGE_TOOLS_DIR=' + meson.project_source_root() / 'mergetools',\n-    ],\n     input: 'generate-mergetool-list.sh',\n     output: 'mergetools-' + mode + '.adoc',\n   )\n-- \n2.52.0.362.g884e03848a9\n\n"},{"id":"535522","messageId":"aYnT4XdQQ2hBEsTQ@pks.im","threadId":"64954","inReplyTo":"604c79018992dee019205741934508091cdd1e47.1770631599.git.phillip.wood@dunelm.org.uk","subject":"Re: [PATCH] meson: fix building mergetool docs","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-02-09T12:32:33Z","receivedAt":"2026-02-09T12:32:40Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Feb 09, 2026 at 10:08:43AM +0000, Phillip Wood wrote:\n> From: Phillip Wood <phillip.wood@dunelm.org.uk>\n> \n> Building the documentation with meson when the build directory is\n> not an immediate subdirectory of the source directory prints the\n> following error\n> \n> [2/1349] Generating Documentation/mer... command (wrapped by meson to set env)\n> ../../Documentation/generate-mergetool-list.sh: line 15: ../git-mergetool--lib.sh: No such file or directory\n\nOh, good catch.\n\n> The build does not fail because the failure is upstream of a pipe. Fix\n> the error by passing the correct source directory when meson runs\n> \"generate-mergetool-list.sh\". As that script sets $MERGE_TOOLS_DIR\n> we do not need to set it in the environment when running the script.\n\nHuh.\n\n> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>\n> ---\n> We should probably change the script so that error is not ignored\n> as well. I also wonder if we should use something more exotic than\n> \"build\" as the meson build directory in our CI though that wont make\n> any difference if the script does not fail.\n\nWe probably could, I guess. And making the script more solid would\ndefinitely be a very good step regardless of whether or not we want to\nuse a more esoteric build directory.\n\n> diff --git a/Documentation/meson.build b/Documentation/meson.build\n> index f02dbc20cbc..d0e557c2078 100644\n> --- a/Documentation/meson.build\n> +++ b/Documentation/meson.build\n> @@ -353,13 +353,10 @@ foreach mode : [ 'diff', 'merge' ]\n>      command: [\n>        shell,\n>        '@INPUT@',\n> -      '..',\n> +      meson.project_source_root(),\n>        mode,\n>        '@OUTPUT@'\n>      ],\n\nMakes sense. I assume that this is the only change required to make\nout-of-source builds work?\n\n> -    env: [\n> -      'MERGE_TOOLS_DIR=' + meson.project_source_root() / 'mergetools',\n> -    ],\n\nHm. We indeed set this environment variable in the script itself. I was\na bit puzzled at first because we don't export it, and it's not used\ndirectly. But we source \"git-mergetool--lib.sh\", which in turn uses the\nvariable, so it shouldn't be needed to export it.\n\nSo this looks like a nice simplification to me, thanks!\n\nPatrick\n"}]}