NicoHood / GPGit

A shell script that automates the process of signing Git sources via GPG
MIT License
89 stars 10 forks source link

Commit signing should check if it's enabled before globally enabling #17

Closed wolph closed 6 years ago

wolph commented 6 years ago

The git commit signing is always enabled globally by the script currently which doesn't detect a locally included gitconfig file. For some of my machines (which I consider safe) I have my gpgkeys available.

Often I'll be working on machines for several customers but will use my own shell config (which includes my gitconfig) which results in errors because the gpgkey obviously doesn't exist on those machines

The specific codeblock: https://github.com/NicoHood/gpgit/blob/14c0ffb7f065c12bfcfa894aa0220a2cde9fa05b/gpgit.sh#L424-L432

I suggest changing it to:

if [[ "$(git config commit.gpgsign || true)" != "true" ]]; then
NicoHood commented 6 years ago

Oh, my bad. I think this was a copy+paste mistake. Good catch!

Does the rest of the script look good to you? Did you check it? I have not tagged the next update yet.

wolph commented 6 years ago

Yep, I've created several releases with it and so far I haven't seen any issues :)

Looks good to me