C-x v =vc-diff
이 좋습니다. 그러나 diff가 magit-status
버퍼에 표시된 경우 diff 으로 직접 작업 할 수 있습니다.스크립팅 마법사 타이밍 문제
난 그냥 여기서 뭘 시도했다 :
(defvar le::vc-diff-data nil)
(defun le::magit-go-to-change-once()
(destructuring-bind (filename orig-buff relative-name) le::vc-diff-data
(pop-to-buffer "*magit: magit*")
(goto-char (point-min))
(if (and (search-forward-regexp "^Changes:$" nil t)
;; WIP fix
(progn (magit-show-level-2) t)
(search-forward relative-name nil t))
(progn (recenter-top-bottom 0)
;; WIP fix me here
(magit-show-level-4)
)
;; no diff
(pop-to-buffer orig-buf)
(message "no diff found.")))
(remove-hook 'magit-refresh-status-hook #'le::magit-go-to-change-once))
(defadvice vc-diff (around magit-redirect activate compile)
"redirect to magit"
(let* ((vc-info (vc-deduce-fileset t))
(filename (buffer-file-name))
(orig-buf (current-buffer))
(relative-name (replace-regexp-in-string
(concat "\\`"
(regexp-quote (expand-file-name (locate-dominating-file filename ".git"))))
"" filename)))
(if (string-equal "Git" (car vc-info))
(progn
(setq le::vc-diff-data (list filename orig-buf relative-name))
(add-hook 'magit-refresh-status-hook #'le::magit-go-to-change-once)
(call-interactively 'magit-status))
ad-do-it)))
는 "magit 쇼 레벨 *"함수가 실패하지만. 그래도 내가 magit 버퍼에 eval-expression
을 사용할 때 작동합니다. 어쩌면 이것은 타이밍 문제입니다 그리고 나는 다른 곳에서 연결해야합니다.
Magit을 모르면 무슨 뜻인지 모르겠군요. 그러나 장기적으로 diff-mode가 Magit의 기능 중 일부를 통합하고 (그리고 그 기능이 무엇인지 설명하는) '일시적보고 - 이맥스 - 버그'가 해결 방법 누적보다 더 나은 옵션 일 수 있습니다. – Stefan
필자는 diff-refine에서 하이라이트 공간 변경 사항에 대한 버그 보고서를 제출했습니다. 하지만이 경우에는 정말 git을 사용하여 magit을 호출하려고합니다. –
문제는 magit이 섹션이 완료되기 전에 후크에서 함수를 호출하므로 섹션 관련 함수가 작동하지 않습니다 .... –