Commits


optimize diff_atom_same(): if hashes differ, return false


reflect ignore-whitespace in atom hash


patience: use qsort


patience: optimize: less diff_atom_cmp() via hash


fix patience iteration error; also makes dramatically faster


debug: patience: mark unique debug


diff_atom_cmp: no special case for ignore whitespace when both atoms empty


debug fix: missing space


cache kd_buf in struct diff_state to avoid repeated allocation + free


fix build with PROFILE=1


patience: make it easy to switch impls for mark_unique


fix myers_divide max-effort cut, wrong x for backwards coordinate


add test019 showing max-effort bug


debug output fixes - fix compilation error with DEBUG 1, after moving patience state out of diff_atom, and after renaming diff_data.d to diff_data.root. - add some missing newlines. - also debug "HIT" on a max-effort cut, like when finding a mid snake, which eases finding all the places where boxes get cut.


fix off-by-one in the off-by-one fix made in bdfcb086


don't require both + and - chunks in diff_chunk_context_load_change()


fix off-by-one access beyond mapped file in diff_data_atomize_text_lines_mmap() Thread 1 received signal SIGSEGV, Segmentation fault. 0x0000013992a89eca in diff_data_atomize_text_lines_mmap (d=0x13b9b455668) \ at /home/stsp/src/got/got/../lib/diff_atomize_text.c:134 134 if (line_end[0] == '\r' (gdb) p pos $1 = (const uint8_t *) 0x13be402006d "" (gdb) p end $2 = (const uint8_t *) 0x13be4023000 <error: Cannot access memory at \ address 0x13be4023000> (gdb) p end-1 $3 = (const uint8_t *) 0x13be4022fff "" (gdb) p line_end $4 = (const uint8_t *) 0x13be4023000 <error: Cannot access memory at \ address 0x13be4023000>


search for prototypes above, not at, the first line touched by the diff chunk


add support for showing function prototypes in unidiff hunk headers


don't hex-escape non-printable ASCII in diff_output_lines(); UTF-8 must pass


fix missing allocaion failure check in diff_algo_patience()


add diff_chunk_context_load_change() for use with diff_output_unidiff_chunk()


revert db941c24; callers would also need private structs for that idea to work


avoid printing the --- +++ diff header in diff_output_unidiff_chunk()


fix another format string issue in results_test.c Cast ARRAYLIST_IDX result to unsigned long and use %lu in the format string. Clang 10.0.1 complained as follows: results_test.c:148:9: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] ARRAYLIST_IDX(c, result->chunks), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~