2

I'm trying to debug installations of various versions of Git & GPG on Linux and Windows platforms.

According to git & gpg man pages:

  • Git uses gpg.program configuration-option to locate the gpg cmd;
  • GPG uses GNUPGHOME environment variable (or HKCU\Software\GNU\GnuPG:HomeDir under Windows).
  • According to this answer, exporting GIT_TRACE=1 env-var you get verbose information about git's action, but for my case those are not enough.

Is there a way to verify the actual homedirr and executable-path of gpg used by git cmd?

Community
  • 1
  • 1
ankostis
  • 8,579
  • 3
  • 47
  • 61

1 Answers1

1

Is there a way to verify the actual homedir and executable-path of gpg

Simply open a git bash session and type:

echo $HOME
which gpg

For me:

vonc@bigvonc MINGW64 ~/git/git (master)
$ which gpg
/usr/bin/gpg

(/ is the Git installation root folder)

You can also type set GIT_TRACE=2 (or export GIT_TRACE=2 in a bash session) and use a git command involving gpg:

C:\Users\vonc\prog\git\git>git tag -v v1.4.2.1
20:58:52.193034 git.c:371               trace: built-in: git 'tag' '-v' 'v1.4.2.1'
20:58:52.245921 run-command.c:369       trace: run_command: 'gpg' '--status-fd=1' '--keyid-format=long' '--verify' 'C:/Users/vonc/AppData/Local/Temp/.git_vtag_tmp4moGKa' '-'
object 883653babd8ee7ea23e6a5c392bb739348b1eb61
type commit
tag v1.4.2.1
tagger Junio C Hamano <junkio@cox.net> 1158138501 -0700

GIT 1.4.2.1

Minor fixes since 1.4.2, including git-mv and git-http with alternates.
gpg: Signature made Wed Sep 13 11:08:25 2006 RDT
gpg:                using DSA key C0C6D9A4F3119B9A
gpg: Can't check signature: public key not found

Here gpg is the one on the $PATH:

C:\Users\vonc\prog\git\git>where gpg
C:\prgs\git\latest\usr\bin\gpg.exe
C:\prgs\gpg2\latest\pub\gpg.exe

In my case, it is the one from Git itself used first.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250