Skip to content

Instantly share code, notes, and snippets.

@yoichi
Created February 26, 2023 02:50
Show Gist options
  • Save yoichi/64d8ffc26ba7848bd351c9657b0d95a1 to your computer and use it in GitHub Desktop.
Save yoichi/64d8ffc26ba7848bd351c9657b0d95a1 to your computer and use it in GitHub Desktop.
EDITOR='emacsclient -t' とか EDITOR='emacsclient -c' で git commit -a した時に意図しない差分が表示されるのを回避
;; 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