diff --git a/emacs/.emacs.d/config/init-git.el b/emacs/.emacs.d/config/init-git.el index eb31051..e883876 100644 --- a/emacs/.emacs.d/config/init-git.el +++ b/emacs/.emacs.d/config/init-git.el @@ -70,6 +70,12 @@ (advice-add 'forge-topic-at-point :around (lambda (oldfn &rest args) (ignore-errors (apply oldfn args)))) + (defun forge-diff-for-pr () + (interactive) + (let ((target forge--buffer-base-branch) + (source forge--buffer-head-branch)) + (magit-diff-range (format "%s..%s" source target)))) + (add-hook 'forge-create-pullreq-hook #'forge-diff-for-pr) :custom (forge-owned-accounts '((jdormit . (remote-name "jdormit")))) :general