Skip to content

Instantly share code, notes, and snippets.

@jdelStrother
Created November 5, 2018 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdelStrother/736670ddcfe8f44af02e5dea884943b2 to your computer and use it in GitHub Desktop.
Save jdelStrother/736670ddcfe8f44af02e5dea884943b2 to your computer and use it in GitHub Desktop.
(defun magit-log-trace-definition-hacks (orig-func &rest args)
(if (called-interactively-p 'any)
(let ((file (or (magit-file-relative-name) (user-error "Buffer isn't visiting a file")))
(fn (replace-regexp-in-string "^.*[#.:]+" "" (which-function)))
(ref (or magit-buffer-refname (magit-get-current-branch) "HEAD")))
(message "%s" fn)
(apply orig-func (list file fn ref)))
(apply orig-func args)
))
(advice-add 'magit-log-trace-definition :around #'magit-log-trace-definition-hacks)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment