jesseduffield / jesseduffield/lazygit

Allow gpgsigning of commits retroactively

Open
#2,783 2 comments 10 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Is your feature request related to a problem? Please describe.**
I want to sign commits with my gpg key, that is protected with a passphrase. Besides the cache of my gpg-agent, I need to enter my password with each commit if I enable signing by default.
If I disable it by default, my pushed commits will be unsigned, as I don't have an option to just sign a commit from lazygit.

I'd like to just make unsigned commits, then squash them together before pushing, sign the resulting commit, and then push this signed commit.

**Describe the solution you'd like**
Be able to select a commit, press `S` (or some other hotkey) and have it signed. This way I can commit all I want, then squash and only sign the final commit that would be pushed. This could be implemented by adding the custom command I've formulated into the default ones.

**Describe alternatives you've considered**
As a workaround to the option missing from lazygit, I am using the following custom command to sign the commit retroactively:
`git commit --ammend --gpg-sign`
I do this by opening the custom command panel with `:` and then selecting my command / typing it in.

As I made this issue, I was made aware of the custom command feature. I've formulated this simple custom command that does what I need.

**Additional context**
A custom command that does what I want. Note that this will only sign the last commit, as I haven't found a way to sign the selected commit retroactively.

```yml
customCommands:
- key: ''
context: 'commits'
command: 'git commit --amend --gpg-sign --no-edit --signoff'
description: "sign last commit with your GPG key."
loadingText: 'waiting for gpg to sign your commit'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.