summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-08-12 16:47:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-12 16:47:39 (GMT)
commitdd610aeda684e42d3933a719cbd59ffbcdfdbcaa (patch)
tree3001212a96785e66a7d82e18116badd5007bc0ef /revision.c
parent3787e3c16ced0e3a614766dfbb55f8cbd70762c1 (diff)
parentb3dfeebb92630c54db1e4f03dbcff0e05208c4c1 (diff)
downloadgit-dd610aeda684e42d3933a719cbd59ffbcdfdbcaa.zip
git-dd610aeda684e42d3933a719cbd59ffbcdfdbcaa.tar.gz
git-dd610aeda684e42d3933a719cbd59ffbcdfdbcaa.tar.bz2
Merge branch 'kw/patch-ids-optim'
When "git rebase" tries to compare set of changes on the updated upstream and our own branch, it computes patch-id for all of these changes and attempts to find matches. This has been optimized by lazily computing the full patch-id (which is expensive) to be compared only for changes that touch the same set of paths. * kw/patch-ids-optim: rebase: avoid computing unnecessary patch IDs patch-ids: add flag to create the diff patch id using header only data patch-ids: replace the seen indicator with a commit pointer patch-ids: stop using a hand-rolled hashmap implementation
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/revision.c b/revision.c
index 15873bf..8a29cb0 100644
--- a/revision.c
+++ b/revision.c
@@ -846,7 +846,7 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs)
*/
if (left_first != !!(flags & SYMMETRIC_LEFT))
continue;
- commit->util = add_commit_patch_id(commit, &ids);
+ add_commit_patch_id(commit, &ids);
}
/* either cherry_mark or cherry_pick are true */
@@ -873,21 +873,9 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs)
id = has_commit_patch_id(commit, &ids);
if (!id)
continue;
- id->seen = 1;
- commit->object.flags |= cherry_flag;
- }
- /* Now check the original side for seen ones */
- for (p = list; p; p = p->next) {
- struct commit *commit = p->item;
- struct patch_id *ent;
-
- ent = commit->util;
- if (!ent)
- continue;
- if (ent->seen)
- commit->object.flags |= cherry_flag;
- commit->util = NULL;
+ commit->object.flags |= cherry_flag;
+ id->commit->object.flags |= cherry_flag;
}
free_patch_ids(&ids);