collect apply functions in a common section

Collect all concrete (type specific) implementations of
`magit-apply-item' in the same section "Acting">"Apply"; where
`magit-apply-item' and one of the type specific implementations,
`magit-apply-commit', were already defined.

Actually moved are `magit-apply-diff-item', `magit-apply-hunk-item',
`magit-apply-hunk-item*', and `magit-apply-hunk-item-reverse', which
were all previously defined in "Diffs and Hunks">"(apply)".
split "Diffs and Hunks" section in two

Split the toplevel section "Diffs and Hunks" into two new toplevel
sections.

* New "Diff Options" is concerned with the arguments passed to `git
  diff' to tune some details.  This is related to "washing" insofar as
  it effects the output being washed - but the act of toggling options
  does not change the fact that washing has to be able to deal with all
  of the options we provide.

* New "Diff Washing" only contains functionality directly related to
  the washing of diffs.  It fills the same role as the existing "Log
  Washing", just for diff output, not log output.  "Hunk" no longer
  appears in the section heading, because it is obvious that washing
  a diff involves washing hunks.
move definition of magit-wash-diff

Place the definition of `magit-wash-diff' in between the definitions of
`magit-wash-diffs' and `magit-wash-other-file'.  `magit-wash-diffs' is
the only caller of the other two functions.
merge three preliminary subsections of "Hunks and Diffs"

Merge the preliminary subsections "wash diffs", "wash diffstats", and
"wash top-section" into just one subsection "wash diffs".  Now that some
cleanup in this area has happened it is no longer helpful to keep them
separate.  Also the splitting wasn't really correct.

The functions in this subsection still need to be sanitized.  How
functionality is split between appears to somewhat arbitrary.
disband preliminary section "(hunk refinement)"

Move `magit-toggle-diff-refine-hunk' into "Diff Options", has it is
concerned with the highlevel aspect of the user turning this off or
on.  Do to the actual work it used the below functions.

Move `magit-diff-{,un}refine-hunk' into the "(wash hunks)" section.
give subsections of "Diff Washing" better names
Merge branch 'spread-Diffs'
add "Log Line Struct" subsection to toplevel "Log Washing"
add "Section Struct" subsection to toplevel "Sections"
`magit-process-keep-history': optionally don't clear the process buffer

Most calls to `magit-run*' don't set its NOERASE arg to a non-nil value,
so the process buffer is cleared pretty much every time we run a command
that makes use of `magit-run*'.

However, sometimes it's useful to be able to refer back to the log
of recent Git commands (and their output), e.g. when cleaning up stale
remote-tracking branches after having fetched with the "--prune" flag.

Now we can prevent the process buffer from ever being cleared by setting
`magit-process-keep-history' to a non-nil value. To improve readability,
individual command invocations will be delimited with an empty line.

Signed-off-by: Pieter Praet <pieter@praet.org>
add magit-section-content-beginning
remove unnecessary function magit-hunk-item-diff

The parent section of a `hunk' is always a `diff'.  Function
`magit-hunk-item-diff' is therefor unnecessary.  All it did was assert
that this is indeed the case.  By removing this assert we only risk that
a user reports a harder to diagnose error message, but if that ever
happens it should be doable.  Besides I cannot remember that there ever
was a report Magit complained "Huh?  Parent of hunk not a diff".
magit-wash-raw-diff: basic support for all diff states

If a state is encountered that is even more unknown than
`git diff's "unknown" (X) state then raise an error.
magit-wash-diffstat: remove comment and commented code

The comment was added in commit 293a7804b1b0b15614c0e4c826f9e70059e872ff
the commented code consists of the "removed" code and, so it seems, some
leftover experimental code.

The comment would have made a fairly good commit message, but as a
comment it does not fly with me.  Leaving the old code in the file but
comment it...
remove unused magit-diffstat-item-status
magit-wash-diff-section: replace a use of let* with let

In `magit-wash-diff-section' replace one unnecessary use of `let*' with
`let'.  This avoids confusion in the future about why `let*' was used in
the first place.  To keep the diff small replace "*" with a space,
instead of removing it.  This avoids having to reindent the whole thing,
resulting in a rather larger diff, for no good reason.
merge magit-wash-diff-or-other-file into its only caller

Merge `magit-wash-diff-or-other-file' into its only caller
`magit-wash-diffs', both of which are very simple - no need
to split that any further.
magit-wash-raw-diff: use `1+'
make variable magit-last-raw-diff unnecessary

Remove the variable `magit-last-raw-diff'.  It was let-bound inside
`magit-wash-raw-diffs' so that one call to `magit-wash-raw-diff' could
"pass" it to the next call.  We can get the same effect by having the
latter return the current file and receive the previous file as an
actual argument.
make variable magit-ignore-unmerged-raw-diffs unnecessary

Instead of let binding `magit-ignore-unmerged-raw-diffs' inside
`magit-staged-changes' call `magit-wash-raw-diffs' with its new STAGED
argument, which is then passed on to `magit-wash-raw-diff' which happens
to be the only place where this information is relevant.  (And
`magit-staged-changes' is the only case where we have to toggle this
switch; hence the argument name "STAGED".