git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Unexpected effect of log.showSignature on tformat:%H.

From
NMNiels Möller <nisse@glasklarteknik.se>
Date
Nov 21, 2024, 09:08 UTC
Message-ID
<874j41t0mi.fsf@localhost>
In-Reply-To
<Zz0NsaM-KFRXzBp6@tapette.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 8 quoted lines
> 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

Previous: brian m. carlson
Message 5 of 5 in “Unexpected effect of log.showSignature on tformat:%H.”
  1. Niels MöllerNov 19, 2024
  2. Junio C HamanoNov 19, 2024
  3. Niels MöllerNov 19, 2024
  4. brian m. carlsonNov 19, 2024
  5. Niels MöllerNov 21, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.