Patch Set 4:

Rebased.

Dariusz, any chance to review this? I tried several combinations of staged/non-staged changes and for me, the selection is right in the commit dialog. Do you have a scenario that shows the problems mentioned above?