diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-08-12 09:47:39 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-08-12 09:47:39 -0700 |
commit | dd610aeda684e42d3933a719cbd59ffbcdfdbcaa (patch) | |
tree | 3001212a96785e66a7d82e18116badd5007bc0ef /revision.c | |
parent | 3787e3c16ced0e3a614766dfbb55f8cbd70762c1 (diff) | |
parent | b3dfeebb92630c54db1e4f03dbcff0e05208c4c1 (diff) | |
download | git-dd610aeda684e42d3933a719cbd59ffbcdfdbcaa.tar.gz git-dd610aeda684e42d3933a719cbd59ffbcdfdbcaa.tar.xz |
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.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/revision.c b/revision.c index 15873bf24..8a29cb03c 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); |