Commits
Commit:
9343b92549173e00690f24756a633423770f56d7
Author:
Mark Jamsek <mark@jamsek.dev>
Date:
Thu Aug 4 11:23:55 2022 UTC
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@
Commit:
e450035c854c7301e281718ffd136dfe4647e681
Author:
Mark Jamsek <mark@jamsek.dev>
Date:
Thu Aug 4 11:12:21 2022 UTC
sync files from got.git 58e31a80da4f4a9e10eaea148672190f35107a47

ok stsp@
Commit:
f8b2e31e52e55c61466d35304412e919227e6ae9
Author:
Stefan Sperling <stsp@stsp.name>
Date:
Wed Aug 3 11:36:37 2022 UTC
revert previous; got lib/blame.c needs diff_atom_hash_update()
Commit:
f400825bc668466d9fc593470514d6e69ddfc5ff
Author:
Omar Polo <op@omarpolo.com>
Date:
Wed Aug 3 07:08:26 2022 UTC
make diff_atom_hash_update private to diff_atomize_text.c

ok stsp@
Commit:
cd9ef01a441e0ecfd499bf907c15a2878f7e0ee2
Author:
Omar Polo <op@omarpolo.com>
Date:
Wed Aug 3 07:08:26 2022 UTC
reuse diff_atom_hash_update

ok stsp@
Commit:
b9efd927c001e0ea11fac039d1d0849bcad14cab
Author:
Omar Polo <op@omarpolo.com>
Date:
Wed Aug 3 07:08:26 2022 UTC
less chatty regress

ok stsp@
Commit:
9bf4a819c3a1cbd7d7962bf061cd2456660cd726
Author:
Omar Polo <op@omarpolo.com>
Date:
Wed Aug 3 07:08:26 2022 UTC
regress: look for the diff prog also inside obj/

ok stsp@
Commit:
405e89a6da28edc7555666affbad86a823e2c460
Author:
Omar Polo <op@omarpolo.com>
Date:
Tue Aug 2 17:26:41 2022 UTC
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
Author:
Mark Jamsek <mark@jamsek.dev>
Date:
Mon Aug 1 04:16:18 2022 UTC
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
Author:
Omar Polo <op@omarpolo.com>
Date:
Tue Jul 26 13:22:28 2022 UTC
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
Author:
Stefan Sperling <stsp@stsp.name>
Date:
Thu Jan 6 19:19:36 2022 UTC
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
Author:
Stefan Sperling <stsp@stsp.name>
Date:
Tue Nov 23 19:11:53 2021 UTC
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
Author:
Stefan Sperling <stsp@stsp.name>
Date:
Wed Oct 6 13:15:54 2021 UTC
fix ed script diff output when lines are inserted at the top of a file
Commit:
9879b82a581a245e365fb159488c4294c318d8b3
Author:
Stefan Sperling <stsp@stsp.name>
Date:
Thu Jul 8 10:35:23 2021 UTC
avoid writing just one character at a time in diff_output_lines()

With input from ori@ and millert@
Commit:
b3fd1fa284e6207b923bd3c887364d9eb93fb340
Author:
Stefan Sperling <stsp@stsp.name>
Date:
Thu Dec 10 16:56:56 2020 UTC
fix performance issues in the search for function prototypes

with + ok naddy
Omar Polo