Commits


make diff_chunk_type() public and clarify comment As discussed with stsp, reword an easily misunderstood comment, and move diff_chunk_type() into the public diff API to improve caller efficiency. ok stsp@


diff: Add API for consumers to check if diff is printable Programs using the libdiff API they can need to know if the diff contained anything that would be printed, or would be empty. Expose the same check that the output functions do as a function call. ok stsp@


revert previous; got lib/blame.c needs diff_atom_hash_update()


make diff_atom_hash_update private to diff_atomize_text.c ok stsp@


handle binary files like diff(1) does; new -a option forces text


expose struct diff_atom in public API for external atomizer implementations


allow diff API users to atomize files separately This is a breaking API change (not that we care about that at this point). This can avoid redundant work spent on atomizing a file multiple times. There are use cases where one particular file must be compared to other files over and over again, such as when blaming file history. The old API gave access to both versions of the file to the atomizer just in case a future atomizer implementation needs this. This can still be achieved by passing a second file via the atomizer's private data pointer.


add support for showing function prototypes in unidiff hunk headers


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


cosmetic: indents in diff_main.h


move headers from include/diff/ to include/; makes things easier for consumers