git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Oliver Niebuhr <oliver.niebuhr@oliverniebuhr.de>
Cc: git@vger.kernel.org
Subject: Re: [Bug Report] Git does not push signingkey ID to GPG
Date: Fri, 23 Jul 2021 03:07:02 -0400	[thread overview]
Message-ID: <YPpqlnuGrk8Gunep@coredump.intra.peff.net> (raw)
In-Reply-To: <dfeebef5-6f48-082d-f49d-832863ff62a8@oliverniebuhr.de>

On Fri, Jul 23, 2021 at 01:42:20AM +0200, Oliver Niebuhr wrote:

> I have edit the .gitconfig File accordingly and added
> 
> [user]
> signingkey = NNN
> [commit]
> gpgsign = true
> [alias]
> amend = commit -S -s --amend
> cm = commit -S -s
> commit = commit -S -s
> tag = tag -S -s
> [gpg]
> program = C:\\Program Files (x86)\\GnuPG\\bin\\gpg.exe
> 
> The Git User Name and eMail Address are the same which are set in the used
> GPG Certificate.
> 
> Using '-S' from the Windows CMD Shell and Git Bash leads to an error.
> Neither typing the command manually or using it through an alias works.
> 
> When I switch '-S' with '--gpg-sign=NNN' everything works as it should from
> CMD Line - but not when I use for example SmartGit and enable 'Sign all
> Commits'. After countless hours looking through the Web, I am not out of
> Ideas.

This works fine for me. I get:

  $ GIT_TRACE=1 git -c user.signingkey=1234abcd commit -S --amend --no-edit
  03:03:26.487264 [pid=1285432] git.c:455           trace: built-in: git commit -S --amend --no-edit
  03:03:26.491963 [pid=1285432] run-command.c:666   trace: run_command: gpg --status-fd=2 -bsau 1234abcd
  error: gpg failed to sign the data
  fatal: failed to write commit object

In your trace, the key parameter that's passed is the empty string:

> 00:30:45.064284 run-command.c:667       trace: run_command: 'C:\Program
> Files (x86)\GnuPG\bin\gpg.exe' -bsau ''
> gpg: skipped "": Invalid user ID
> gpg: signing failed: Invalid user ID

You showed config with user.signingkey set. Is it possible that you have
other config (say, in the repo config file), that is taking precedence?

What does:

  git config --show-origin --get-all user.signingkey

say when run inside the repository?

-Peff

      reply	other threads:[~2021-07-23  7:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 23:42 [Bug Report] Git does not push signingkey ID to GPG Oliver Niebuhr
2021-07-23  7:07 ` Jeff King [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YPpqlnuGrk8Gunep@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=oliver.niebuhr@oliverniebuhr.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).