From: Junio C Hamano <gitster@pobox.com>
To: Ross MacArthur <ross@macarthur.io>
Cc: git@vger.kernel.org
Subject: Re: [BUG] gpg.program: '~' not expanded to home directory
Date: Fri, 11 Jul 2025 17:05:44 -0700 [thread overview]
Message-ID: <xmqq8qkuxoh3.fsf@gitster.g> (raw)
In-Reply-To: <CAF1X4d7N1xdZt9JkVZytbEU1=7q3X_F_nqm4EG82B8-cVa7g8Q@mail.gmail.com> (Ross MacArthur's message of "Fri, 11 Jul 2025 17:04:02 +0200")
Ross MacArthur <ross@macarthur.io> writes:
> `gpg.program` treats a leading ‘~’ literally, unlike other path
> options such as `core.excludesfile`.
I think that is correct; I do not think gpg.program is to give a
path to the program, so comparison with core.excludesfile is
probably not so appropriate.
It gives a command line, e.g. "mysign --compat=gnupg", where the
program "mysign" somewhere on your path can be told to behave in a
way compatible to GPG when a command line option "--compat=gnupg" is
given. We further append our own command line options when we
invoke this command, like the "git config --help" on this variable
says. When we want to verify GPG signature $signature in a file
$file, for example, instead of running gpg, we would run:
mysign --compat=gnupg --verify $signature - <$file
> Expected: Git should expand ‘~’ to $HOME.
So this expectation does not quite hold true.
I wonder if letting your shell to handle the tilde expansion would
make it work, though. Continuing with the example, it may look
something like this, perhaps?
$ git config set gpg.program "sh -c '~/mysign --compat=gnupg \"\$@\"' -"
next prev parent reply other threads:[~2025-07-12 0:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-11 15:04 [BUG] gpg.program: '~' not expanded to home directory Ross MacArthur
2025-07-11 23:23 ` [PATCH] gpg-interface: expand gpg.program as a path Jonas Brandstötter
2025-07-14 17:10 ` Junio C Hamano
2025-07-22 19:09 ` [PATCH v2 0/2] " Jonas Brandstötter
2025-07-22 20:28 ` Junio C Hamano
2025-07-22 19:09 ` [PATCH v2 1/2] " Jonas Brandstötter
2025-07-22 19:09 ` [PATCH v2 2/2] t7510: add test cases for non-absolute gpg program Jonas Brandstötter
2025-07-25 4:30 ` Jeff King
2025-07-25 5:13 ` Jeff King
2025-07-29 0:05 ` Junio C Hamano
2025-07-29 7:12 ` Jeff King
2025-07-29 15:06 ` Junio C Hamano
2025-07-12 0:05 ` Junio C Hamano [this message]
2025-07-12 9:38 ` [BUG] gpg.program: '~' not expanded to home directory Andreas Schwab
2025-07-12 14:08 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq8qkuxoh3.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=ross@macarthur.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).