Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do *not* show pgp signature in git log

Tags:

git

bash

The git log subcommand has the option --show-signature to display pgp signatures of the commits (if present). This can also be enabled by default via git config log.showSignature true.

I have set this config option to true. The problem is that I am now looking for an option to pass to git log to not show the signature in the log (while the config is still set to true), something like git config --no-show-signature.

I was unable to find anything helpful in the git documentation. For context: Most of the time, I do want git log to be active, but in some automated scripts, I really don't need this, because it messes up some automatic parsing etc.

like image 462
Maximilian Keßler Avatar asked Oct 18 '25 03:10

Maximilian Keßler


1 Answers

I'll repeat @phd's comment, which in the current state of things seems like the most straightforward way to cancel that config parameter (and only that one) :

Try git -c log.showSignature=false log


Another option is to use git log's sister command : git rev-list.

The differences are :

  • git rev-list isn't affected by log.* config parameters
  • you need to add --no-commit-header to avoid one extra line on each commit (see this answer here which links to doc)
  • you need to specify explicitly the refs/branches names (e.g: git rev-list will error, you need to say git rev-list HEAD)

Other than that, it understands the same options as git log :

git rev-list --no-commit-header --graph --format="%h (%an %ad) %s" HEAD
like image 70
LeGEC Avatar answered Oct 21 '25 01:10

LeGEC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!