Commit Graph
15 Commits
Author SHA1 Message Date
Sebastian Martinez 0dd1383ed6 surf: Fix comment typo 2024-06-04 11:24:11 +02:00
Sebastian Martinez 1525ef65f1 git: Rename FileDiff tag from state to status
To be more consistent in the use between state and status on
radicle-interface.
2024-04-25 07:41:47 +02:00
Sebastian Martinez d71b65ab62 git: Update serialization for copied files
Use the same way of serialization of moved files for copied files
2024-04-25 07:41:47 +02:00
Sebastian Martinez ea76596fae surf: Improve diff binary detection
Iterates over the git2::Diff entries to force libgit2 to do the binary detection.
Also toggles the `skip_binary_check` in the `DiffOptions`.

All this to workaround the libgit2 lazy flag setting[^0]

[^0]: https://github.com/libgit2/libgit2/issues/6637
2024-04-18 16:03:46 +01:00
Sebastian Martinez dd6bb6fc58 surf: Move FileDiff and Diff serialization to container attributes
To keep the sorting of diffs that is provided by git we should change
the way we serialize them and avoid putting them into separate
modification specific properties.
2024-04-17 11:15:04 +02:00
Sebastian Martinez 097d01350d surf: Add stats property to each DiffContent::Plain
This allows us to get the additions and deletions for each file in a
diff.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-10-02 11:29:22 +02:00
Sebastian Martinez c4590eca2d surf: Add a small explainer on binary detection in diffs
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-09-25 11:36:46 +02:00
Sebastian Martinez 958216084e surf: Add DiffFiles to FileDiff variants without a diff
This allows us to know the blob oid of a moved or copied file, even when
no diff is available.

Also changes the structure of a copied file to be the same as a moved or
renamed file.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-09-21 15:48:56 +02:00
Sebastian Martinez 43c3564187 surf: Add FileDiff::path method
This allows to get the latest path of a `FileDiff`, directly from
`radicle_surf`

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-07-24 17:42:51 +02:00
Sebastian Martinez f9360d83e7 git-storage: fix formatting issue
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-06-28 13:50:59 +01:00
Sebastian Martinez b3c4ae3e3d data/git-platinum: add a file copy operation
To test a copy operation of a file modified in the same changeset, we
need to create a copy of the file in the same changeset.

We copy the modified README.md to a new folder called `file_operations`.
2023-06-28 11:36:22 +02:00
Sebastian Martinez 48c508064c surf: make update-script-platinum script work on macOS
Without the `-r` flag the read command isn't able to extract the values
correctly from the comma separated lines on macOS.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-06-28 11:34:06 +02:00
Sebastian Martinez b8def65d6e surf: add simple copy detection to diff
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2023-06-28 11:31:21 +02:00
Sebastian Martinez a11bedacaa git-types: Add stats method to diff::Diff
The information on how many line insertions and deletions happened in a
diff, as well as files changed is something that is used multiple times
downstream, so it makes the code terser by implementing this
function here.

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2022-09-20 15:59:26 +02:00
Sebastian Martinez ff97333d0a Serialize instances for Commit BranchType BranchName and Branch
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2022-09-19 15:40:23 +02:00