lib/diff.c

Branch


Log

Author Commit Date CI Message
Stefan Sperling 4b752015 2022-06-30T21:35:28 switch 'tog diff' and 'tog blame' to Myers diff for speed Make the choice of diff algorithm configurable by diff API users. The got and gotweb programs keep using Patience diffs which are prettier than Myers. But tog should be as fast as possible since it is being used interactively. If performance of Patience diff gets improved later we can consider switching tog back over to it. ok tracey jamsek
Stefan Sperling 49d4a017 2022-06-30T10:43:37 move more opentemp out of diffreg.c ok tracey
Stefan Sperling f9d37699 2022-06-28T20:33:41 move got_opentempfd() out of lib/diff.c again ok tracey
Tracey Emery eb81bc23 2022-06-28T13:27:12 move got_opentempfd out of open_blob. ok stsp@
Omar Polo 58e31a80 2022-06-27T18:47:02 build with -Wwrite-strings Throwing this into the mix for a while, we can always get rid of it again if it becomes annoying. No objections from stsp@
Stefan Sperling 8469d821 2022-06-25T09:25:07 always show commit or tree IDs in diff header, in order to help 'got patch' The idea is that got patch can simply look for a line such as: commit - abcde1234567... to find the merge base commit ID to show in diff3 conflict markers. got log -p now displays commit IDs in its diff header, instead ofl tree or blob IDs. ok op@
Stefan Sperling a558dd1b 2022-06-08T10:56:53 reuse a temporary file across commits during got log -p -S suggested by + ok op@
Stefan Sperling b72706c3 2022-06-01T05:08:20 move creation of tempfiles outside of lib/diff.c ok tracey
Stefan Sperling 46ea77db 2021-12-20T16:18:41 sort paths in got log -Pp and tog's diff view the same way as in the diff reported by and fix confirmed by naddy
Stefan Sperling 67b631c9 2021-10-10T15:22:14 implement 'got diff -c' for diffing commits with optional filtering by path Need for filtering by path sugggested by kn@ ok naddy@
Stefan Sperling 56b63ca4 2021-01-22T11:04:47 make fclose(3) failure checks consistent; check 'fclose() == EOF' everywhere ok millert, naddy
Stefan Sperling 9c659ea0 2020-11-22T13:25:32 do not forget to add an offset for line zero in diff_blobs() Fixes a problem in 'tog diff' where the first line of the output was cut off.
Stefan Sperling c354056f 2020-11-21T15:34:19 prevent potential fclose(NULL) in error path of diff_blobs()
Stefan Sperling 1cb46f00 2020-11-21T15:34:19 consistently label removed files as "/dev/null" in diff headers
Stefan Sperling 64453f7e 2020-11-21T13:35:00 handle binary files in got/tog diff commands; add -a options to force text
Stefan Sperling 89dc8b78 2020-11-19T15:37:20 remove stdbool.h where it's not needed
Stefan Sperling be659d10 2020-11-18T17:18:23 fix type of filesize output parameter of got_object_blob_dump_to_file()
Stefan Sperling cb7c1b68 2020-11-18T16:14:30 remove unused function got_diff_blob_prepared_file()
Stefan Sperling 72254787 2020-11-18T16:12:35 simply got_diff_prepare_file() by letting callers worry about file creation
Stefan Sperling fe621944 2020-11-10T22:54:37 merge new diff implementation from the git.gameoftrees.org diff.git repository This new diff implementation was started by Neels Hofmeyr during the u2k20 hackathon and now replaces diffreg.c code lifted from the OpenBSD base system. The integration of this code into Got was done by me. Got now uses the patience diff algorithm by default. The diff.git repository will remain the primary repository for the diff code, which already compiles and runs on other operating systems such as Linux. Any fixes and improvements for files inherited from the diff.git repository should be written against that repository and synced to got.git afterwards.
Stefan Sperling 40dde666 2020-07-23T14:21:29 add support for symlinks in the repository to 'got diff'
Stefan Sperling 0208f208 2020-05-05T09:53:57 show a list of paths changed in a commit with 'got log -P', and in tog requested by matthieu@
Stefan Sperling 56e0773d 2019-11-28T02:32:58 convert tree entries from SIMPLEQ to an array
Stefan Sperling 46f68b20 2019-10-19T11:06:56 show file mode differences when diffing trees
Stefan Sperling 63035f9f 2019-10-06T19:24:31 add -w (ignore whitespace) option to 'got diff'
Stefan Sperling 63c5ca5d 2019-08-24T20:56:15 detect and ignore Git submodules
Stefan Sperling 4c9641fd 2019-08-21T16:57:44 fix and simplify blame algorithm Always diff against latest version of file. This is much easier since there is no need to keep track of lines shifting around.
Stefan Sperling 4ce46740 2019-08-08T12:44:18 label staged blobs with "(staged)" in got diff output
Stefan Sperling ad7de6a5 2019-08-08T09:27:38 remove unused function got_diff_blob_file_lines_changed()
Stefan Sperling dc424a06 2019-08-07T17:26:35 initial 'got stage -p' implementation
Stefan Sperling 7f1f93af 2019-08-06T17:24:17 introduce got_diff_blob_file_lines_changed()
Stefan Sperling 31b4484f 2019-07-27T19:01:01 speed up rebase and histedit path prefix check: skip blob content diffs
Stefan Sperling e09a504c 2019-06-28T20:59:14 introduce support for abbreviated object IDs
Stefan Sperling 6c4c42e0 2019-06-24T22:28:11 implement search for 'tog blame'
Stefan Sperling aaa13589 2019-06-01T15:25:13 generalize got_diff_tree() by adding a diff output callback
Stefan Sperling 1de5e065 2019-06-01T14:44:21 use got_object_tree_find_entry() instead of local copy in diff.c
Stefan Sperling 638f9024 2019-05-13T12:40:57 rename got_error_prefix_errno() to got_error_from_errno()
joshua stein 230a42bd 2019-05-11T13:04:38 got_error_from_errno -> got_error_prefix_errno also add got_error_prefix_errno2 and got_error_prefix_errno3 which should hopefully all be merged into a single function with variadic args (but can't alloc mem)
Stefan Sperling 324d37e7 2019-05-11T09:14:30 make got path APIs available to library consumers
Stefan Sperling 049da17d 2019-03-26T10:34:58 use correct diff header label for deletion in got_diff_blob_file()
Stefan Sperling c2ac9456 2019-03-15T16:39:34 add missing 'static' for local functions
Stefan Sperling fb43ecf1 2019-02-11T11:59:09 check for errors from fclose()
Stefan Sperling d1688ce0 2019-02-06T00:08:47 remove a pointless error code
Stefan Sperling b72f483a 2019-02-06T00:04:59 make 'got diff' show local changes in work tree
Stefan Sperling 09de383e 2018-12-24T14:18:21 fix crash in blame since 18f4293943894155d5ccbdb423f1e8a2bb1e1d62
Stefan Sperling 54156555 2018-12-24T10:58:32 undo commit timestamps next to paths in diffs; they are redundant
Stefan Sperling 18f42939 2018-12-24T10:49:42 show blob headers in diffs for added/deleted files
Stefan Sperling adacb96f 2018-12-24T10:39:46 show commit timestamps in diff headers
Stefan Sperling 15a94983 2018-12-23T14:48:47 remove struct got_object from public library API
Stefan Sperling 45d799e2 2018-12-23T12:10:27 make commit objects opaque in the library's API
Stefan Sperling abd2672a 2018-12-23T11:36:31 move commit header printing in diffs out of the library
Stefan Sperling e20293f2 2018-11-17T16:35:27 revert previous; it made a wrong assumption and broke diff
Stefan Sperling 4b917664 2018-11-17T16:34:00 make diff's match_entry_by_name() exit early if possible
Stefan Sperling d6ce02f1 2018-11-17T16:30:29 fix paths in diffs showing newly added trees
Stefan Sperling 19ae6da1 2018-11-05T16:38:08 compare object IDs just once in diff_entry_old_new()
Stefan Sperling ccb26ccd 2018-11-05T16:16:35 avoid a call to mktime() in commit graph's add_node()
Stefan Sperling df2871d2 2018-10-18T11:45:20 make amount of diff context configurable at API level
Stefan Sperling 60f50a58 2018-09-15T15:20:24 don't crash in got_diff_tree() if trees are empty
Stefan Sperling 0dcf3e9c 2018-09-15T10:57:05 tweak log message headers again
Stefan Sperling dab5fe87 2018-09-14T20:22:22 tweak commit display
Stefan Sperling 405a764e 2018-09-14T00:30:38 don't display blob IDs twice when diffing blobs directly
Stefan Sperling 3b8ef1a8 2018-09-14T00:25:13 tweak diff output and adjust test expectations accordingly
Stefan Sperling 8f97f261 2018-09-14T00:13:19 show blob IDs in diffs again and make repository test pass
Stefan Sperling f6861a81 2018-09-13T23:48:14 display file paths in diffs instead of blob SHA1s
Stefan Sperling ede67fd9 2018-07-10T23:32:29 remove empty line from commit diff output
Stefan Sperling 84451b3e 2018-07-10T13:17:00 implement incremental blame display for tog
Stefan Sperling 883f0469 2018-06-23T17:57:39 make struct got_tree_object opaque
Stefan Sperling 404c43c4 2018-06-21T23:22:57 basic 'got blame' implementation
Stefan Sperling 35e9ba5d 2018-06-21T19:41:20 introduce got_object_blob_dump_to_file()
Stefan Sperling 4bb494d5 2018-06-16T19:24:46 display UTC commit timestamps in tog(1)
Stefan Sperling 9fc8d6a2 2018-05-20T15:14:11 check fprintf() return values in got_diff_objects_as_commits()
Stefan Sperling 9b697879 2018-05-20T13:03:52 make got_diff_objects_as_commits() require obj2 parameter
Stefan Sperling bacc9935 2018-05-20T13:02:12 show log message above a diff between commits
Stefan Sperling b74c7625 2018-05-20T12:51:27 make git_diff_object helpers error if both objects are NULL
Stefan Sperling cd0acaa7 2018-05-20T12:37:25 allow switching from log view to diff view in tog
Stefan Sperling 511a516b 2018-05-19T16:57:12 move got_opentmp* functions to public API; used from tog
Stefan Sperling 11528a82 2018-05-19T16:28:32 move common diff helpers from got and tog into lib/diff.c
Stefan Sperling 730a8aa0 2018-04-24T13:49:33 don't override error codes in diff_modified_blob()
Stefan Sperling dfb54902 2018-04-02T11:45:31 wrap long lines
Stefan Sperling 2acfca77 2018-04-01T17:44:32 don't forgot to close blobs after diffing them
Stefan Sperling 84eb021e 2018-03-27T23:18:58 show function prototypes in diff output
Stefan Sperling 07ccb00b 2018-03-27T23:08:07 be careful about NULL trees when diffing entries
Stefan Sperling c2c21d46 2018-03-27T21:56:33 show 3 lines of context in file diffs
Stefan Sperling 718b3ab0 2018-03-17T17:50:48 rename the library-internal headers again to a common prefix
Stefan Sperling 25783624 2018-03-12T13:59:29 use stricter CPPFLAGS from mpi
Stefan Sperling 32cb896c 2018-03-11T14:10:56 rename library-private headers from *_priv.h to *_lib.h
Stefan Sperling 1411938b 2018-02-12T23:25:38 rename private header filenames so they are in got_ namespace
Stefan Sperling 59ece79d 2018-02-12T22:13:27 make struct got_object_id opaque
Stefan Sperling f934cf2c 2018-02-12T21:27:40 make struct got_blob_object opaque
Stefan Sperling eba5c6bb 2018-02-12T00:25:40 repair blob diffing
Stefan Sperling 74671950 2018-02-12T00:15:49 add output file argument to got_diff_tree
Stefan Sperling eb651edf 2018-02-11T18:16:43 more progress on reading packed/deltified objects
Stefan Sperling eef6493a 2018-01-19T18:09:29 Make struct got_object opaque to users of the library
Stefan Sperling b107e67f 2018-01-19T18:03:07 Implement open() support for offset delta objects
Stefan Sperling a1fd68d8 2018-01-12T20:59:51 Extract non-deltified objects from pack files.
Stefan Sperling a3e2cbea 2017-12-01T22:09:59 make tree diffing work
Stefan Sperling 98abbc84 2017-11-30T16:18:10 test tree diff (not yet working correctly)
Stefan Sperling 013404a9 2017-11-30T16:04:00 add todo comment
Stefan Sperling 2c56f2ce 2017-11-30T16:03:14 implement diff_deleted_tree
Stefan Sperling 9c70d4c3 2017-11-30T16:02:22 implement diff_added_tree