Re: Unexpected effect of log.showSignature on tformat:%H.
From: Niels Möller <hidden>
Date: 2024-11-21 09:08:51
"brian m. carlson" [off-list ref] 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