Skip to content

Commit

Permalink
Revert "magit-insert-revision-notes: Avoid having to cancel sections"
Browse files Browse the repository at this point in the history
This reverts commit 71630e4.
  • Loading branch information
tarsius committed Jun 22, 2024
1 parent 71630e4 commit be54926
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions lisp/magit-diff.el
Original file line number Diff line number Diff line change
Expand Up @@ -2723,17 +2723,20 @@ or a ref which is not a branch, then it inserts nothing."

(defun magit-insert-revision-notes ()
"Insert commit notes into a revision buffer."
(let ((default (or (magit-get "core.notesRef") "refs/notes/commits")))
(let* ((var "core.notesRef")
(def (or (magit-get var) "refs/notes/commits")))
(dolist (ref (magit-list-active-notes-refs))
(when-let ((note (with-temp-buffer
(magit-git-insert "-c" (concat "core.notesRef=" ref)
"notes" "show" magit-buffer-revision)
(magit-revision--wash-message))))
(magit-insert-section
( notes ref (not (equal ref default))
(magit-insert-section
( notes ref (not (equal ref def))
:heading-highlight-face 'magit-diff-hunk-heading-highlight)
(let ((beg (point)))
(insert note)
(let ((beg (point))
(rev magit-buffer-revision))
(insert (with-temp-buffer
(magit-git-insert "-c" (concat "core.notesRef=" ref)
"notes" "show" rev)
(magit-revision--wash-message)))
(if (= (point) beg)
(magit-cancel-section)
(goto-char beg)
(end-of-line)
(insert (format " (%s)"
Expand Down

0 comments on commit be54926

Please sign in to comment.