lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

feature: Enable discard of previous commit files when signed with GPG

Open lkuoch opened this issue 3 years ago • 7 comments

As someone who signs all their commits with GPG one thing I find super frustrating is when I want to discard some changes to a specific file on a commit that happened a while back in history.

The current behaviour is the error message Feature not available for users using GPG appears.

image

I'm not sure how complex this would be but if it's low priority would you be able to list the high level steps necessary and I could take a stab.

Thanks for your amazing work!

lkuoch avatar Nov 24 '21 05:11 lkuoch

I was also wondering the same thing, as I too sign all my commits by default and am missing the mentioned functionality. Judging by the comment in https://github.com/jesseduffield/lazygit/blob/master/pkg/commands/rebasing.go#L213-L215, this is simply missing a preliminary step to allow for a pinentry. Even a simple override over this error would be enough for users with cached credentials or keychain integrations.

oliverguenther avatar Dec 05 '21 20:12 oliverguenther

Since I build lazygit from source, if anyone is using a key store / caching and is interested in patching away this restriction, it appears to work without issue. Here's the patch: remove-disabled-for-gpg.txt

oliverguenther avatar May 18 '22 12:05 oliverguenther

@oliverguenther, thank you a lot. It works!

Can we maybe add config option for this? So users can just configure desired behavior without building from source?

antosha417 avatar Dec 27 '22 12:12 antosha417

Yes, having a config option for this would be awesome as long as it is not implemented.

peterfication avatar Jan 19 '23 07:01 peterfication

I'm really not too familiar with go but I'll take a look when I find the time. It should be rather simple

oliverguenther avatar Jan 19 '23 08:01 oliverguenther

It looks to me like the existing option git.overrideGpg might suffice - it got rewords working for me with cached GPG credentials.

git:
  overrideGpg: true

See also: https://github.com/jesseduffield/lazygit/issues/1146

mwinckler avatar Apr 07 '23 21:04 mwinckler

Thanks @mwinckler for mentioning this! Yes, this can be closed.

CC @jesseduffield

peterfication avatar Apr 14 '23 14:04 peterfication