Variable: global-git-commit-mode

global-git-commit-mode is a customizable variable defined in git-commit.el.

Value

t

Documentation

Non-nil if Global Git-Commit mode is enabled.

See the global-git-commit-mode(var)/global-git-commit-mode(fun) command for a description of this minor mode. Setting this variable directly does not take effect; either customize it (see the info node (emacs)Easy Customization) or call the function global-git-commit-mode(var)/global-git-commit-mode(fun).

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))))