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 1


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
                        nil t)


(magit-add-section-hook 'magit-refs-sections-hook
  • I tried this and it seems to replace the existing header (magit-insert-head-header) with the branch description header, instead of inserting it. Commented 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.
    – tarsius
    Commented Jul 3, 2015 at 14:37
  • That was quick :)
    – tarsius
    Commented Jul 16, 2015 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.