Function: magit-insert-tags

magit-insert-tags is a byte-compiled function defined in magit-refs.el.

Signature

(magit-insert-tags)

Documentation

Insert sections showing all tags.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-refs.el
(defun magit-insert-tags ()
  "Insert sections showing all tags."
  (when-let ((tags (magit-git-lines "tag" "--list" "-n" magit-buffer-refs-args)))
    (let ((_head (magit-rev-parse "HEAD")))
      (magit-insert-section (tags)
        (magit-insert-heading (length tags) "Tags")
        (dolist (tag tags)
          (string-match "^\\([^ \t]+\\)[ \t]+\\([^ \t\n].*\\)?" tag)
          (let ((tag (match-str 1 tag))
                (msg (match-str 2 tag)))
            (when (magit-refs--insert-refname-p tag)
              (magit-insert-section (tag tag t)
                (magit-insert-heading
                  (magit-refs--format-focus-column tag 'tag)
                  (propertize tag 'font-lock-face 'magit-tag)
                  (make-string
                   (max 1 (- (if (consp magit-refs-primary-column-width)
                                 (car magit-refs-primary-column-width)
                               magit-refs-primary-column-width)
                             (length tag)))
                   ?\s)
                  (and msg (magit-log--wash-summary msg)))
                (when magit-refs-margin-for-tags
                  (magit-refs--maybe-format-margin tag))
                (magit-refs--insert-cherry-commits tag)))))
        (insert ?\n)
        (magit-make-margin-overlay)))))