diff --git a/cli/src/config-schema.json b/cli/src/config-schema.json index 7b4658e42..95e244aaf 100644 --- a/cli/src/config-schema.json +++ b/cli/src/config-schema.json @@ -473,7 +473,8 @@ "backend": { "type": "string", "enum": ["gpg", "ssh"], - "description": "The backend to use for signing commits" + "description": "The backend to use for signing commits. The string `none` disables signing.", + "default": "none" }, "key": { "type": "string", diff --git a/docs/config.md b/docs/config.md index 33f9c4062..82487f1ae 100644 --- a/docs/config.md +++ b/docs/config.md @@ -776,6 +776,8 @@ GnuPG or SSH signing keys. To do this you need to configure a signing backend. +Setting the backend to `"none"` disables signing. + ### GnuPG Signing ```toml diff --git a/lib/src/settings.rs b/lib/src/settings.rs index 58e074884..64e33be26 100644 --- a/lib/src/settings.rs +++ b/lib/src/settings.rs @@ -245,7 +245,8 @@ impl UserSettings { // separate from sign_settings as those two are needed in pretty different // places pub fn signing_backend(&self) -> Option { - self.config.get_string("signing.backend").ok() + let backend = self.config.get_string("signing.backend").ok()?; + (backend.as_str() != "none").then_some(backend) } pub fn sign_settings(&self) -> SignSettings {