Function: treemacs-git-commit-diff-mode

treemacs-git-commit-diff-mode is an autoloaded, interactive and byte-compiled function defined in treemacs-git-commit-diff-mode.el.

Signature

(treemacs-git-commit-diff-mode &optional ARG)

Documentation

Minor mode to display commit differences for your git-tracked projects.

When enabled treemacs will add an annotation next to every git project showing how many commits ahead or behind your current branch is compared to its remote counterpart.

The difference will be shown using the format ↑x ↓y, where x and y are the numbers of commits a project is ahead or behind. The numbers are determined based on the output of git status -sb.

By default the annotation is only updated when manually updating a project with treemacs-refresh. You can install treemacs-magit to enable automatic updates whenever you commit/fetch/rebase etc. in magit.

Does not require treemacs-git-mode(var)/treemacs-git-mode(fun) to be active.

This is a global minor mode. If called interactively, toggle the Treemacs-Git-Commit-Diff 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 \=treemacs-git-commit-diff-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/treemacs-20251226.1307/treemacs-git-commit-diff-mode.el
;;;###autoload
(define-minor-mode treemacs-git-commit-diff-mode
  "Minor mode to display commit differences for your git-tracked projects.

When enabled treemacs will add an annotation next to every git project showing
how many commits ahead or behind your current branch is compared to its remote
counterpart.

The difference will be shown using the format `↑x ↓y', where `x' and `y' are the
numbers of commits a project is ahead or behind.  The numbers are determined
based on the output of `git status -sb'.

By default the annotation is only updated when manually updating a project with
`treemacs-refresh'.  You can install `treemacs-magit' to enable automatic
updates whenever you commit/fetch/rebase etc. in magit.

Does not require `treemacs-git-mode' to be active."
  :init-value nil
  :global     t
  :lighter    nil
  :group      'treemacs
  (if treemacs-git-commit-diff-mode
      (treemacs--enable-git-commit-diff-mode)
    (treemacs--disable-git-commit-diff-mode)))