Function: global-git-commit-mode
global-git-commit-mode is an interactive and byte-compiled function
defined in git-commit.el.
Signature
(global-git-commit-mode &optional ARG)
Documentation
Edit Git commit messages.
This global mode arranges for git-commit-setup to be called
when a Git commit message file is opened. That usually happens
when Git uses the Emacsclient as $GIT_EDITOR to have the user
provide such a commit message.
Loading the library git-commit by default enables this mode,
but the library is not automatically loaded because doing that
would pull in many dependencies and increase startup time too
much. You can either rely on magit loading this library or
you can load it explicitly. Autoloading is not an alternative
because in this case autoloading would immediately trigger
full loading.
This is a global minor mode. If called interactively, toggle the
Global Git-Commit mode mode. If the prefix argument is positive,
enable the mode, and if it is zero or negative, disable the mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable the
mode if ARG is nil, omitted, or is a positive number. Disable the mode
if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate (default-value \=global-git-commit-mode)'.
The mode's hook is called both when the mode is enabled and when it is disabled.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/git-commit.el
;;; Global Mode
(define-minor-mode global-git-commit-mode
"Edit Git commit messages.
This global mode arranges for `git-commit-setup' to be called
when a Git commit message file is opened. That usually happens
when Git uses the Emacsclient as $GIT_EDITOR to have the user
provide such a commit message.
Loading the library `git-commit' by default enables this mode,
but the library is not automatically loaded because doing that
would pull in many dependencies and increase startup time too
much. You can either rely on `magit' loading this library or
you can load it explicitly. Autoloading is not an alternative
because in this case autoloading would immediately trigger
full loading."
:group 'git-commit
:type 'boolean
:global t
:init-value t
:initialize
(lambda (symbol exp)
(custom-initialize-default symbol exp)
(when global-git-commit-mode
(add-hook 'find-file-hook #'git-commit-setup-check-buffer)
(remove-hook 'after-change-major-mode-hook
#'git-commit-setup-font-lock-in-buffer)))
(cond
(global-git-commit-mode
(add-hook 'find-file-hook #'git-commit-setup-check-buffer)
(add-hook 'after-change-major-mode-hook
#'git-commit-setup-font-lock-in-buffer))
(t
(remove-hook 'find-file-hook #'git-commit-setup-check-buffer)
(remove-hook 'after-change-major-mode-hook
#'git-commit-setup-font-lock-in-buffer))))