Next: , Previous: , Up: Inspecting   [Contents][Index]

5.6 References Buffer

y     (magit-show-refs-popup)

List and compare references in a dedicated buffer. By default all refs are compared with HEAD, but with a prefix argument this command instead acts as a prefix command and shows the following suffix commands along with the appropriate infix arguments in a popup buffer.

y y     (magit-show-refs-head)

List and compare references in a dedicated buffer. Refs are compared with HEAD.

y c     (magit-show-refs-current)

List and compare references in a dedicated buffer. Refs are compared with the current branch or HEAD if it is detached.

y o     (magit-show-refs)

List and compare references in a dedicated buffer. Refs are compared with a branch read from the user.

User Option: magit-refs-show-commit-count

Whether to show commit counts in Magit-Refs mode buffers.

The default is nil because anything else can be very expensive.

User Option: magit-refs-margin

This option specifies whether the margin is initially shown in Magit-Refs mode buffers and how it is formatted.


User Option: magit-refs-margin-for-tags

This option specifies whether to show information about tags in the margin. This is disabled by default because it is slow if there are many tags.

The following variables control how individual refs are displayed. If you change one of these variables (especially the "%c" part), then you should also change the others to keep things aligned. The following %-sequences are supported:

User Option: magit-refs-filter-alist

This alist controls which tags and branches are omitted from being displayed in magit-refs-mode buffers. If it is nil, then all refs are displayed (subject to magit-refs-sections-hook).

All keys are tried in order until one matches. Then its value is used and subsequent elements are ignored. If the value is non-nil, then the reference is displayed, otherwise it is not. If no element matches, then the reference is displayed.

A key can either be a regular expression that the refname has to match, or a function that takes the refname as only argument and returns a boolean. Contrary to how they are displayed in the buffer, for comparison each tag begins with "tags/" and each remote branch with "<remote>/".

Variable: magit-refs-local-branch-format

Format used for local branches in refs buffers.

Variable: magit-refs-remote-branch-format

Format used for remote branches in refs buffers.

Variable: magit-refs-tags-format

Format used for tags in refs buffers.

Variable: magit-refs-indent-cherry-lines

Indentation of cherries in refs buffers. This should be N-1 where N is taken from "%Nc" in the above format strings.

RET     (magit-visit-ref)

This command visits the reference or revision at point in another buffer. If there is no revision at point or with a prefix argument then it prompts for a revision.

This command behaves just like magit-show-commit as described above, except if point is on a reference in a magit-refs-mode buffer, in which case the behavior may be different, but only if you have customized the option magit-visit-ref-behavior.

User Option: magit-visit-ref-behavior

This option controls how magit-visit-ref behaves in magit-refs-mode buffers.

By default magit-visit-ref behaves like magit-show-commit, in all buffers, including magit-refs-mode buffers. When the type of the section at point is commit then "RET" is bound to magit-show-commit, and when the type is either branch or tag then it is bound to magit-visit-ref.

"RET" is one of Magit’s most essential keys and at least by default it should behave consistently across all of Magit, especially because users quickly learn that it does something very harmless; it shows more information about the thing at point in another buffer.

However "RET" used to behave differently in magit-refs-mode buffers, doing surprising things, some of which cannot really be described as "visit this thing". If you’ve grown accustomed this behavior, you can restore it by adding one or more of the below symbols to the value of this option. But keep in mind that by doing so you don’t only introduce inconsistencies, you also lose some functionality and might have to resort to M-x magit-show-commit to get it back.

magit-visit-ref looks for these symbols in the order in which they are described here. If the presence of a symbol applies to the current situation, then the symbols that follow do not affect the outcome.

Next: , Previous: , Up: Inspecting   [Contents][Index]