avoid hard referencing of filecontent (including psi file in user data) in indexed stamp update runnable [r=Peter.Gromov]
(cherry picked from commit 22eb2449c657908bd8f0a86e7aab2b6ea74d1e96)
[git] IDEA-64583 read commit message from .git if "amend" is selected

Listen to "Amend commit" checkbox state change:
- if user selects it, read the commit message from
  .git/COMMIT_EDITMSG (and other .git/*MSG if they exist)
- remember the commit message which was in the editor before user
  clicked "Amend" to restore it if he clicked accidentally.
- do it in a modal task to avoid UI freeze if reading from file is slow.

(cherry picked from commit 7859049a205f9e3c84e494a24907494603699be6)
[git] Better fix for IDEA-64583 get message from git log -1 if amending

.git/COMMIT_EDITMSG can't be used for this purpose,
because it is not updated when switching branches.
We need to ask Git about the last message.

Call git log -1 --pretty="%s%n%n%-b" to get the commit message of the
last commit in the original format (subject + two newlines + body,
with newlines skipped if the body is empty).

Join commit messages if user is amending commit in several roots at
once. Maybe that's not what he wants (separate commits with separate
commit messages would be preferably), but let's keep it like that for
now.

(cherry picked from commit 38f3dc4b743c4f51d05fe633fd4d34a6d6fb5220)
[git] Save amended message to restore it if edited by user

If user selects "Amend commit", edits it and then accidentally
deselects the checkbox, the content after his edits is lost.
Preserve it, and restore if he returns to "amended".
This also lets avoid requesting Git several times for each
click to "Amend".

* Extract loading from Git in a modal task to a separate method.
* When the checkbox is deselected, remember commit area text to
myAmendedMessage.
* Restore it when the checkbox is selected again.

(cherry picked from commit dfcec99cb506344294533075447928acd9cd7bdb)
[log] IDEA-64583 Don't invokeAndWait from runProcessWithProgressSync

There is no need to call invokeAndWaitIfNeeded from
runProcessWithProgressSynchronously: just substituteCommitMessage
after runProcess... completes in the calling (EDT) thread.

Use runProcess... which returns value. Since it also throws an
exception, pass the possible VcsException to it. If it happens,
show an error message to the user.

(cherry picked from commit 1d7f430a465d12b7a8ebd1be5cd0ede66d641756)