Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turning off magit-mode commit formatting

Tags:

git

emacs

magit

The recent-ish version of Magit (M-x magit-version says magit-20131222.850) I'm currently using enforces certain annoying properties on commit messages, and colors them oddly. Specifically, it auto-breaks lines at a certain length and colors the first one green.

Is there any way to disable this, and make it act like the old dumb commit message window? I don't see anything relevant-looking in M-x customize-mode, so I assume the solution will involve some elisp.

like image 999
Inaimathi Avatar asked Dec 19 '22 15:12

Inaimathi


1 Answers

Add the following to your .emacs:

(add-hook 'git-commit-mode-hook
          '(lambda () (auto-fill-mode 0))
          ;; append rather than prepend to git-commit-mode-hook, since the
          ;; thing that turns auto-fill-mode on in the first place is itself
          ;; another hook on git-commit-mode.
          t)

As for the font color, I suggest you move the cursor to the text of interest, do M-x customize-face, and use the dialog.

However, you could do something like this in raw elisp:

(set-face-foreground 'git-commit-summary-face "white")

(In general you can move the cursor to the text of interest and do M-x describe-face to learn what face it is you want to modify.)

like image 106
Phil Avatar answered Dec 26 '22 11:12

Phil