Commits
- Commit:
dc306c6bd88271ab911e205539974da98be82d17
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
back out "improve accuracy of function prototype in hunk headers"
which was commit 8993f42562696079866fc2dec7191877b6cc1f18
This commit introduced a regression where hunk headers would contain
lines taken from below or within a change. Reported by tb@ and sthen@.
There is some confusion around how the -p feature was documented:
-p With unified and context diffs, show with each change the first
40 characters of the last line before the context beginning with
a letter, an underscore or a dollar sign. For C source code
following standard layout conventions, this will show the
prototype of the function the change applies to.
The original behaviour matches "the last line before the context beginning
with a letter ...".
The new (reverted) behaviour sometimes matches "will show the prototype of
the function the change applies to". This did always happen as intended,
as seen when some .c files in the OpenBSD src tree were changed.
The new behaviour was also worse for Makefiles in the OpenBSD ports tree.
Let's revert to the traditional -p behaviour until a better fix is found.
Details:
https://marc.gameoftrees.org/mail/1692696001.69872_0.html
https://marc.info/?l=gameoftrees&m=169269624516330&w=2
ok tb@
- 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:
92698c5e983ce2fa59780f5567cb34283bcf1095
- From:
- Tom Jones <thj@freebsd.org>
- Via:
- tj <tj@enoti.me>
- Date:
Remove duplicate definitions
ok op@
- 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:
b3fd1fa284e6207b923bd3c887364d9eb93fb340
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix performance issues in the search for function prototypes
with + ok naddy
- Commit:
29916bb6c0c248ca6fa5486cb9e081d92112e86c
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
expose struct diff_atom in public API for external atomizer implementations
- Commit:
8be88dfa934d602d1cf29ba3e33162511f08b748
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
cache kd_buf in struct diff_state to avoid repeated allocation + free
- Commit:
13e2caa3edcc68a62e29b4d5503254cd5bf80b2b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add support for showing function prototypes in unidiff hunk headers
- Commit:
2f26640c77e9b4d1a303b6c3c7776ff75ad51111
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
revert db941c24; callers would also need private structs for that idea to work
- 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:
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:
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:
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:
87c313418265b477d8931182e8e9e0990db4f3ba
- From:
- Neels Hofmeyr <neels@hofmeyr.de>
- Date:
add results_test.c
- Commit:
2c20a3ed9d3c979c38e927387d4ea488e4dd631b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
optionally provide information about the generated diff to the API user
- Commit:
85ab45596727cfd0254c6d5b6f0c5705b7b6e89e
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
move some definitions from the public diff_main.h to an internal header file