author | Junio C Hamano <gitster@pobox.com> | |
Sat, 15 Mar 2008 20:17:42 +0000 (13:17 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 16 Mar 2008 08:25:24 +0000 (01:25 -0700) | ||
commit | 0cb06644a569d92ea8b3b6e81bc8bd786d98920e | |
tree | ccbca86ce9cbc39d1bdf6a3d1ec5f8dda84f807b | tree | snapshot |
parent | 7092882c84269af287646294a151551c59170a64 | commit | diff |
rebase [--onto O] A B: omit needless checkout
This teaches "git rebase [--onto O] A B" to omit an unnecessary checkout
of branch B before it goes on.
"git-rebase" originally was about rebasing the current branch to somewhere
else, and when the extra parameter to name which branch to rebase was
added, it defined the semantics to the safest but stupid "first switch to
the named branch and then operate exactly the same way as if we were
already on that branch".
But the first thing the real part of "rebase" does is to reset the work
tree and the index to the "onto" commit. Which means the "rebase that
branch" form switched the work tree to the tip of the branch only to
immediately switch again to another commit. This was wasteful.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This teaches "git rebase [--onto O] A B" to omit an unnecessary checkout
of branch B before it goes on.
"git-rebase" originally was about rebasing the current branch to somewhere
else, and when the extra parameter to name which branch to rebase was
added, it defined the semantics to the safest but stupid "first switch to
the named branch and then operate exactly the same way as if we were
already on that branch".
But the first thing the real part of "rebase" does is to reset the work
tree and the index to the "onto" commit. Which means the "rebase that
branch" form switched the work tree to the tip of the branch only to
immediately switch again to another commit. This was wasteful.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase.sh | diff | blob | history |