0

Magit displays signature information in the magit-revision buffer when visiting a tag, but I can't seem to configure this behaviour when visiting a commit using the default bindings for magit-visit-commit (<Return> or <Space>). I can see the flag for visiting a commit through the magit-diff transient prefix, though, so I know it's possible for this to be configured through magit-diff invocation of magit-visit-commit, but those configurations don't seem to be available from the <Return> invocation. Is there something I can add to my init.el to make this behaviour possible?

1 Answer 1

1

No direct parity with tags

For tags, the signature displayed at the top of the section is different than the one displayed by the configurable flag --show-signature. The tag behavior is driven by magit-insert-revision-tag, which uses git verify-tag under the hood and so is tag specific as you've encountered. It may be that similar support should be added for git verify-commit, but as far as I can see that isn't available! So, no direct solution for commits.

An alternative solution

I don't know the difference between git verify-* and the output given with --show-signature, but if --show-signature provides what you want, then you can change the default diff args for magit-revision-mode to include --show-signature. The following would work:

;; Add --show-signature to diff args for all revision-mode buffers
(put 'magit-revision-mode 'magit-diff-default-arguments
     `("--show-signature" ,@(get 'magit-diff-mode 'magit-diff-default-arguments)))

Some notes on this solution:

  1. This changes the behavior of all magit-revision-mode buffers. I specifically targeted that mode and not magit-diff-mode as it was more of a local change.
  2. On tags, you will two signatures since the signature at the top is generated separately.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.