magit/magit — pull request #286 by ndreys (2011-11-04 11:37:52+00:00)
Title: Fix the logic of `magit-log-edit' function.

Previous version of `magit-log-edit' had two issues:
1. It didn't support splitting of commits, for example, here's the
workflow in question:

C-c g some-git-repo
M-x magit-interactive-rebase (to some old to be splitted commit)

x HEAD^

or, just for clarity's sake, its command-line equivalent:

cd some git-repo
git rebase -i

git reset HEAD^

When then `magit-log-edit' was called in the middle of the ongoing
rebase, by typing "c" in the status buffer it would suggest to
continue it(rebase) and exit silently on user's refusal to do so. If
you were to answer "yes" to the proposal magit would try to continue
the rebase, fail miserably at said task and stop. So, it is easy to see
that after not so long a struggle you would find yourself in a Catch-22
type of a situation:
- You need to commit changes in order to continue the rebase
- You need to finish rebase in order to commit anything

New version addresses that problem by always ignoring ongoing rebase
and performing commit if the repository is dirty. And suggesting to
continue the rebase only if it is clean.

2. It somewhat ignored user's refusal to commit all unstaged changes
or stage them all and then commit. The code in the old version of the
function would still call `(magit-pop-to-log-edit "commit")' even if
user answered "no" to the asked questions.

This version hopefully addresses that too.