Function: magit-insert-revision-tag

magit-insert-revision-tag is a byte-compiled function defined in magit-diff.el.

Signature

(magit-insert-revision-tag)

Documentation

Insert tag message and headers into a revision buffer.

This function only inserts anything when magit-show-commit is called with a tag as argument, when that is called with a commit or a ref which is not a branch, then it inserts nothing.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-diff.el
(defun magit-insert-revision-tag ()
  "Insert tag message and headers into a revision buffer.
This function only inserts anything when `magit-show-commit' is
called with a tag as argument, when that is called with a commit
or a ref which is not a branch, then it inserts nothing."
  (when (magit-tag-p magit-buffer-revision)
    (magit-insert-section (taginfo)
      (let ((beg (point)))
        ;; "git verify-tag -v" would output what we need, but the gpg
        ;; output is send to stderr and we have no control over the
        ;; order in which stdout and stderr are inserted, which would
        ;; make parsing hard.  We are forced to use "git cat-file tag"
        ;; instead, which inserts the signature instead of verifying
        ;; it.  We remove that later and then insert the verification
        ;; output using "git verify-tag" (without the "-v").
        (magit-git-insert "cat-file" "tag" magit-buffer-revision)
        (goto-char beg)
        (forward-line 3)
        (delete-region beg (point)))
      (looking-at "^tagger \\([^<]+\\) <\\([^>]+\\)")
      (let ((heading (format "Tagger: %s <%s>"
                             (match-str 1)
                             (match-str 2))))
        (magit-delete-line)
        (magit-insert-heading
          (propertize heading 'font-lock-face
                      'magit-section-secondary-heading)))
      (forward-line)
      (magit-insert-section
          ( message nil nil
            :heading-highlight-face 'magit-diff-revision-summary-highlight)
        (let ((beg (point)))
          (forward-line)
          (magit--add-face-text-property
           beg (point) 'magit-diff-revision-summary))
        (magit-insert-heading)
        (if (re-search-forward "-----BEGIN PGP SIGNATURE-----" nil t)
            (goto-char (match-beginning 0))
          (goto-char (point-max)))
        (insert ?\n))
      (cond ((re-search-forward "-----BEGIN PGP SIGNATURE-----" nil t)
             (let ((beg (match-beginning 0)))
               (re-search-forward "-----END PGP SIGNATURE-----\n")
               (delete-region beg (point)))
             (save-excursion
               (magit-process-git t "verify-tag" magit-buffer-revision))
             (magit-diff-wash-signature magit-buffer-revision))
            ((goto-char (point-max))))
      (insert ?\n))))