Commits


fix performance issues in the search for function prototypes with + ok naddy


expose struct diff_atom in public API for external atomizer implementations


cache kd_buf in struct diff_state to avoid repeated allocation + free


add support for showing function prototypes in unidiff hunk headers


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


put functions required for using diff_output_unidiff_chunk() into public API They will be needed to implement 'got stage -p' and 'got revert -p', etc. Chunks stored in diff_result still need post-processing in order to be displayed as expected by diff_output_unidiff_chunk(). Exposing these functions allows API consumers to implement the same chunk merging loop as used internally by output_unidiff() and output_edscript(). (Perhaps, ideally, the public diff API would provide pre-merged chunks at some point in the future? Then this commit could probably be reverted.) Change return values from bool to int to avoid making stdbool.h a requirement for the public diff API.


expose chunk_context_empty() via diff_internal.h and use it in edscript output


print "\ No newline at end of file" message like UNIX diff(1) does Not adding new tests since this behaviour is covered by tests in Got.


in ed output mode, show changed lines as XXcYY etc. as UNIX diff(1) does


move patience data out of struct diff_atom Now allocating patience specific data only when patience is going to be used. This may allow using forward-Myers more often, since the state size per line is significantly smaller. Patience instead allocates an array, puts it in the current diff_data, and also place a pointer of the current diff_data in the root diff_data (since each atom points to the root diff_data).


patience: use qsort to optimize finding unique lines


rename diff_atom->d to diff_atom->root, because it always is The idea was that for each diff box within the files, the atoms would have a backpointer to the current layer of diff_data (indicating the current section), but it is not actually needed to update the backpointer in each atom to the current diff_data. That is why the current code always points atom->d to the root diff_data for the entire file. Clarify by proper name. Constructs like atom->d->root->foo are redundant, just use atom->root->foo.


add results_test.c


optionally provide information about the generated diff to the API user


move some definitions from the public diff_main.h to an internal header file