gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Support GPG for commit signing

Open krlvi opened this issue 1 year ago • 1 comments

krlvi avatar Feb 21 '24 21:02 krlvi

This is probably not terribly difficult, but unlike the SSH signing, we'll have to fork/exec out almost certainly. I don't think we'll be able to reliably get GPG to work on Windows in Rust. Every other implementation I know just calls a gpg binary externally, including core git.

The signed commit method is here, but it's taking an SSH key directly to use for signing, so that would have to change, or maybe another option to try gpg, dunno:

https://github.com/gitbutlerapp/gitbutler/blob/624df6243002ae4266c50f61b1e72daa44600e2b/gitbutler-app/src/git/repository.rs#L268-L295

That is called here:

https://github.com/gitbutlerapp/gitbutler/blob/624df6243002ae4266c50f61b1e72daa44600e2b/gitbutler-app/src/project_repository/repository.rs#L242-L260

Only if the private key is provided. We would need some way of tracking if they want to use gpg for signing and probably optionally where the binary is located.

Anyhow, a starting point for anyone interested. I'm not sure we'll tackle this internally soon, but it's probably not super difficult if someone cares a lot.

schacon avatar Feb 22 '24 13:02 schacon

this is now implemented

krlvi avatar Jul 01 '24 11:07 krlvi