From: Junio C Hamano Date: Fri, 12 Aug 2016 16:47:39 +0000 (-0700) Subject: Merge branch 'kw/patch-ids-optim' X-Git-Tag: v2.10.0-rc0~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dd610aeda684e42d3933a719cbd59ffbcdfdbcaa;p=thirdparty%2Fgit.git 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 --- dd610aeda684e42d3933a719cbd59ffbcdfdbcaa diff --cc diff.c index b43d3dd2ec,bb816d9cba..534c12e28e --- a/diff.c +++ b/diff.c @@@ -4534,12 -4518,17 +4531,19 @@@ static int diff_get_patch_id(struct dif len2, p->two->path); git_SHA1_Update(&ctx, buffer, len1); + if (diff_header_only) + continue; + + if (fill_mmfile(&mf1, p->one) < 0 || + fill_mmfile(&mf2, p->two) < 0) + return error("unable to read files to diff"); + if (diff_filespec_is_binary(p->one) || diff_filespec_is_binary(p->two)) { - git_SHA1_Update(&ctx, sha1_to_hex(p->one->sha1), 40); - git_SHA1_Update(&ctx, sha1_to_hex(p->two->sha1), 40); + git_SHA1_Update(&ctx, oid_to_hex(&p->one->oid), + 40); + git_SHA1_Update(&ctx, oid_to_hex(&p->two->oid), + 40); continue; }