From 71b5d062b5130dffc5425ea400ee1e624fb4dd28 Mon Sep 17 00:00:00 2001 From: Igor Pitsyn Date: Wed, 4 Sep 2024 12:09:57 -0400 Subject: [PATCH 1/2] Make GPG Pass store path configurable by git config --- VERSION | 2 +- src/shared/Core/Constants.cs | 1 + src/shared/Core/CredentialStore.cs | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 27c7c7b9d..012037873 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.5.1.0 +2.5.101.0 diff --git a/src/shared/Core/Constants.cs b/src/shared/Core/Constants.cs index ac609adaa..210c991bc 100644 --- a/src/shared/Core/Constants.cs +++ b/src/shared/Core/Constants.cs @@ -162,6 +162,7 @@ public static class Credential public const string DevUseLegacyUiHelpers = "devUseLegacyUiHelpers"; public const string MsAuthUseDefaultAccount = "msauthUseDefaultAccount"; public const string GuiSoftwareRendering = "guiSoftwareRendering"; + public const string GpgPassStorePath = "gpgPassStorePath"; public const string OAuthAuthenticationModes = "oauthAuthModes"; public const string OAuthClientId = "oauthClientId"; diff --git a/src/shared/Core/CredentialStore.cs b/src/shared/Core/CredentialStore.cs index a0c1ed861..83f915d1e 100644 --- a/src/shared/Core/CredentialStore.cs +++ b/src/shared/Core/CredentialStore.cs @@ -276,7 +276,8 @@ private void ValidateGpgPass(out string storeRoot, out string execPath) // Check for a redirected pass store location if (!_context.Settings.TryGetSetting( GpgPassCredentialStore.PasswordStoreDirEnvar, - null, null, + Constants.GitConfiguration.Credential.SectionName, + Constants.GitConfiguration.Credential.GpgPassStorePath, out storeRoot)) { // Use default store root at ~/.password-store From 0b3d84627f028843db117a705889239840f23824 Mon Sep 17 00:00:00 2001 From: Igor Pitsyn Date: Mon, 9 Sep 2024 10:43:25 -0400 Subject: [PATCH 2/2] Changes according to PR review --- VERSION | 2 +- docs/configuration.md | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 012037873..27c7c7b9d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.5.101.0 +2.5.1.0 diff --git a/docs/configuration.md b/docs/configuration.md index f6993dfd8..a4fecf395 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -633,6 +633,24 @@ git config --global credential.dpapiStorePath D:\credentials --- +### credential.gpgPassStorePath + +Specify a custom directory to store GPG-encrypted [pass][pass]-compatible credential files +in when [`credential.credentialStore`][credential-credentialstore] is set to `gpg`. + +Defaults to the value `~/.password-store` or `%USERPROFILE%\.password-store`. + +#### Example + +```shell +git config --global credential.gpgPassStorePath /mnt/external-drive/.password-store +``` + +**Note:** Location of the password store used by [pass][pass] can be overridden by the +`PASSWORD_STORE_DIR` environment variable, see the [man page][pass-man] for details. + +--- + ### credential.msauthFlow Specify which authentication flow should be used when performing Microsoft @@ -1042,6 +1060,7 @@ Defaults to disabled. [provider-migrate]: migration.md#gcm_authority [cache-options]: https://git-scm.com/docs/git-credential-cache#_options [pass]: https://www.passwordstore.org/ +[pass-man]: https://git.zx2c4.com/password-store/about/ [trace2-normal-docs]: https://git-scm.com/docs/api-trace2#_the_normal_format_target [trace2-normal-env]: environment.md#GIT_TRACE2 [trace2-event-docs]: https://git-scm.com/docs/api-trace2#_the_event_format_target