The release notes for magit 2.1.0 state "Branch descriptions can now be displayed in the refs or status buffer". However, I can't find these features documented in the info pages. I am using magit 20150701.1326.
1 Answer
For some buffers, including status and refs buffers, Magit now uses customizable hooks. Such hook variables are named magit-{*}-sections-hook
. All functions that insert sections are named magit-insert-WHAT
. To add functions to section hook variables use magit-add-section-hook
. It offers a little more control over where exactly the function is inserted, than plain add-hook
. So try this:
(magit-add-section-hook 'magit-status-sections-hook
'magit-insert-branch-description
nil t)
and/or
(magit-add-section-hook 'magit-refs-sections-hook
'magit-insert-branch-description)
-
I tried this and it seems to replace the existing header (
magit-insert-head-header
) with the branch description header, instead of inserting it. Jul 3, 2015 at 14:24 -
Right. I thought it was a section intended as a header line, but it's actually a full, collapsible section. I have adjusted the answer.– tarsiusJul 3, 2015 at 14:37
-