[BUG] gpg.program: '~' not expanded to home directory
- From
- Ross MacArthur <ross@macarthur.io>
- Date
- Jul 11, 2025, 15:04 UTC
- Message-ID
- <CAF1X4d7N1xdZt9JkVZytbEU1=7q3X_F_nqm4EG82B8-cVa7g8Q@mail.gmail.com>
`gpg.program` treats a leading ‘~’ literally, unlike other path options such as `core.excludesfile`.
Error:
fatal: cannot exec '~/.local/bin/mygpg': No such file or directory
Reproducer:
ln -s "$(command -v gpg)" ~/.local/bin/mygpg
git config gpg.program '~/.local/bin/mygpg'
git commit -S -m "test" # fails as aboveExpected: Git should expand ‘~’ to $HOME. Work-around: have to use an absolute path