Skip to content

Maximal length of the commit messages #5108

Closed Answered by tarsius
ismagilli asked this question in Q&A
Discussion options

You must be logged in to vote

It would be great to see an option that allows you to set the maximum width for the rest of the commit text

That is known as fill-column across Emacs.

To display the column specified by that variable, use:

(use-package display-fill-column-indicator
  :when (>= emacs-major-version 28)
  :config
  (add-hook 'git-commit-setup-hook
            (lambda ()
              (setq fill-column 72) ; was 70
              (display-fill-column-indicator-mode 1))))

That won't highlight the overflowing characters, instead it draws an indicator at column 72.

Use M-q (fill-paragraph) to perform semi-automatic filling.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@tarsius
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by tarsius
Comment options

You must be logged in to vote
1 reply
@tarsius
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants