Variable: treemacs-git-mode-hook
treemacs-git-mode-hook is a customizable variable defined in
treemacs-async.el.
Value
nil
Documentation
Hook run after entering or leaving treemacs-git-mode(var)/treemacs-git-mode(fun).
No problems result if this variable is not bound.
add-hook automatically binds it. (This is true for all hook variables.)
Source Code
;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-async.el
(define-minor-mode treemacs-git-mode
"Toggle `treemacs-git-mode'.
When enabled treemacs will check files' git status and highlight them
accordingly. This git integration is available in 3 variants: simple, extended
and deferred.
The simple variant will start a git status process whose output is parsed in
elisp. This version is simpler and slightly faster, but incomplete - it will
highlight only files, not directories.
The extended variant requires a non-trivial amount of parsing to be done, which
is achieved with python (specifically python3). It is slightly slower, but
complete - both files and directories will be highlighted according to their git
status.
The deferred variant is the same is extended, except the tasks of rendering
nodes and highlighting them are separated. The former happens immediately, the
latter after `treemacs-deferred-git-apply-delay' seconds of idle time. This may
be faster (if not in truth then at least in appearance) as the git process is
given a much greater amount of time to finish. The downside is that the effect
of nodes changing their colours may be somewhat jarring, though this issue is
largely mitigated due to the use of a caching layer.
All versions run asynchronously and are optimised for not doing more work than
is necessary, so their performance cost should, for the most part, be the
constant time needed to fork a subprocess."
:init-value nil
:global t
:lighter nil
:group 'treemacs-git
;; case when the mode is re-activated by `custom-set-minor-mode'
(when (and (equal arg 1) treemacs--git-mode)
(setf arg treemacs--git-mode))
(if treemacs-git-mode
(if (memq arg '(simple extended deferred))
(treemacs--setup-git-mode arg)
(call-interactively 'treemacs--setup-git-mode))
(treemacs--tear-down-git-mode)))