All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Niels Möller" <nisse@glasklarteknik.se>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: git@vger.kernel.org
Subject: Re: Unexpected effect of log.showSignature on tformat:%H.
Date: Thu, 21 Nov 2024 10:08:37 +0100	[thread overview]
Message-ID: <874j41t0mi.fsf@localhost> (raw)
In-Reply-To: <Zz0NsaM-KFRXzBp6@tapette.crustytoothpaste.net> (brian m. carlson's message of "Tue, 19 Nov 2024 22:14:09 +0000")

"brian m. carlson" <sandals@crustytoothpaste.net> writes:

> git show is a porcelain, and it can be affected by options, such as
> `log.showSignature`.  If you want predictable behaviour, you need a
> plumbing command, whose behaviour isn't affected by configuration in
> this way.  The equivalent to what you've requested is this:
>
>     git rev-list --no-commit-header -1 -s --format='tformat:%H' SOME_COMMIT
>
> I've confirmed that works correctly even if `log.showSignature` is set.

Thanks! It seems the way to understand this is that git show can display
a bunch of different things, depending on configuration, and --tformat
affects only one of potentially many output lines.

So git rev-list solves this problem. My script (which creates a file
archive, in a reproducible fashion, from a list if git repos and (signed)
tags) uses a few more git commands:

  git clone
  git ls-files
  git -c gpg.ssh.allowedSignersFile=... tag --verify
  git submodule

Of these, it appears only ls-files is listed as a "plumbing" command. I
wonder if I still need to stick to GIT_CONFIG_GLOBAL=/dev/null to avoid
surprises for the clone, tag and submodule commands?

Any advice appreciated.

Regards,
/Niels

      reply	other threads:[~2024-11-21  9:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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

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

  git send-email \
    --in-reply-to=874j41t0mi.fsf@localhost \
    --to=nisse@glasklarteknik.se \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.