Artawower / blamer.el

A git blame plugin for emacs inspired by VS Code's GitLens plugin
GNU General Public License v3.0
430 stars 15 forks source link

Error in blamer when author name not set #46

Closed ax487 closed 1 year ago

ax487 commented 1 year ago

I use several git accounts, so I have not set git config --global user.name / git config --global user.email and set the config on a per-project basis. Sadly, this leads to an error when activating blamer-mode:

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  replace-regexp-in-string("\n\\'" "" nil)
  blamer-mode()
  global-blamer-mode-enable-in-buffers()

The error occurs here:

https://github.com/Artawower/blamer.el/blob/3d9d12f5a7f31018efdb17a77da8277a3f5da0a6/blamer.el#L1017

Since (apply #'vc-git--run-command-string nil blamer--git-author-cmd) returns nil, the replace-regexp-in-string results in the Wrong type argument: arrayp, nil error.

I realize that this is kind of a corner case, but I would find it helpful to be able to use blamer in this situation.