Variable: vc-trunk-branch-regexps

vc-trunk-branch-regexps is a customizable variable defined in vc.el.gz.

Value

("trunk" "master" "main" "default")

Documentation

Regular expressions matching the names of longer-lived VCS branches.

There value can be of one of the following forms:
- A list of regular expressions. A trunk branch is one whose name
  matches any of the regular expressions. If an element of the list
  contains no characters that are special in regular expressions, then
  the regexp is implicitly anchored at both ends, i.e., it is the full
  name of a branch.
- A list whose first element is not and whose remaining elements are
  regular expressions. This is the same as the previous case except
  that a trunk branch is one whose name does *not* match any of the
  regular expressions.
- The symbol t. A trunk branch is any branch that
  vc-topic-branch-regexps does not positively identify as a topic
  branch.
- An empty list (or, the symbol nil). The branch name does not indicate
  whether a branch is a trunk. Emacs will ask the backend whether it
  thinks the current branch is a trunk.

If trunk branches in your project can be identified by name, include regexps matching their names in the value of this variable. This is more reliable than letting Emacs ask the backend.

See also vc-trunk-or-topic-p and vc-topic-branch-regexps.

This variable was added, or its default value changed, in Emacs 31.1.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
;; This is used in .dir-locals.el in the Emacs source tree.
;;;###autoload (put 'vc-trunk-branch-regexps 'safe-local-variable
;;;###autoload      #'vc--safe-branch-regexps-p)
(defcustom vc-trunk-branch-regexps '("trunk" "master" "main" "default")
  "Regular expressions matching the names of longer-lived VCS branches.
There value can be of one of the following forms:
- A list of regular expressions.  A trunk branch is one whose name
  matches any of the regular expressions.  If an element of the list
  contains no characters that are special in regular expressions, then
  the regexp is implicitly anchored at both ends, i.e., it is the full
  name of a branch.
- A list whose first element is `not' and whose remaining elements are
  regular expressions.  This is the same as the previous case except
  that a trunk branch is one whose name does *not* match any of the
  regular expressions.
- The symbol t.  A trunk branch is any branch that
  `vc-topic-branch-regexps' does not positively identify as a topic
  branch.
- An empty list (or, the symbol nil).  The branch name does not indicate
  whether a branch is a trunk.  Emacs will ask the backend whether it
  thinks the current branch is a trunk.

If trunk branches in your project can be identified by name, include
regexps matching their names in the value of this variable.  This is
more reliable than letting Emacs ask the backend.

See also `vc-trunk-or-topic-p' and `vc-topic-branch-regexps'."
  :type '(choice (repeat :tag "Regexps" string)
                 (cons :tag "Negated regexps"
                       (const not) (repeat :tag "Regexps" string))
                 (const :tag "Inverse of `vc-branch-trunk-regexps'" t))
  :safe #'vc--safe-branch-regexps-p
  :version "31.1")