OSDN Git Service

rebase -i: support --root without --onto
authorChris Webb <chris@arachsys.com>
Tue, 26 Jun 2012 21:55:23 +0000 (22:55 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Jun 2012 22:08:10 +0000 (15:08 -0700)
commitdf5df20c1308f936ea542c86df1e9c6974168472
tree55d02ad50947cd1a71709572095294106f19ed22
parentbc9e7dd41fe8b51cc7f2e79312a2ff777899f930
rebase -i: support --root without --onto

Allow --root to be specified to rebase -i without --onto, making it
possible to edit and re-order all commits right back to the root(s).

If there is a conflict to be resolved when applying the first change,
the user will expect a sane index and working tree to get sensible
behaviour from git-diff and friends, so create a sentinel commit with an
empty tree to rebase onto. Automatically squash the sentinel with any
commits rebased directly onto it, so they end up as root commits in
their own right and retain their authorship and commit message.

Implicitly use rebase -i for non-interactive rebase of --root without
an --onto argument now that rebase -i can correctly do this.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-rebase.txt
git-rebase--interactive.sh
git-rebase.sh