diff options
author | Jeff King <peff@peff.net> | 2009-11-16 19:02:02 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-11-17 00:21:12 +0300 |
commit | 8282de94bc76360e0bf76da4076755696b049d23 (patch) | |
tree | 3dbea786126759feeedb8116c114375669d97555 /diffcore-rename.c | |
parent | f4f19fb63449e1beee02b0ec845319f7115fa9d0 (diff) |
diffcore-break: save cnt_data for other phases
The "break" phase works by counting changes between two
blobs with the same path. We do this by splitting the file
into chunks (or lines for text oriented files) and then
keeping a count of chunk hashes.
The "rename" phase counts changes between blobs at two
different paths. However, it uses the exact same set of
chunk hashes (which are immutable for a given sha1).
The rename phase can therefore use the same hash data as
break. Unfortunately, we were throwing this data away after
computing it in the break phase. This patch instead attaches
it to the filespec and lets it live through the rename
phase, working under the assumption that most of the time
that breaks are being computed, renames will be too.
We only do this optimization for files which have actually
been broken, as those ones will be candidates for rename
detection (and it is a time-space tradeoff, so we don't want
to waste space keeping useless data).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diffcore-rename.c')
0 files changed, 0 insertions, 0 deletions