diff --git a/CHANGELOG.md b/CHANGELOG.md index d6e446ef92..f2e4a99fb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - smarter log timestamps ([#682](https://github.com/extrawurst/gitui/issues/682)) - create-branch popup aligned with rename-branch [[@bruceCoelho](https://github.com/bruceCoelho)] ([#679](https://github.com/extrawurst/gitui/issues/679)) - smart focus change after staging all files ([#706](https://github.com/extrawurst/gitui/issues/706)) +- do not allow to commit when `gpgsign` enabled ([#740](https://github.com/extrawurst/gitui/issues/740)) ## Fixed - selected-tab color broken in light theme [[@Cottser](https://github.com/Cottser)] ([#719](https://github.com/extrawurst/gitui/issues/719)) diff --git a/src/components/commit.rs b/src/components/commit.rs index afb7d68128..c89d9c28d2 100644 --- a/src/components/commit.rs +++ b/src/components/commit.rs @@ -6,7 +6,7 @@ use super::{ use crate::{ keys::SharedKeyConfig, queue::{InternalEvent, NeedsUpdate, Queue}, - strings, + strings, try_or_popup, ui::style::SharedTheme, }; use anyhow::Result; @@ -106,7 +106,11 @@ impl Component for CommitComponent { if let Event::Key(e) = ev { if e == self.key_config.enter && self.can_commit() { - self.commit()?; + try_or_popup!( + self, + "commit error:", + self.commit() + ); } else if e == self.key_config.commit_amend && self.can_amend() { @@ -293,6 +297,16 @@ impl CommitComponent { } fn commit(&mut self) -> Result<()> { + let gpgsign = get_config_string(CWD, "commit.gpgsign") + .ok() + .flatten() + .and_then(|path| path.parse::().ok()) + .unwrap_or_default(); + + if gpgsign { + anyhow::bail!("config commit.gpgsign=true detected.\ngpg signing not supported.\ndeactivate in your repo/gitconfig to be able to commit without signing."); + } + let msg = self.input.get_text().clone(); self.input.clear(); self.commit_with_msg(msg)