Commits


add diff_chunk_context_load_change() for use with diff_output_unidiff_chunk()


revert db941c24; callers would also need private structs for that idea to work


avoid printing the --- +++ diff header in diff_output_unidiff_chunk()


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.


expose chunk_context_empty() via diff_internal.h and use it in edscript output


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.


in ed output mode, show changed lines as XXcYY etc. as UNIX diff(1) does


debug: diff_output_unidiff(): debug list all chunks


fix unidiff output header in case both files have only one line


fix unidiff headers for empty files


fix line numbers in unidiff hunk headers and omit ",1"; matches diff(1)


move headers from include/diff/ to include/; makes things easier for consumers


add helper functions for obtaining the start/end line numbers of a diff chunk


repair DEBUG build


remove an unused variable


check results of ARRAYLIST_ADD


optionally provide information about the generated diff to the API user


store interal state of output_unidiff API in an opaque struct


move some definitions from the public diff_main.h to an internal header file


support output of individual diff chunks in the public API


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


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.


avoid include statements in header files; make each .c pull in what's needed


replace enum diff_rc errors with plain errno values


move 'struct range' and related functions into the diff_ namespace no functional change