Merge branch 'kw/patch-ids-optim'
authorJunio C Hamano <gitster@pobox.com>
Fri, 12 Aug 2016 16:47:39 +0000 (09:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Aug 2016 16:47:39 +0000 (09:47 -0700)
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

1  2 
builtin/log.c
diff.c
revision.c
diff --cc builtin/log.c
Simple merge
diff --cc diff.c
index b43d3dd2ecb7b2154ce6c445983e23ce89c69111,bb816d9cba6a8b46130251570fa425ff423f2ea1..534c12e28ea8b077c9fa305a634f7a73cf30589d
--- 1/diff.c
--- 2/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;
                }
  
diff --cc revision.c
Simple merge