Commit Briefs

9f5da0913a tj

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@



f400825bc6 Omar Polo

make diff_atom_hash_update private to diff_atomize_text.c

ok stsp@




c16dde50bb Stefan Sperling

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.



6c8c5d3f0b Neels Hofmeyr

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).


60b6e08bf7 Neels Hofmeyr

patience: use qsort to optimize finding unique lines


0c70b22b8b Neels Hofmeyr

cosmetic: indents in diff_main.h