Created
February 26, 2023 02:50
-
-
Save yoichi/64d8ffc26ba7848bd351c9657b0d95a1 to your computer and use it in GitHub Desktop.
EDITOR='emacsclient -t' とか EDITOR='emacsclient -c' で git commit -a した時に意図しない差分が表示されるのを回避
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; EDITOR='emacsclient -t' とか EDITOR='emacsclient -c' で | |
;; git commit -a した時に意図しない差分が表示されるのを回避 | |
(defun magit-commit-diff-with-frame-environment () | |
(let ((process-environment | |
(append process-environment | |
(frame-parameter nil 'environment)))) | |
(magit-commit-diff))) | |
(with-eval-after-load 'magit-commit | |
(remove-hook 'server-switch-hook #'magit-commit-diff) | |
(add-hook 'server-switch-hook #'magit-commit-diff-with-frame-environment)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment