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

[PATCH 2/3] meson: introduce build option for contrib

From
Patrick Steinhardt <ps@pks.im>
Date
Jan 17, 2025, 09:56 UTC
Message-ID
<20250117-b4-pks-build-subtree-v1-2-03c2ed6cc42e@pks.im>
In-Reply-To
<20250117-b4-pks-build-subtree-v1-0-03c2ed6cc42e@pks.im>

We unconditionally wire up building command completion present in the "contrib/" directory. This may or may not be what users want, and we don't provide a way to disable it.

Introduce a new "contrib" build option. This option is introduced as an array so that users can manually pick which exact features they want to include from the "contrib" directory. By default, we build and install shell completions, which is a commonly used feature and also the current default.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 contrib/meson.build | 4 +++-
 meson_options.txt   | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/contrib/meson.build b/contrib/meson.build
index a7b77b87c2..d74b64a518 100644
--- a/contrib/meson.build
+++ b/contrib/meson.build
@@ -1 +1,3 @@
-subdir('completion')
+foreach feature : get_option('contrib')
+  subdir(feature)
+endforeach
diff --git a/meson_options.txt b/meson_options.txt
index f50bb40cdf..4f02c92524 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -27,6 +27,8 @@ option('version', type: 'string', value: '',
   description: 'Version string reported by git-version(1) and other tools.')
 
 # Features supported by Git.
+option('contrib', type: 'array', value: [ 'completion' ], choices: [ 'completion', 'subtree' ],
+  description: 'Contributed features to include.')
 option('curl', type: 'feature', value: 'enabled',
   description: 'Build helpers used to access remotes with the HTTP transport.')
 option('expat', type: 'feature', value: 'enabled',
-- 
2.48.0.257.gd3603152ad.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 2 of 4 in “contrib/subtree: doc fixes and support for Meson”
  1. 0/3 contrib/subtree: doc fixes and support for MesonPatrick Steinhardt, Jan 17, 2025
  2. 2/3 meson: introduce build option for contribPatrick Steinhardt, Jan 17, 2025
  3. 1/3 contrib/subtree: fix building docsPatrick Steinhardt, Jan 17, 2025
  4. 3/3 meson: wire up the git-subtree(1) commandPatrick Steinhardt, Jan 17, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.