rebase: disable fork-point by default
authorFelipe Contreras <felipe.contreras@gmail.com>
Tue, 13 May 2014 23:11:58 +0000 (18:11 -0500)
committerFelipe Contreras <felipe.contreras@gmail.com>
Tue, 13 May 2014 23:22:35 +0000 (18:22 -0500)
commit0e59c7f2eef2e675098b4412ff0f65f0023126e8
tree12391f9f06307757dbc66afde83fbdfcb94e389b
parenta7000a9bec7f9245a036921a1c95a46a75f00c70
rebase: disable fork-point by default

It is possible that the upstream branch was at some point in the wrong
commit. The user might do 'git reset --hard' to restore that branch to
the right place, the wrong location is already in the reflog.

If the user tries to do a rebase without arguments the fork-point
feature will be used automatically and the wrong point in the reflog
used as one of the possible heads to check for bases.

This is especially bad when upstream was already in the same place as
the current branch (say upstream was fast-forwarded to topic by
mistake), in which case the rebase would silently ignore all the commits
and reset to upstream. The user would wonder what happened with his
commits, or worst; assume they were already in upstream.

This is a very bad situation we should try to avoid.

We cannot rely on the fact that the reflog will always contain only
good heads, therefore the fork-point should be disabled by default.

The fork-point feature is still useful, but it should be enabled
manually, only when the user knows what he is doing, and that all the
points in the reflog of the upstream branch are desirable.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
git-rebase.sh
t/t3400-rebase.sh