Commit Briefs

86b603da30 Neels Hofmeyr

patience: do not swallow identical neighbors (neels/patience2)

This does not make much sense, because if common-unique lines swallow their neighboring ones, they count less, and another bad, shorter sequence may gain more weight than a very long sequence that was combined to just one common-unique chunk. It also much simplifies the code and avoids bugs we had to implement complex fixes for before.


df581e4b0e Stefan Sperling

set diff box recursion limit to UINT_MAX by default

In practice, recursion is already limited by our Myers max-effort cut and this heuristic should generally provide a better split than a limit on the number of diff boxes. A recursion limit is only required for diff configs that do not include the Myers algorithm, which we currently don't have. Discussed with Neels


60c6aae16f Stefan Sperling

set a minimum myers effort limit to avoid an early short-cut on small files

discussed with Neels


e4c510c1d8 Stefan Sperling

allow for telling the difference between empty and non-existent files

Adjust labels used in diff output accordingly; non-existent files should have the label "/dev/null"




fe6d58fb52 Christian Weisgerber

add a missing include for uint8_t and switch from <inttypes.h> to <stdint.h>

ok millert stsp


ab378e1f5d Stefan Sperling

fix patience diff assertion failure exposed by test122


d108549297 Stefan Sperling

add a test case which triggers an assertion in diff -P


c285a1f8b9 Stefan Sperling

add another test case where a context line appears as both - and +

This line appears as a context line with regular diff(1) and git diff: crd->crd_key = sd->mds.mdd_crypto.scr_key[0]; [[[ + crd->crd_alg = sd->mds.mdd_crypto.scr_alg; + crd->crd_klen = sd->mds.mdd_crypto.scr_klen; crd->crd_key = sd->mds.mdd_crypto.scr_key[0]; - bcopy(&blk, crd->crd_iv, sizeof(blk)); + memcpy(crd->crd_iv, &blkno, sizeof(blkno)); ]]] Our diff produces a different result where this context line is both deleted and added: [[[ - crd->crd_alg = CRYPTO_AES_XTS; + crd->crd_alg = sd->mds.mdd_crypto.scr_alg; + crd->crd_klen = sd->mds.mdd_crypto.scr_klen; + crd->crd_key = sd->mds.mdd_crypto.scr_key[0]; + memcpy(crd->crd_iv, &blkno, sizeof(blkno)); + } - switch (sd->mds.mdd_crypto.scr_meta->scm_alg) { - case SR_CRYPTOA_AES_XTS_128: - crd->crd_klen = 256; - break; - case SR_CRYPTOA_AES_XTS_256: - crd->crd_klen = 512; - break; - default: - goto unwind; - } - crd->crd_key = sd->mds.mdd_crypto.scr_key[0]; - bcopy(&blk, crd->crd_iv, sizeof(blk)); - } - crwu->cr_wu = wu; - crwu->cr_crp->crp_opaque = crwu; - return (crwu); ]]]





e638575c92 Neels Hofmeyr

assertions fixup: unused var for non-debug



7280e29c8e Neels Hofmeyr

remove a bunch of overly verbose debug



c672cd5263 Neels Hofmeyr

add test020


486215cf28 Neels Hofmeyr

undup code to add result chunks


4861c9da86 Neels Hofmeyr

add sanity assertions around adding result chunks

uncovers errors related to placing minus chunks above already added plus chunks.


6303eedc56 Stefan Sperling

add strlcat and strlcpy compat functions for Linux


6c6e6e508e Neels Hofmeyr

add test117



46093fc37f Neels Hofmeyr

remove stray blank line


10ae3a6560 Neels Hofmeyr

patience debug