Commits
- Commit:
37f62f5d4e914963adfbf2085f5fd9294d79b497
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix another format string issue in results_test.c
Cast ARRAYLIST_IDX result to unsigned long and use %lu in the format string.
Clang 10.0.1 complained as follows:
results_test.c:148:9: warning: format specifies type 'int' but the
argument has type 'long' [-Wformat]
ARRAYLIST_IDX(c, result->chunks),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Commit:
6fc23bd07d48a9fe01f057ca64e870cd8ebd6025
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix a format string issue in results_test.c
Use explicit casts to long long and use %lld in the format string.
Clang 10.0.1 complained as follows:
results_test.c:78:9: warning: format specifies type 'int' but the
argument has type 'long long' [-Wformat]
c->left_start ? c->left_start->pos : -1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Commit:
cdaa991d59b6083bab30f1bd86345f57717a5670
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix a format string issue in array test
ARRAYLIST_IDX deals with the head pointer. Explicitly cast to unsigned long
and use %lu in the format string.
Clang 10.0.1 used to complain as follows:
arraylist_test.c:19:2: warning: format specifies type 'int' but the
argument has type 'long' [-Wformat]
arraylist_test.c:15:24: note: expanded from macro 'dump'
printf("[%d] %d\n", ARRAYLIST_IDX(p, list), *p); \
~~ ^~~~~~~~~~~~~~~~~~~~~~
- Commit:
db941c245fd5f7b8e8ca2f9b6ebaf0c3dcecda48
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
put functions required for using diff_output_unidiff_chunk() into public API
They will be needed to implement 'got stage -p' and 'got revert -p', etc.
Chunks stored in diff_result still need post-processing in order to be
displayed as expected by diff_output_unidiff_chunk().
Exposing these functions allows API consumers to implement the same chunk
merging loop as used internally by output_unidiff() and output_edscript().
(Perhaps, ideally, the public diff API would provide pre-merged chunks at
some point in the future? Then this commit could probably be reverted.)
Change return values from bool to int to avoid making stdbool.h a requirement
for the public diff API.
- Commit:
cbf93b702bb81f143354b53125c64579a5040fcc
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
expose chunk_context_empty() via diff_internal.h and use it in edscript output
- Commit:
12c5bde7b2b0371050910b2446b9aaad5fc44573
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
use mergesort(3) instead of qsort(3) in patience diff
Fixes test failures on OpenBSD due to unstable results of qsort if
two or more elements are equal.
Add a compat copy of OpenBSD mergesort(3) for Linux.
- Commit:
f087e96869b35f67db93f1a9a3df95d0dc9da883
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
check for allocation failure in diff_atoms_mark_unique_in_both_by_qsort()
- Commit:
34570dbeba22613374809c75a8ed2f119db01ec5
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
initialize to NULL instead of ""; allows pointer check to see if file is mapped
- Commit:
40dba3d841ef97bc452f734f6945dff48bc2f925
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
revert 1ea185225fc4897fdfbe0043837b43ddab3f1449 which caused an infinite loop
- Commit:
1b3c539b2dd85be56e0b40125774b3d621db6351
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
atoms are stored in an array, not a list; use direct indexing instead of loop
- Commit:
1ea185225fc4897fdfbe0043837b43ddab3f1449
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix a segfault: d->data may point to "", this cannot be checked for NULL
- Commit:
7021523c6d7788c452572f0b48f0dcba23199dac
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
print "\ No newline at end of file" message like UNIX diff(1) does
Not adding new tests since this behaviour is covered by tests in Got.
- Commit:
26595c7df947f97507904fa391034b6a52bfca7d
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
in ed output mode, show changed lines as XXcYY etc. as UNIX diff(1) does
- Commit:
227cd87e537c560f428629cf170b0f19422b1c56
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
wrap a comment that had overlong lines
- Commit:
70fb5a47142d240e33700b734a57433248225624
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
diff_myers: fix some uninitialized warnings
- Commit:
65688edf4c58356b6a78c043dae1a4832532b84f
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
patience: fix uninitialized rc in diff_atoms_qsort_compar
- Commit:
2c12b171fbb19e2b5423c046fbb9cb86b60632eb
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add -Wuninitialized to CFLAGS on Linux build; exposes some bugs already
- Commit:
99193dbfc9c01d4924eae992a6819d0bb998f2c8
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
add test for -T option
This uncovered a bug in diff_algo_none(), so let's keep it.
- Commit:
6c8c5d3f0b6b2ba6c23acd67179fd37e8f2af66b
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
move patience data out of struct diff_atom
Now allocating patience specific data only when patience is going to be used.
This may allow using forward-Myers more often, since the state size per line is
significantly smaller.
Patience instead allocates an array, puts it in the current diff_data, and also
place a pointer of the current diff_data in the root diff_data (since each atom
points to the root diff_data).
- Commit:
c8846eb959c22c43dd5f8d9193b7e0c83c31b8af
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
add patience tests
- Commit:
23f98e9b0c9c2f60bedc24f6d1ae19e2d2ea880a
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
test/verify_all.sh: allow combined cmdline opts
- Commit:
60b6e08bf7113461bbe0ce511caf96a31121b143
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
patience: use qsort to optimize finding unique lines
- 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:
65a56b169e5746c2fe2ee46008238505c64e4908
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
diff: drop -p, add -P -Q -T; diffreg(): use algo enum
-p is traditionally used for "show which C function each change is in", so
don't use it for choosing Patience.
Instead add two options for using Patience, -P for only Patience and -Q to
attempt forward-Myers first.
Also add -T for a trivial diff (diff_algo_none).
- Commit:
93965884a1452f6e1f50fb33a0395448fbd8b3bd
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
test: add expect0{10,11,12,14}.diff