summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ea02eef)
raw | patch | inline | side by side (parent: ea02eef)
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) |
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>
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 | patch | blob | history |
diff --git a/revision.c b/revision.c
index e75079a6e1316c74b4dff702170134dc7559898f..c2fad2fd7e7d83e3cd74faad34ba9427641bef50 100644 (file)
--- a/revision.c
+++ b/revision.c
right_count++;
}
+ if (!left_count || !right_count)
+ return;
+
left_first = left_count < right_count;
init_patch_ids(&ids);
if (revs->diffopt.nr_paths) {