Skip to contentSkip to conversation

meson: wire up contrib/credential

PATCH In review M Hickford via GitGitGadget 2 participants 4 messages Feb 13, 2025 – Feb 14, 2025 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover meson: wire up contrib/credential

It would be neat to also run test t0303-credential-external with GIT_TEST_CREDENTIAL_HELPER=wincred but I couldn't figure out how to do this.

M Hickford (2):
meson: wire up credential-wincred
meson: wire up credential-libsecret

 contrib/credential/libsecret/meson.build            | 3 +++
 contrib/credential/meson.build                      | 6 ++++++
 contrib/credential/wincred/git-credential-wincred.c | 2 ++
 contrib/credential/wincred/meson.build              | 1 +
 contrib/meson.build                                 | 1 +
 meson_options.txt                                   | 4 ++++
 6 files changed, 17 insertions(+)
 create mode 100644 contrib/credential/libsecret/meson.build
 create mode 100644 contrib/credential/meson.build
 create mode 100644 contrib/credential/wincred/meson.build

base-commit: e2067b49ecaef9b7f51a17ce251f9207f72ef52d
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1859%2Fhickford%2Fmeson-credential-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1859/hickford/meson-credential-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1859

Signature · 1 line
gitgitgadget
#1 lore raw

PATCH 1/2 meson: wire up credential-wincred

From: M Hickford <[email protected]>

Fix an error when compiling with MSVC.

---
 contrib/credential/meson.build                      | 3 +++
 contrib/credential/wincred/git-credential-wincred.c | 2 ++
 contrib/credential/wincred/meson.build              | 1 +
 contrib/meson.build                                 | 1 +
 meson_options.txt                                   | 2 ++
 5 files changed, 9 insertions(+)
 create mode 100644 contrib/credential/meson.build
 create mode 100644 contrib/credential/wincred/meson.build
contrib/credential/meson.build new file +3 -0
new file mode 100644
index 00000000000..4017ae3fa88
@@ -0,0 +1,3 @@
+if get_option('credential_wincred')
+  subdir('wincred')
+endif
contrib/credential/wincred/git-credential-wincred.c +2 -0
index 4be0d58cd89..04145b51183 100644
@@ -12,7 +12,9 @@
 
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
 
+#ifndef _MSC_VER
 __attribute__((format (printf, 1, 2)))
+#endif
 static void die(const char *err, ...)
 {
 	char msg[4096];
contrib/credential/wincred/meson.build new file +1 -0
new file mode 100644
index 00000000000..8c59d47174e
@@ -0,0 +1 @@
+executable('git-credential-wincred', 'git-credential-wincred.c')
contrib/meson.build +1 -0
index d74b64a5181..c414c98d5a7 100644
@@ -1,3 +1,4 @@
 foreach feature : get_option('contrib')
   subdir(feature)
 endforeach
+subdir('credential')
meson_options.txt +2 -0
index 5c12e9055e6..7554528482a 100644
@@ -29,6 +29,8 @@ option('version', type: 'string', value: '',
 # Features supported by Git.
 option('contrib', type: 'array', value: [ 'completion' ], choices: [ 'completion', 'subtree' ],
   description: 'Contributed features to include.')
+option('credential_wincred', type: 'boolean', value: false,
+  description: 'Build helper git-credential-wincred. Requires Windows SDK.')
 option('curl', type: 'feature', value: 'enabled',
   description: 'Build helpers used to access remotes with the HTTP transport.')
 option('expat', type: 'feature', value: 'enabled',
Signature · 1 line
gitgitgadget
#2 lore raw

PATCH 2/2 meson: wire up credential-libsecret

In reply to M Hickford via GitGitGadget

From: M Hickford <[email protected]>

---
 contrib/credential/libsecret/meson.build | 3 +++
 contrib/credential/meson.build           | 3 +++
 meson_options.txt                        | 2 ++
 3 files changed, 8 insertions(+)
 create mode 100644 contrib/credential/libsecret/meson.build
contrib/credential/libsecret/meson.build new file +3 -0
new file mode 100644
index 00000000000..92349be0ee8
@@ -0,0 +1,3 @@
+glib = dependency('glib-2.0')
+libsecret = dependency('libsecret-1')
+executable('git-credential-libsecret', 'git-credential-libsecret.c', dependencies: [glib, libsecret])
contrib/credential/meson.build +3 -0
index 4017ae3fa88..bedc76b96f2 100644
@@ -1,3 +1,6 @@
 if get_option('credential_wincred')
   subdir('wincred')
 endif
+if get_option('credential_libsecret')
+  subdir('libsecret')
+endif
meson_options.txt +2 -0
index 7554528482a..69e386afc2a 100644
@@ -29,6 +29,8 @@ option('version', type: 'string', value: '',
 # Features supported by Git.
 option('contrib', type: 'array', value: [ 'completion' ], choices: [ 'completion', 'subtree' ],
   description: 'Contributed features to include.')
+option('credential_libsecret', type: 'boolean', value: false,
+  description: 'Build helper git-credential-libsecret. Requires GLib and libsecret.')
 option('credential_wincred', type: 'boolean', value: false,
   description: 'Build helper git-credential-wincred. Requires Windows SDK.')
 option('curl', type: 'feature', value: 'enabled',
Signature · 1 line
gitgitgadget
#3 lore raw
In reply to M Hickford via GitGitGadget
Quoted 2 lines · M Hickford via GitGitGadget

It would be neat to also run test t0303-credential-external with GIT_TEST_CREDENTIAL_HELPER=wincred but I couldn't figure out how to do this.

Thanks for working on this! I have a patch series sitting locally for a while that wires up all credential helpers and more, as well. It also wires up netrc and fixes its tests to allow out-of-tree testing, which doesn't work right now. What I don't have though is the patch for the wincred helper.

The patch series is currently still blocked on [1], which is why I have been holding back on it. Would you mind if I picked your patch to fix wincred, but we then wait with wiring up remaining credential helpers until my follow-up patch series is unblocked?

Meanwhile, I'd appreciate any feedback on [1] to help move it forward, if you have the time :)

Patrick

[1]: <[email protected]>