magit-get-top-dir: fix two issues

* Previously `magit-get-top-dir' didn't do the right thing when passed
  the name of a directory without a trailing slash.  Now it does but
  that comes at the cost of no longer excepting a regular file as
  input.

* Previously `magit-get-top-dir' didn't do the right thing when inside
  the .git directory.  Now it does.
add compatibility function for run-hook-wrapped

This function was introduced in Emacs 24.1
Provide a lisp equivalent.

Tested on Emacs 23.4: allows magit-topgit.el to be used normally

This fixes #1211
magit-{git-dir,get-top-dir}: fix for real

See issues #1201, #1202, #1210, and #1214 - oh boy.

This time around I have actually run some automated tests (but because
they aren't implemented as ert tests I have not yet committed them).
Merge branch 'run-hook-wrapped'
run-hook-wrapped{,-1}: cosmetics
run-hook-wrapped-1: use cl-loop, not loop
Correctly handle the absence of one version of in a merge

Closes #1217.
magit-wash-log-line: fix #1218

All log washing except bisect log goes through `magit-wash-log',
which let-binds `magit-log-line' to 0, even when the log isn't
being truncated.  Only increase `magit-log-count' when the mode
derives (is) `magit-log-line'.  In the bisect case we have to
avoid `cl-incf'ing `magit-log-count's global value which also
happens to be `nil'.
Merge pull request #1219 from vanicat/t/ediff-merge

Correctly handle the absence of one version of in a merge
magit-branch-manager: add kludge for #1215
magit-key-mode-popup-committing: support --author option
magit-wash-diffstat: split regex to make it easier on humans

This is just in preparation to make it longer.
magit-wash-diffstat: support binary files

Binary files are displayed with "Bin XXX -> YYY bytes" instead of the
change count and graph. The numbers correspond to the old and new sizes
of the binary file, not lines added/removed, hence the capture groups
for these are left empty and this text left with no special faces.
Merge pull request #1253 from afrepues/fix/truncated-diffstat-with-binary-files

Fix truncated diffstat with binary files
magit-ellipsis: use #x2026 for "horizontal ellipsis"

to avoid encoding problems.  Close #1249.
magit-with-emacsclient: use --socket-name even with default server-name

When actually using a socket for communication, then always pass the
`--socket-name' argument to the Emacsclient.  Do so even when neither
the `server-name' nor `server-socket-dir' have been set to something
different from the default values.

Just because a user did not configure Emacs to use something else,
doesn't necessarily mean that she did not attempt to so, but stopped
after making adjustments to shell init files.  I.e. there are users
with incomplete configurations, who gave up on using the Emacsclient
after having shot themselves in the foot by incompletely configuring
client/server communication.  Magit requires cannot do without the
Emacsclient and so we have to override such mistakes.
Fix magit-insert-untracked-files & 'status.showUntrackedFiles' git config

Commit 1c4136e cleaned up magit-insert-untracked-files to always rely
rely on status.showUntrackedFiles, however it's broken when this
configuration is not set:
in such case 'git config status.showUntrackedFiles' returns nothing, not
the default value as the code expected.

Then git status was run just with "-u", which is equivalent to "-u
all". It's not what the user specified by not defining
'status.showUntrackedFiles'. It should be "-u normal" in such case.

This commit fixes and simplify this by removing the git config retrieval
altogether since git status reads this config, even with the
"--porcelain" flag.

(This git status behavior is a little ambiguous in the man: it says the
output format will be stable "regardless of user configuration", so one
can wonder why the 'status.showUntrackedFiles' user config is not
ignored. But it's about the output *format*, and not the output itself.)
magit-process-mode: don't turn on view-mode

This was a leftover from the old implementation, which didn't use a
major mode derived from `magit-mode'.  Back then `view-mode' was used so
that we could just use `view-mode-exit' instead of having to implement,
something similar ourselves.  Likewise that took care of making the
buffer read-only.

Now that we actually do use a mode derived `magit-mode' we also get that
for free.  So the use of `view-mode' no longer any benefits, and at the
same time has at least the drawback that we loose some key bindings
which are potentially useful.

Close #1259.
magit-key-mode-groups: fix two arguments
Merge pull request #1260 from Niluge-KiWi/fix-untracked-files-showUntrackedFiles-git-config

Fix magit-insert-untracked-files & 'status.showUntrackedFiles' git config