Commits
- Commit:
e78a8d73c23ee314fdbdf110d5c55866c9ef9680
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
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@
- Commit:
1dce05e8f99e9ab3e9229bf59e061ad0201a08e8
- From:
- Omar Polo <op@omarpolo.com>
- Date:
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@
- Commit:
29c010c8648ec861ee463bc8fa8c66a64dd01154
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
c99-only construct is not good on OpenBSD's old gcc; patch by Ted Bullock
- Commit:
674563ab136a2aa34dc4d93043d92235a2ae98ba
- From:
- Tom Jones <thj@freebsd.org>
- Via:
- tj <tj@enoti.me>
- Date:
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@
- 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:
1f690ebe65383786882e120daa2cba81a7b7f90e
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
sync files from got.git 336075a42a5ae0fa322db734c481d21998e82bb8
ok tb@
- Commit:
35eae7fa6b782ae1d000183ef2efc4383dfec4cd
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
remove gcc ternary if extension
ok stsp@
- 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:
f6db314590fc96c0cdbf87367b47da8603e17ae9
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
fix result chunks: add minus above plus failed to shift "empty" positions
- Commit:
486215cf28522983f77b83d7a2a5effc522fea5f
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
undup code to add result chunks
- Commit:
4861c9da86ada01cffa2ce3801f670587e896ce2
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
add sanity assertions around adding result chunks
uncovers errors related to placing minus chunks above already added plus
chunks.
- Commit:
10ae3a65609c50cc21f975749f15afdcdc514126
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
patience debug
- Commit:
f5a254cc6ed65ef2e4fcb0737f4e3730f1a63f92
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
debug fix in diff_data_init_subsection
- Commit:
de7a293922ab041cbe620b0421763d94a13fdf47
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
debug init subsection
- Commit:
c16dde50bb5e92533dcbbc513875d726f0f9dd48
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
allow diff API users to atomize files separately
This is a breaking API change (not that we care about that at this point).
This can avoid redundant work spent on atomizing a file multiple times.
There are use cases where one particular file must be compared to other
files over and over again, such as when blaming file history.
The old API gave access to both versions of the file to the atomizer just
in case a future atomizer implementation needs this. This can still be
achieved by passing a second file via the atomizer's private data pointer.
- Commit:
2fa08c64136f5b53fb382e8369815ef94ba74ce0
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
optimize diff_atom_same(): if hashes differ, return false
- Commit:
74ad6a6944bd0588c940347378cc2b713a89ec95
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
diff_atom_cmp: no special case for ignore whitespace when both atoms empty
- Commit:
8be88dfa934d602d1cf29ba3e33162511f08b748
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
cache kd_buf in struct diff_state to avoid repeated allocation + free
- Commit:
34570dbeba22613374809c75a8ed2f119db01ec5
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
initialize to NULL instead of ""; allows pointer check to see if file is mapped
- Commit:
ad5b3f855591bc548f15e09ae4b7fdf674f16245
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
rename diff_atom->d to diff_atom->root, because it always is
The idea was that for each diff box within the files, the atoms would have a
backpointer to the current layer of diff_data (indicating the current section),
but it is not actually needed to update the backpointer in each atom to the
current diff_data. That is why the current code always points atom->d to the
root diff_data for the entire file. Clarify by proper name.
Constructs like atom->d->root->foo are redundant, just use atom->root->foo.
- Commit:
746d94dfa3a4c965501cde5bb0a59a168cc2ab44
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
diff_main: don't run algo if left or right are empty
- Commit:
acfce337ad1e68d4ab00bd78bdb6dd459acc3c46
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
debug: fix logging first chunk
- Commit:
e5447b812ab13381bef489dc01804c25cc226cd6
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
diff_algo_none: cosmetics
- Commit:
9dc0554fce377600fe0ce54848f2e735902616b6
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
fix diff_algo_none() for ending in plus chunk
- Commit:
93f8150ade45bb6185afe5b5ff3110db6403f8b3
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
results: also combine chunks coming from temp_chunks