DESCRIPTION

Do not allow rebase if there are uncommitted changes

With this change egit checks for uncommitted changes before a rebase is
started. The user can choose from a dialog how to handle this situation.
In a further change we could offer the feature to automatically re-apply
the stashed change after finishing or aborting the rebase.

Note that this change is done in EGit. Therefore the Pull operation is
not affected.

Bug: 422352
Change-Id: I7e7878daa67d3316863b6ebbc40f61fad0460aa0
Signed-off-by: Carlie Harper xxx@xxx.xxx

COMMENTS

author: Carlie Harper
date: 2013-11-26 16:23:59.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2013-11-26 16:24:04.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/5375/

-------------------------------------
author: Brenden Conley
date: 2013-11-26 16:44:02.000000000

Patch Set 2: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/egit/job/egit.gerrit/5375/ : UNSTABLE

-------------------------------------
author: Danika Greer
date: 2013-11-26 18:09:57.000000000

Patch Set 2: Code-Review-1

I'm giving -1, even though I would like to give -2 here.

I'm in favor of doing the check only when starting an interactive rebase.

-------------------------------------
author: Douglas Trujillo
date: 2013-11-26 22:50:02.000000000

Patch Set 2: Code-Review-1

(1 comment)

looks good to me (except style nit)

I am strongly convinced we should stay on the safe side and make this safety check also for non-interactive rebase. I don't want any user to unnecessarily
loose any of his work because of a skipped check in egit. 

Maybe advanced users like you could use it but I think it's not really necessary to accept this risk if we enhance this proposal with the following additional improvements:
- add an option to automatically stash / pop stash before/after rebase
- add another option to automatically use this option without asking the user

I think from the user's point of view this should be equivalent to the old implementation without risking data loss in case the user aborts the rebase.

Also, if we don't allow rebase with a dirty tree, we can be sure that users which use both EGit and native git on the same repository don't confuse native git with a situation it doesn't expect.

We should also enhance (in another change) the dialog to show the list of dirty file paths in a compact tree representation like we do in the staging view

Line:114, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/AbstractRebaseCommandHandler.java -> style nit: no braces around single line block

-------------------------------------
author: Danika Greer
date: 2013-11-26 23:15:49.000000000

Patch Set 2:

> add an option to automatically stash / pop stash before/after rebase
> add another option to automatically use this option without asking the user

+1. With these additions, I'm in favor of this change, as it will give us safety without losing convenience.

For implementing this: Would stash pop at the end also work if the rebase was aborted or had conflicts? We would have to somehow associate the stash with *this* rebase, right? Any idea how to do this?

-------------------------------------
author: Carlie Harper
date: 2013-11-27 08:05:25.000000000

Patch Set 2:

> For implementing this: Would stash pop at the end also work
> if the rebase was aborted or had conflicts? We would have 
> to somehow associate the stash with *this* rebase, right?
> Any idea how to do this?

The simplest idea I can think of it that we use a fix stash commit message.

-------------------------------------
author: Zachary Orozco
date: 2013-11-27 08:19:19.000000000

Patch Set 2: Code-Review+1

+1 also for me for the idea of an automated stash/pop.

But one comment: That we lost some unsaved changes during a rebase abort is a severe bug which we have to track anyhow. I think we did some wrong checkout's after a rebase abort and I will hunt for this. It is not intrinsic to a a rebase abort that you'll loose unsaved changes if you have started with a dirty state.

-------------------------------------
