Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
diff-index: pass pathspec down to unpack-trees machinery
author
Junio C Hamano
<gitster@pobox.com>
Mon, 29 Aug 2011 20:34:08 +0000
(13:34 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 29 Aug 2011 22:09:17 +0000
(15:09 -0700)
And finally, pass the pathspec down through unpack_trees() to traverse_trees()
callchain.
Before and after applying this series, looking for changes in the kernel
repository with a fairly narrow pathspec becomes somewhat faster.
(without patch)
$ /usr/bin/time git diff --raw v2.6.27 -- net/ipv6 >/dev/null
0.48user 0.05system 0:00.53elapsed 100%CPU (0avgtext+0avgdata 163296maxresident)k
0inputs+952outputs (0major+11163minor)pagefaults 0swaps
(with patch)
$ /usr/bin/time git diff --raw v2.6.27 -- net/ipv6 >/dev/null
0.01user 0.00system 0:00.02elapsed 104%CPU (0avgtext+0avgdata 43856maxresident)k
0inputs+24outputs (0major+3688minor)pagefaults 0swaps
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-lib.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
40e3725
)
diff --git
a/diff-lib.c
b/diff-lib.c
index 9c29293bbc05d175ba13338813e8532c7ad677cf..12760b422f83e0c08d4ad9af5419318e9d47bcaa 100644
(file)
--- a/
diff-lib.c
+++ b/
diff-lib.c
@@
-463,6
+463,7
@@
int run_diff_index(struct rev_info *revs, int cached)
opts.unpack_data = revs;
opts.src_index = &the_index;
opts.dst_index = NULL;
+ opts.pathspec = &revs->diffopt.pathspec;
init_tree_desc(&t, tree->buffer, tree->size);
if (unpack_trees(1, &t, &opts))