Skip to main content

5.3.3 Log Margin

In buffers which show one or more logs, it is possible to show additional information about each commit in the margin. The options used to configure the margin are named magit-INFIX-margin, where INFIX is the same as in the respective major-mode magit-INFIX-mode. In regular log buffers that would be magit-log-margin.

user option magit-log-margin​

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

The value has the form (INIT STYLE WIDTH AUTHOR AUTHOR-WIDTH).

  • If INIT is non-nil, then the margin is shown initially.
  • STYLE controls how to format the author or committer date. It can be one of age (to show the age of the commit), age-abbreviated (to abbreviate the time unit to a character), or a string (suitable for format-time-string) to show the actual date. Option magit-log-margin-show-committer-date controls which date is being displayed.
  • WIDTH controls the width of the margin. This exists for forward compatibility and currently the value should not be changed.
  • AUTHOR controls whether the name of the author is also shown by default.
  • AUTHOR-WIDTH has to be an integer. When the name of the author is shown, then this specifies how much space is used to do so.

You can change the STYLE and AUTHOR-WIDTH of all magit-INFIX-margin options to the same values by customizing magit-log-margin before magit is loaded. If you do that, then the respective values for the other options will default to what you have set for that variable. Likewise if you set INIT in magit-log-margin to nil, then that is used in the default of all other options. But setting it to t, i.e. re-enforcing the default for that option, does not carry to other options.

user option magit-log-margin-show-committer-date​

This option specifies whether to show the committer date in the margin. This option only controls whether the committer date is displayed instead of the author date. Whether some date is displayed in the margin and whether the margin is displayed at all is controlled by other options.

L     (magit-margin-settings)​

This transient prefix command binds the following suffix commands, each of which changes the appearance of the margin in some way.

In some buffers that support the margin, L is instead bound to magit-log-refresh, but that transient features the same commands, and then some other unrelated commands.

L L     (magit-toggle-margin)​

This command shows or hides the margin.

L l     (magit-cycle-margin-style)​

This command cycles the style used for the margin.

L d     (magit-toggle-margin-details)​

This command shows or hides details in the margin.