Commits
- Commit:
4125b1eff8d9dfcd961dc70ebbd5d54c97bdc3f6
- From:
- Tom Jones <thj@freebsd.org>
- Via:
- tj <tj@enoti.me>
- Date:
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@
- Commit:
9f5da0913af47a525ab2a2422c7911cdb08866d0
- From:
- Tom Jones <thj@freebsd.org>
- Via:
- tj <tj@enoti.me>
- Date:
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@
- Commit:
e1595dc1c75393361878450cc70fcefee131810a
- From:
- Tom Jones <thj@freebsd.org>
- Via:
- Mark Jamsek <mark@jamsek.dev>
- Date:
add regress test for function prototype in hunk header
- Commit:
1edd9c2b609adfa7ed93dbd839b7d683e695feaa
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
sync changes from got.git to implement headers-only mode for plain output
- Commit:
8993f42562696079866fc2dec7191877b6cc1f18
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
improve accuracy of function prototype in hunk headers
Initial diff by Tom Jones with fixes from stsp.
ok stsp@
- Commit:
9230203d371721cf5bde99f526fe40740aea3b21
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix updating of line-offsets output info in plain output mode
reviewed by tom jones
- Commit:
810479a563ffd6176105f64cb49f9829d45d36df
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
sync diff_patience.c from got.git 336075a42a5ae0fa322db734c481d21998e82bb8
- Commit:
1f690ebe65383786882e120daa2cba81a7b7f90e
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
sync files from got.git 336075a42a5ae0fa322db734c481d21998e82bb8
ok tb@
- Commit:
7a38b3a33f8b124c9c01da154dfdf711d328b01d
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
fix build broken in previous commit 35eae7fa6b782ae1
Macro line was wrapped without continuation character.
ok tb@
- Commit:
35eae7fa6b782ae1d000183ef2efc4383dfec4cd
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
remove gcc ternary if extension
ok stsp@
- Commit:
b1aa94aab8c556c9614a18b8e13c6cc8c3005b79
- From:
- Tom Jones <thj@freebsd.org>
- Via:
- Stefan Sperling <stsp@stsp.name>
- Date:
add support for classic diff(1) output; patch by Tom Jones
- Commit:
9343b92549173e00690f24756a633423770f56d7
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
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
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
sync files from got.git 58e31a80da4f4a9e10eaea148672190f35107a47
ok stsp@
- 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@