Function: magit-log-trace-definition

magit-log-trace-definition is an autoloaded, interactive and byte-compiled function defined in magit-log.el.

Signature

(magit-log-trace-definition FILE FN COMMIT)

Documentation

Show log for the definition at point.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-log.el
;;;###autoload
(defun magit-log-trace-definition (file fn commit)
  "Show log for the definition at point."
  (interactive (list (or (magit-file-relative-name)
                         (user-error "Buffer isn't visiting a file"))
                     (or (funcall magit-log-trace-definition-function)
                         (user-error "No function at point found"))
                     (or magit-buffer-revision
                         (magit-get-current-branch)
                         "HEAD")))
  (require 'magit)
  (magit-log-setup-buffer
   (list commit)
   (cons (format "-L:%s%s:%s"
                 (string-replace ":" "\\:" (regexp-quote fn))
                 (if (derived-mode-p 'lisp-mode 'emacs-lisp-mode)
                     ;; Git doesn't treat "-" the same way as
                     ;; "_", leading to false-positives such as
                     ;; "foo-suffix" being considered a match
                     ;; for "foo".  Wing it.
                     "\\( \\|$\\)"
                   ;; We could use "\\b" here, but since Git
                   ;; already does something equivalent, that
                   ;; isn't necessary.
                   "")
                 file)
         (cl-delete "-L" (car (magit-log-arguments))
                    :test #'string-prefix-p))
   nil magit-log-buffer-file-locked))