Commit Briefs

e78a8d73c2 Mark Jamsek

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@


f26db7cd28 Mark Jamsek

add public APIs to enable chunk byte offset retrieval

Prompted by changes to conflict marker detection in got.git, add chunk offset getters for both left- and right-hand side files. This facilitates more efficient caller diff_result use by directly seeking to a given chunk rather than counting lines. ok stsp@


1dce05e8f9 Omar Polo

always cast ctype' is*() arguments to unsigned char

Almost all had already an unsigned argument (uint8_t or unsigned char), but cast anyway in case the types are changed in the future. ok stsp@



674563ab13 tj

Don't return errno when fread fails

fread doesn't consistently set errno on failure. - On OpenBSD fread sets errno on possible argument overflows, but this doesn't occur on other platforms. rfread doesn't set errno on EOF or other failures. - ferror does not set errno on failure. Returning errno here is possibly inconsistent. Return EIO here instead. ok stsp@


92698c5e98 tj

Remove duplicate definitions

ok op@


c737b93b77 tj

fread cannot return -1

fread returns a size_t and can never be -1. fread can signal parameter errors on some platforms, but this isn't portable. Remove this check and break out of the loop when fread returns 0. ok op@


4125b1eff8 tj

diff: handle missing new lines in trailing context

If there is a missing new line in the context we currently miss it and fail to print the warning. This trips up patch and leads to failures. Catch these cases in for unidiff output and add a test case. ok stsp@


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@




8993f42562 Mark Jamsek

improve accuracy of function prototype in hunk headers

Initial diff by Tom Jones with fixes from stsp. ok stsp@


9230203d37 Stefan Sperling

fix updating of line-offsets output info in plain output mode

reviewed by tom jones



1f690ebe65 Mark Jamsek

sync files from got.git 336075a42a5ae0fa322db734c481d21998e82bb8

ok tb@


7a38b3a33f Mark Jamsek

fix build broken in previous commit 35eae7fa6b782ae1

Macro line was wrapped without continuation character. ok tb@


35eae7fa6b Mark Jamsek

remove gcc ternary if extension

ok stsp@


b1aa94aab8 Stefan Sperling

add support for classic diff(1) output; patch by Tom Jones


9343b92549 Mark Jamsek

collect line type metadata when generating diff

Similar to line offsets, create an array of line types (i.e., hunk, context, minus, plus) for each line output in the diff. ok stsp@


e450035c85 Mark Jamsek

sync files from got.git 58e31a80da4f4a9e10eaea148672190f35107a47

ok stsp@



f400825bc6 Omar Polo

make diff_atom_hash_update private to diff_atomize_text.c

ok stsp@


cd9ef01a44 Omar Polo

reuse diff_atom_hash_update

ok stsp@


b9efd927c0 Omar Polo

less chatty regress

ok stsp@


9bf4a819c3 Omar Polo

regress: look for the diff prog also inside obj/

ok stsp@