magit-git-command: use magit-run-git-async

In `magit-git-command' use `magit-run-git-async' instead of the more
low-level `magit-run-git*'.

The latter should only be used in special cases, and should otherwise be
avoided.  Now that we use the correct function the message "Running git
<...>" is displayed in the echo area.  Since the *magit-process* buffer
is also shown that isn't really necessary, but it also does no harm.
magit-init: use magit-run-git

In `magit-init' use `magit-run-git' instead of the more low-level
`magit-run-git*'.

The latter should only be used in special cases, and should otherwise be
avoided.  Creating a repository now results in a refresh which is rather
pointless and has no effect because there cannot be any buffers to
refresh yet.  On the other hand checking whether anything has to be
refreshed also isn't costly enough to actively avoid it in this case.
The benefit is that I will not once more have to think about whether
there actually a reason `magit-run-git*' is used :-)
magit-process-set-mode-line: rename from magit-set-mode-line-process
magit-process-unset-mode-line: new function
magit-process-set-mode-line: absorb utility function

Merge `magit-process-indicator-from-command'
into `magit-process-set-mode-line'.
magit-process-finish: new function

Create new function `magit-process-finish' from parts of `magit-run*'.
Later commits will merge code from `magit-process-sentinel' and thereby
remove duplication and accidental differences between how errors are
reported depending on whether the failed process is synchronous or not.
magit-process-sentinel: separate different concerns

This results in a bit of duplication, but that's
okay because this is an intermediate commit.
magit-process-sentinel: use magit-process-finish
magit-process-display-buffer: rename from magit-display-process

... for consistency with the other `magit-process-*' functions.
magit-process-display-buffer: add kludge for quick processes

Add a kludge to `magit-process-display-buffer' to avoid mistakenly
displaying the process buffer for asynchronous processes that have
already consumed their input very quickly.

This function is rather messed up.  Eventually I will fix the mess
I have created here properly.
magit-run-git-with-input: fake the synchronous process here

Only asynchronous processes can receive input.  So even if we want to
wait until the subprocess has finished we use an asynchronous process,
and then just loop until it is done.

Previously this was done in `magit-run*' but that caused that do be much
more complicated than it need be.  `magit-run-git-with-input' is much
more suitable so we do the looping here now.  (Actually `magit-run*'
also still supports looping, but that will change in few commits.)
magit-{run-git-with-logfile,process-logging-filter}: new functions

Only asynchronous processes can have a filter which we need to be able
to log to a file and send the output to *magit-process* too.  So when
we also want to wait until the subprocess has finished we use an
asynchronous process, and then just loop until it is done.

Now there is a dedicated function to this sort of thing.  This will
allow simplifying `magit-run*'.
magit-run*, magit-run-git*: drop FILTER argument

This argument was only used by `magit-run-bisect-git-bisect'
but that uses `magit-run-git-with-logfile' now.
magit-run*: with input always use pipe

When sending input to a process always use a pipe (otherwise that
depends on option `magit-process-connection-type').  We have done
that ever since issue #20 was "fixed" but not in all cases.

Previously we did so when sending input to a "synchronous" process
(which is an asynchronous process, but we wait until it is done
before returning), but not for asynchronous processes.  That didn't
makes any sense.

This might, or might not, fix #487.  (I am just guessing, I don't
have Windows and until someone who does, actually investigates the
root cause of that issue, guessing is all I can do.  Let's hope I
am guessing right.)
magit-run*: no longer support input to fake sync processes
magit-git-quote-arguments: new function
magit-run*: cosmetics
magit-run*: semantic scope fix
magit-process-sentinel: a real sentinel again

It is no longer necessary to use `apply-partially' to get a function
that can be used as sentinel.  The buffer in which the command was
invoked is now stored in the process object, so `magit-process-sentinel'
now get that information from there instead.
magit-process-set-mode-line: split arguments, cleanup