magit/magit — pull request #348 by dudebout (2012-01-16 20:32:55+00:00)
Title: Found a better way to do add-change-log-entry

I figured out why it was not really working nicely.
I was trying to concile two very different goals:

+ being magit-friendly
+ shadow exactly `add-change-log-entry`

I reconciled the two by creating a function for each use case:

+ one on "L" works like the rest of magit with C-u being the other-window flag
+ one on "C-x 4 a" works like `add-chaneg-log-entry-other-window` and C-u asks for a username and changelog filename

As far as getting the username and email from git it is not the role of magit but add-log.el.
I'll see if I can get a clean solution for them to merge.
In the meantime I use the following code in my .emacs:

```
(make-local-variable 'add-log-full-name)
(make-local-variable 'add-log-mailing-address)
(defun set-git-name-and-email ()
(when (and buffer-file-name
(eq (vc-backend buffer-file-name) 'Git))
(setq add-log-full-name (substring (shell-command-to-string "git config user.name") 0 -1))
(setq add-log-mailing-address (substring (shell-command-to-string "git config user.email") 0 -1))))
(add-hook 'find-file-hook 'set-git-name-and-email)
```