Commits
- Commit:
f8b2e31e52e55c61466d35304412e919227e6ae9
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
revert previous; got lib/blame.c needs diff_atom_hash_update()
- Commit:
f400825bc668466d9fc593470514d6e69ddfc5ff
- From:
- Omar Polo <op@omarpolo.com>
- Date:
make diff_atom_hash_update private to diff_atomize_text.c
ok stsp@
- Commit:
cd9ef01a441e0ecfd499bf907c15a2878f7e0ee2
- From:
- Omar Polo <op@omarpolo.com>
- Date:
reuse diff_atom_hash_update
ok stsp@
- Commit:
b9efd927c001e0ea11fac039d1d0849bcad14cab
- From:
- Omar Polo <op@omarpolo.com>
- Date:
less chatty regress
ok stsp@
- Commit:
9bf4a819c3a1cbd7d7962bf061cd2456660cd726
- From:
- Omar Polo <op@omarpolo.com>
- Date:
regress: look for the diff prog also inside obj/
ok stsp@
- Commit:
405e89a6da28edc7555666affbad86a823e2c460
- From:
- Omar Polo <op@omarpolo.com>
- Date:
adjust the expected output so that regress passes again
Note that test015 is still broken on OpenBSD with base patch(1).
ok stsp@
- Commit:
3a15e1807a369c0a7827363eca22c9f1a8598d9c
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
ARRAY_LIST allocation optimisation
Rather than realloc in fixed-sized blocks, use the 1.5 * allocated scheme
when growing the array. This produces fewer allocations and up to 3x speedup
on large diffs.
ok stsp@
- Commit:
ed9312f04bcebc7aee4f7e7d96d6ec467cb9bb66
- From:
- Omar Polo <op@omarpolo.com>
- Date:
fix accounting for line endings in CRLF files
There are two different subtles error in computing the end of line in
diff_data_atomize_text_lines (one in per implementation, _fd and _mmap)
that causes the '\n' of the '\r\n' case to be left out the current line.
It causes strange bugs when diffing CRLF files, such as printing the
"\ No newline at end of file" marker very often and showing the wrong
offsets in the hunk headers.
ok stsp@
- Commit:
b72f51ffc39028023059fc994542565691b669fa
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add missing line offset information for unidiff output
We forgot to generate line offset information for lines of the form:
"Binary files %s and %s differ"
Which is causing scrolling problems in tog's diff view.
ok thomas_adam
- Commit:
f1dbec24f9a9553e22659f6c592c91e96221f6b9
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix a size_t multiplication overflow in diff_meyrs.c
Found on an OpenBSD armv7 machine running Got regression tests:
test_status_shows_no_mods_after_complete_merge Segmentation fault (core dumped)
The problematic multiplication is kd_len * kd_len in diff_algo_myers()
with kd_len set to 65537.
(gdb) p (int)(65537 * 65537)
$64 = 131073
(gdb) p (int)(65537 + 65537)
$65 = 131074
(gdb) p (unsigned int)(size_t)(-1)
$68 = 4294967295
(gdb) p (4294967295 / kd_len)
$71 = 65535
Detect such overflow and run the fallback diff algorithm instead.
- Commit:
346d4986568ffbcfdc53cce45dd8a468535a68f2
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix ed script diff output when lines are inserted at the top of a file
- Commit:
9879b82a581a245e365fb159488c4294c318d8b3
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
avoid writing just one character at a time in diff_output_lines()
With input from ori@ and millert@
- Commit:
b3fd1fa284e6207b923bd3c887364d9eb93fb340
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix performance issues in the search for function prototypes
with + ok naddy
- Commit:
86b603da3068dce115470492279dc6f86f17f60b
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
patience: do not swallow identical neighbors
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.
- Commit:
df581e4b0ed88464667ca88d51a6b93d1159c0c0
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
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
- Commit:
60c6aae16f7ac9b67326d34fca6de68561e97c0e
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
set a minimum myers effort limit to avoid an early short-cut on small files
discussed with Neels
- Commit:
e4c510c1d83fe01247b6f59d855dffad81e4f26a
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
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"
- Commit:
e51ebd83fa731d197ee4074ee2e94dbc0581078c
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
handle binary files like diff(1) does; new -a option forces text
- Commit:
29916bb6c0c248ca6fa5486cb9e081d92112e86c
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
expose struct diff_atom in public API for external atomizer implementations
- Commit:
fe6d58fb52ea8d1041a8eb65e28a04816df67c08
- From:
- Christian Weisgerber <naddy@mips.inka.de>
- Date:
add a missing include for uint8_t and switch from <inttypes.h> to <stdint.h>
ok millert stsp
- Commit:
ab378e1f5dfdd34727e7eb8a2ccb8c6d42bc6e89
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix patience diff assertion failure exposed by test122
- Commit:
d1085492979de6b79ca99fd96cbbb5799a83aa82
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add a test case which triggers an assertion in diff -P
- Commit:
c285a1f8b9de1be75e044892c4c7af139e5156bc
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
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);
]]]
- Commit:
e8eedebc88e40698d3d763e6f00601484d8cabf3
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add some API functions which allow access to opaque struct diff_chunk
- Commit:
67157248154a23138c2b7ff2eebecbdf3d079ef7
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
fix patience: off-by-one preventing swallow the same identical line twice