branch: elpa/magit
commit ba9b47edbec67b844bacac84f41726f607c33ad4
Author: Huon Wilson <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-insert-worktrees: mention in documentation
This section inserter is handy, and has existed since 2.7.0 /
82bfdd46295c5d6fa5d1a26a5058994e5b4f7c56... but appears to not yet be
documented.
This documentation is modeled in the style of
`magit-sparse-checkout-insert-header', where it is mentioned in the
docs for the relevant commands rather than the docs of `magit-status',
since most people who wish see a list of worktrees are likely using
`magit-worktree' / reading its documentation.
---
docs/magit.org | 5 +++++
docs/magit.texi | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/docs/magit.org b/docs/magit.org
index ade92a0fe35..b0fea35b684 100644
--- a/docs/magit.org
+++ b/docs/magit.org
@@ -7519,6 +7519,11 @@ Also see [[man:git-worktree]]
If the worktree at point is the one whose status is already being
displayed in the current buffer, then show it in Dired instead.
+If you want the status buffer to list worktrees, add the function
+~magit-insert-worktrees~ to ~magit-status-sections-hook~ as described
+in [[*Status Sections]]. If there is only one worktree, this function
+inserts nothing.
+
** Sparse checkouts
Sparse checkouts provide a way to restrict the working tree to a
diff --git a/docs/magit.texi b/docs/magit.texi
index ad74a924a7f..025bdc20553 100644
--- a/docs/magit.texi
+++ b/docs/magit.texi
@@ -9053,6 +9053,11 @@ If the worktree at point is the one whose status is
already being
displayed in the current buffer, then show it in Dired instead.
@end table
+If you want the status buffer to list worktrees, add the function
+@code{magit-insert-worktrees} to @code{magit-status-sections-hook} as described
+in @ref{Status Sections}. If there is only one worktree, this function
+inserts nothing.
+
@node Sparse checkouts
@section Sparse checkouts