Function: magit-log-related

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

Signature

(magit-log-related REVS &optional ARGS FILES)

Documentation

Show log for the current branch, its upstream and its push target.

When the upstream is a local branch, then also show its own upstream. When HEAD is detached, then show log for that, the previously checked out branch and its upstream and push-target.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-log.el
;;;###autoload
(defun magit-log-related (revs &optional args files)
  "Show log for the current branch, its upstream and its push target.
When the upstream is a local branch, then also show its own
upstream.  When `HEAD' is detached, then show log for that, the
previously checked out branch and its upstream and push-target."
  (interactive
    (cons (let ((current (magit-get-current-branch))
                head rebase target upstream upup)
            (unless current
              (setq rebase (magit-rebase--get-state-lines "head-name"))
              (cond (rebase
                     (setq rebase (magit-ref-abbrev rebase))
                     (setq current rebase)
                     (setq head "HEAD"))
                    ((setq current (magit-get-previous-branch)))))
            (cond (current
                   (setq current
                         (magit--propertize-face current 'magit-branch-local))
                   (setq target (magit-get-push-branch current t))
                   (setq upstream (magit-get-upstream-branch current))
                   (when upstream
                     (setq upup (and (magit-local-branch-p upstream)
                                     (magit-get-upstream-branch upstream)))))
                  ((setq head "HEAD")))
            (delq nil (list current head target upstream upup)))
          (magit-log-arguments)))
  (magit-log-setup-buffer revs args files))