author | Thomas Rast <trast@student.ethz.ch> | |
Sat, 20 Feb 2010 11:42:04 +0000 (12:42 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 20 Feb 2010 18:33:11 +0000 (10:33 -0800) | ||
commit | 36c079756f9f3ad0bbbe2097550c62427670146b | |
tree | ca9ed8e8cc0288cd5af0c71f64f33f740dfb3826 | tree | snapshot |
parent | ea02eef096d4bfcbb83e76cfab0fcb42dbcad35e | commit | diff |
cherry_pick_list: quit early if one side is empty
The --cherry-pick logic starts by counting the commits on each side,
so that it can filter away commits on the bigger one. However, so
far it missed an opportunity for optimization: it doesn't need to do
any work if either side is empty.
This in particular helps the common use-case 'git rebase -i HEAD~$n':
it internally uses --cherry-pick, but since HEAD~$n is a direct
ancestor the left side is always empty.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The --cherry-pick logic starts by counting the commits on each side,
so that it can filter away commits on the bigger one. However, so
far it missed an opportunity for optimization: it doesn't need to do
any work if either side is empty.
This in particular helps the common use-case 'git rebase -i HEAD~$n':
it internally uses --cherry-pick, but since HEAD~$n is a direct
ancestor the left side is always empty.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c | diff | blob | history |