Hackily set gpg.program to work around Tower's weird design

This commit is contained in:
Danielle McLean 2023-11-09 14:46:05 +11:00
parent 0730be2026
commit 532ff72b8b
Signed by: 00dani
GPG key ID: 52C059C3B22A753E
2 changed files with 23 additions and 3 deletions

View file

@ -70,9 +70,6 @@
process = git-lfs filter-process process = git-lfs filter-process
required = true required = true
[gpg]
program = gpg-for-git-signing
[help] [help]
autocorrect = 20 autocorrect = 20
@ -110,6 +107,26 @@
[url "git@git.00dani.me:"] [url "git@git.00dani.me:"]
pushInsteadOf = https://git.00dani.me/ pushInsteadOf = https://git.00dani.me/
# This is a frankly ridiculous hack. Tower (https://www.git-tower.com) supports
# signing and verifying with GPG, but it requires you to select a GPG binary in
# its settings, and it overwrites the value of gpg.program in your Git config
# to be an absolute path when you do this. This is a problem if you reuse your
# Git config across platforms where GPG might be in different places, which I
# do. In my opinion it's a bug in how Tower works, but I've tried contacting
# support about it and they won't change it. So hacks it is.
[gpg]
program = /usr/local/bin/gpg
# The workaround is to specify the absolute GPG path that Tower wants first
# (above). Tower will see this setting and its GPG functionality will work
# properly. Then, the gpg.program setting I actually want is stored in an
# include file, and that include file is loaded conditionally using includeIf.
# Tower doesn't seem to understand this, but Git does. The condition I've used
# is always true, so Git itself always loads this file and my gpg.program
# setting is overridden with the correct one.
[includeIf "onbranch:**"]
path = tools/gpg-for-git-signing
[include] [include]
path = tools/kdiff3 path = tools/kdiff3
path = tools/kitty-diff path = tools/kitty-diff

View file

@ -0,0 +1,3 @@
# vim: ft=gitconfig
[gpg]
program = gpg-for-git-signing