git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Unexpected effect of log.showSignature on tformat:%H.
@ 2024-11-19  9:17 Niels Möller
  2024-11-19  9:37 ` Junio C Hamano
  2024-11-19 22:14 ` brian m. carlson
  0 siblings, 2 replies; 5+ messages in thread
From: Niels Möller @ 2024-11-19  9:17 UTC (permalink / raw)
  To: git

I had expected the output of git show -s --format='tformat:%H' to be
always the same, and was surprised to find that scripts using this
construction started to fail after I set log.showSignature true.

See filled out bugreport form below, including a repro script.

Regards,
/Niels Möller

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

  git config --global log.showSignature true

  I'm trying this out to get to see in git log which commits are
  signed.

What did you expect to happen? (Expected behavior)

  That git show -s --format='tformat:%H' SOME_COMMIT
  should still output the commit hash and nothing more. 

What happened instead? (Actual behavior)

  I get an extra "No signature" line in the output (on stdout, not
  stderr), when looking at a signed commit.

What's different between what you expected and what actually happened?

  The extra output line.

Anything else you want to add:

Here's a small script to reproduce the problem:

-----8<-----
#! /bin/sh

set -eu

export GIT_CONFIG_GLOBAL="$(pwd)/git.config"
git config --global log.showSignature true

git clone https://git.glasklar.is/glasklar/trust/audit-log.git
cd audit-log

hash=$(git show -s --format='tformat:%H' e36424e5688572c196d658a5df8c04c20de7606a)

echo "Hash is: |$hash|"
-----8<-----

This is what it looks when I run it:

-----8<-----
$ ./repro.sh 
Cloning into 'audit-log'...
remote: Enumerating objects: 143, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 143 (delta 1), reused 0 (delta 0), pack-reused 135 (from 1)
Receiving objects: 100% (143/143), 347.00 MiB | 107.22 MiB/s, done.
Resolving deltas: 100% (59/59), done.
error: gpg.ssh.allowedSignersFile needs to be configured and exist for ssh signature verification
Hash is: |No signature
e36424e5688572c196d658a5df8c04c20de7606a|
-----8<-----

I would have expected the output

Hash is: |e36424e5688572c196d658a5df8c04c20de7606a|

[System Info]
git version:
git version 2.39.5
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64
compiler info: gnuc: 12.2
libc info: glibc: 2.40
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]
not run from a git repository - no hooks to show

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-11-21  9:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-19  9:17 Unexpected effect of log.showSignature on tformat:%H Niels Möller
2024-11-19  9:37 ` Junio C Hamano
2024-11-19 10:06   ` Niels Möller
2024-11-19 22:14 ` brian m. carlson
2024-11-21  9:08   ` Niels Möller

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).