Next: , Up: Submodules   [Contents][Index]


8.3.1 Listing Submodules

The command magit-list-submodules displays a list of the current repository’s submodules in a separate buffer. It’s also possible to display information about submodules directly in the status buffer of the super-repository by adding magit-insert-submodules to the hook magit-status-sections-hook as described in Status Module Sections.

Command: magit-list-submodules

This command displays a list of the current repository’s submodules in a separate buffer.

It can be invoked by pressing RET on the section titled "Modules".

User Option: magit-submodule-list-columns

This option controls what columns are displayed by the command magit-list-submodules and how they are displayed.

Each element has the form (HEADER WIDTH FORMAT PROPS).

HEADER is the string displayed in the header. WIDTH is the width of the column. FORMAT is a function that is called with one argument, the repository identification (usually its basename), and with default-directory bound to the toplevel of its working tree. It has to return a string to be inserted or nil. PROPS is an alist that supports the keys :right-align and :pad-right.

Function: magit-insert-submodules

Insert sections for all submodules. For each section insert the path, the branch, and the output of git describe --tags, or, failing that, the abbreviated HEAD commit hash.

Press RET on such a submodule section to show its own status buffer. Press RET on the "Modules" section to display a list of submodules in a separate buffer. This shows additional information not displayed in the super-repository’s status buffer.