magit.el: fix section nesting
magit.el: remove unnecessary nesting
magit-git-success: move definition
magit-git-failure: new function
Revert "`magit-ref-ambiguous-p': use `magit-git-success'"

This reverts commit bd45d184e6553686abbdd6ecc9c5a17b311a232c.
magit-ref-ambiguous-p: improve comment

... so that the code doesn't get "fixed" again.
magit-git-{exit-code,string,insert,lines}: flatten ARGS

Flatten the first level of ARGS, the arguments for git.
We already do the same for `magit-{run,call}git' and
the section insert macros.
Add a space between the cherry mark and the sha1

The output of `git cherry' looks like this:

    + cf1464f7b9 iommu: msm: always use 32-bit physical addresses
    + eea2a9eaa1 iommu: msm: simplify address discovery in secure register dump code
    + 5a9311887b iommu: msm: create some helper macros for generating register addresses
    + ac26cf1da3 iommu: msm: remove unused field from struct dump_regs_tbl_entry
    + b6cc994641 iommu: msm: dump some global registers on page faults

but in magit the `+' is currently squished up against the sha1:

    +b6cc994641 iommu: msm: dump some global registers on page faults
    +ac26cf1da3 iommu: msm: remove unused field from struct dump_regs_tbl_entry
    +5a9311887b iommu: msm: create some helper macros for generating register addresses
    +eea2a9eaa1 iommu: msm: simplify address discovery in secure register dump code
    +cf1464f7b9 iommu: msm: always use 32-bit physical addresses

This is inconsistent with the expected `git cherry' UI. It also causes
minor problems for people using custom commands that operate on a sha1
with `word-at-point' or similar since you also get the `+' with the
sha1.

Fix this by adding a space.
Use the correct face for cherry marks

Currently, the `magit-cherry-equivalent' and `magit-cherry-unmatched'
faces are applied incorrectly to the opposite case in
`magit-wash-log-line'. Fix this by swapping them.
Normalize sha1 length for commands that don't respect core.abbrev

Some commands (like `git cherry') don't respect core.abbrev. Fix this by
explicitly passing --abbrev=N (where N=core.abbrev when set).

Adapted-by: Jonas Bernoulli <jonas@bernoul.li>

Rename new utility functions and move their definitions.
Merge branch 'pr/more-abbrev-length-stuff2'
Merge branch 'pr/cherry-spacing'
magit-cherry-{unmatched,equivalent}: switch colors
magit-insert-cherry-help-lines: use the correct cherry face

This completes ed180639723e92b5f3d2ba2e9e3c5a16b278becc.
magit-status: replace SAME-WINDOW argument with SWITCH-FUNCTION

Even when `magit-status' is used non-interactively, the option
`magit-status-buffer-switch-function' should be respected.

Visiting the status buffer of a submodule using `magit-visit-item' may
now behave differently.  When invoked with a prefix argument it still
enforces that another window is used.  But without a prefix argument the
decision is left to `magit-status-buffer-switch-function' (which may
also be configured to use another window, causing the prefix argument to
have no effect).

Close #1196.
magit-git-{true,false}: new functions
magit-bare-repo-p: new function
magit-file-relative-name: sanitize
magit-get-top-dir: also function inside git control directory
don't pass default-directory to magit-get-top-dir

Because `default-directory' is used as the default when no FILE is
explicitly specified.