1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:08:12 +00:00
serenity/Userland/DevTools/HackStudio/Git
Shannon Booth f690807c5a LibDiff: Change underlying representation of Hunk to allow context
The existing hunk data structure does not contain any way to easily
store information about context surrounding the additions and removals
in a hunk. While this does work fine for normal diffs (where there is
never any surrounding context) this data structure is quite limiting for
other use cases.

Without support for surrounding context it is not possible to:
 * Add support for unified or context format to the diff utility to
   output surrounding context.
 * Be able to implement a patch utility that uses the surrounding
   context to reliably locate where to apply a patch when a hunk range
   does not apply perfectly.

This patch changes Diff::Hunk such that its data structure more closely
resembles a unified diff. Each line in a hunk is now either a change,
removal, addition or context.

Allowing hunks to have context inside of them exposes that HackStudio
heavily relies on there being no context in the hunks that it uses for
its' git gutter implementation. The fix here is simple - ask git to
produce us a diff that has no context in it!
2023-07-02 11:18:11 -06:00
..
DiffViewer.cpp LibDiff: Change underlying representation of Hunk to allow context 2023-07-02 11:18:11 -06:00
DiffViewer.h HackStudio: Use StringView in DiffViewer::draw_line 2023-06-26 19:26:34 +02:00
GitFilesModel.cpp AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
GitFilesModel.h LibGUI+Userland: Propagate errors in Model::column_name() 2023-06-14 17:53:59 +02:00
GitFilesView.cpp LibGfx+Everywhere: Change Gfx::Rect to be endpoint exclusive 2023-05-23 12:35:42 +02:00
GitFilesView.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
GitRepo.cpp LibDiff: Change underlying representation of Hunk to allow context 2023-07-02 11:18:11 -06:00
GitRepo.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
GitWidget.cpp LibGUI+Userland: Port Labels to String 2023-04-30 05:48:14 +02:00
GitWidget.h HackStudio: Open projects after the action tab was created 2022-12-23 23:27:45 +01:00