magit.el: move 'thingatpt requirement to rebase-mode.el

The function requiring 'thingatpt (`word-at-point') was introduced in
commit 25b5f6e3 and the requirement was added in commit 94c5890b to fix
byte-compilation, but when the function was replaced with
`grep-tag-default' in commit 3e38693f, the `require' remained in place.

The only remaining user of 'thingatpt functionality is rebase-mode.el,
which uses `thing-at-point' in `rebase-mode-looking-at-exec',
`rebase-mode-looking-at-killed-exec' and `rebase-mode-exec'.

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-{sha1-abbrev,log-cutoff}-length' are ints, so treat them as such

Since `magit-sha1-abbrev-length' and `magit-log-cutoff-length'
are integers, the format string token should be %d instead of %s.

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit--branches-for-remote-repo': simplify

By moving the bulk of the work to git-branch(1), we can do away with
some ugly string matching.  Performance-wise, it's pretty much a no-op,
but then again, I haven't been able to test it with a remote which has a
ridiculous amount of branches.

Now if only the function were actually used anywhere...
(conceived in 5bfb2164, employed in 73f25ef4, retired in 2107722b)

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-key-mode-popup-logging': remove "-ab" switch

The "-ab" switch is functionally equivalent [*] to "=b*",
so why clutter the popup with it?

[*] Try:
    $ diff <(git log --branches) <(git log --branches=*)

Reverts commit 664737c2

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-list-interesting-refs': differentiate vars in `for' clauses

Commit 992bb2f8 was a fantastic bit of cleanup, but using a different
variable name in the second `for' clause would have been even better.

Signed-off-by: Pieter Praet <pieter@praet.org>
magit.el: cleanly support aborting a merge operation

Commit 6a5289df added support for aborting a merge operation, but did so
in a rather hacky way, not to mention it broke rebasing.

Rebasing was fixed in commit 33f9372b, but still, could've been cleaner.

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-list-repos{,*}': cleanup

- `magit-list-repos':
  - Call `magit-list-repos*' with LEVEL^WDEPTH arg
    `magit-repo-dirs-depth' instead of 0.
  - Replace `apply', `append', `mapcar' crap with `cl-loop'.

- `magit-list-repos*':
  - Rename LEVEL arg to DEPTH, and decrement it until 0 instead
    of incrementing and comparing to `magit-repo-dirs-depth'.
  - Add docstring.
  - Always return absolute paths.
  - Do the least expensive checks first.
  - Replace string manipulation and comparison with C built-in `member'.
  - Replace `apply', `append', `mapcar' crap with `cl-loop'.

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-log': remove optional EXTRA-ARGS arg

Added in commit 0a9bf300, was used for passing extra options to
git-log(1), but we no longer have any callers that pass more than
one arg to `magit-log'.  This also allows us to replace the
`append' + `list' with `cons', as is used in `magit-log-long'.

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-merge': correct docstring

Commit bdebdfcf consolidated `magit-{manual,automatic}-merge' into
`magit-merge' but neglected to update its docstring (which had been
wrong to begin with, since commit 9522698c).

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-automatic-merge': remove

It's pretty much a duplicate of `magit-merge'.

The only differences are that it uses `magit-read-rev' +
`magit-guess-branch' instead of `magit-read-rev-with-default',
and it doesn't pass `magit-custom-options' to `magit-run-git'.

Also, it's no longer in use: Added in 7dce8dc8, removed in bdebdfcf,
re-added in 08ebe7df as a fix for issue #57, retired in 60a35bc2.

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-merge': absorb `magit-manual-merge'

`magit-merge' was only called when `magit-rigid-key-bindings' == t
(does anybody even use that?), in which case `magit-manual-merge'
should have been called instead anyway (see commit dbd213ec).

`magit-merge' now defaults to `magit-manual-merge's behavior, but still
allows to skip editing the log message using the optional arg DO-COMMIT.

The new arg is mainly there to support skipping `magit-log-edit'
programmatically though, since humans will most likely be better off
just tapping "C-c C-c" in "*magit-edit-log*" instead of having to think
about it in advance.

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-merge': warn before starting merge in a dirty worktree

From the git-merge(1) man page:
  #+begin_quote
    *Warning*: Running 'git merge' with non-trivial uncommitted changes
    is discouraged: while possible, it may leave you in a state that is
    hard to back out of in the case of a conflict.
  #+end_quote

Signed-off-by: Pieter Praet <pieter@praet.org>
Merge pull request #748 from praet/cleanup
Merge pull request #758 from praet/merge-warn-dirty

Conflicts:
	magit-key-mode.el