magit-log-{*}-re: support empty commit messages
magit-with-temp-index: sanitize
magit-commit-tree: add optional TREE argument

If it isn't provided still use `git write-tree'
to create a tree from the index.
magit-commit-worktree: add optional OTHER-PARENTS argument

"HEAD" is always the first parent.
magit-commit-worktree: fail if the index cannot be updated
magit-update-files: new function
magit-untracked-files: add optional ALL argument
magit-{modified,staged,untracked}-files: add NOMODULES argument
magit-stash-{apply,pop}: always try to reinstate index

And when that fails then properly fallback to not doing it.
In that case only apply the stash, don't drop it.
magit-stash-{drop,branch}: remove git cmdline from doc-strings
magit-stash-drop: properly abort if user cancels
magit-stash-clear: new command
magit-reflog-enable: prevent undead reflog entries

Git makes it quite hard to create a reflog for a ref not covered by
core.logAllRefUpdates.  If we are not carefull we end up with reflogs
that cause `git reflog' to output an undead trailing entry.
do not rely on `git stash' to create stashes

Add plumbing functions `magit-stash-create', `magit-stash-store' and
`magit-stash-save' and use them instead of `git stash' subcommands.
These functions use only Git plumbing commands and give us more
flexibility than hacking around the limitations of the `git stash'
porcelain.

Rename existing commands for creating snapshot stashes so that their
names begin with "magit-snapshot".  Add new snapshot and on-demand
stash commands.  Add several utility functions.  Adjust the popup.
add new library magit-stash.el
magit-stash-list: new command

Add new command `magit-stash-list' and the required boilerplate
consisting of `magit-stashes-mode', `magit-stashes-refresh-buffer'
and `magit-stashes-buffer-name-format'.
magit-stash-show: new command

Add new command `magit-stash-show' and the required boilerplate
consisting of `magit-stash-mode', `magit-stash-refresh-buffer',
`magit-stash-buffer-name-format', `magit-insert-stash-index',
`magit-insert-stash-worktree' and `magit-insert-stash-untracked'.

Teach `magit-diff-type', `magit-diff-scope' and `magit-diff-highlight'
about the new section types used by the above inserters.

Remove `magit-diff-stash' which only showed a single diff which isn't
sufficient to show a stash.
use stashes to backup uncommitted changes

Add a new backup mechanism which uses stashes to saving uncommitted
changes, replacing the old mechanism which used patch files.  This
preserves more information and also makes it easier to restore
discarded changes.

Implement this in the new library `magit-backup.el', but most of the
heavy lifting is done in `magit-stash.el'.  Some of the functions
defined there are generalized so that they are no longer restricted
to refs/stash.

Backups are automatically created before making changes to the index or
working tree.  Where the old mechanism created a backup, the new one
does to, there might be other places where it would make sense to do so.
Merge branch 'n/elisp-stash' into next