Commit Briefs

Stefan Sperling

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.



Stefan Sperling

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.





Stefan Sperling

fix unidiff headers for empty files





Stefan Sperling

repair DEBUG build


Stefan Sperling

remove an unused variable


Stefan Sperling

check results of ARRAYLIST_ADD






Stefan Sperling

rename 'debug.h' to 'diff_debug.h'


Neels Hofmeyr

diff result: ensure sane order of result chunks

Ensure that a adjacent chunks of same type are combined, and that a minus block always precedes an adjacent plus block. The upcoming myers-divide optimization is prone to produce weird ordering of plus and minus chunks.




Stefan Sperling

move 'struct range' and related functions into the diff_ namespace

no functional change


Neels Hofmeyr

KNF: use max 80 columns