Fintan Halpenny c316ce8d70 radicle-surf: refactor diff
This is an overhaul of the diff module. The major changes are as
follows.

It shouldn't be possible for an added or deleted file to have any
other kind line changes other than additions or deletions. So there
are now 3 different kinds of changes, Addition, Deletion, or
Modification.

Hunk and Hunks now take a generic type parameter to allow for the
three types of changes. As a consequence a FileDiff does the same.

For the actual file representations, they fill in their parameters as
Addition, Deletion, or Modification.

During this refactor some renaming was also made:
* CreateFile -> Added -- as well as the created field being renamed
to added.
* DeleteFile -> Deleted
* MoveFile -> Moved
* CopyFile -> Copied
* ModifiedFile -> Modified

The Stats are also now carried in the Diff instead of being
calculated. They can be retrieved from the `git2::Diff`.

The final change was to remove the `source::Commit::stats` field in
favour of accessing the `Diff::stats` instead.

The above changes mean that the serialization of `Diff` and `Commit`
are not backwards compatible.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-30 13:23:09 +00:00
2022-10-24 16:52:56 +08:00
2022-11-04 11:13:57 +00:00
2022-11-04 11:13:57 +00:00
2022-11-04 11:13:57 +00:00
2022-11-30 13:23:09 +00:00
2022-09-08 12:07:51 +01:00
2022-09-08 12:07:51 +01:00
2022-09-15 16:35:47 +01:00
2022-09-15 16:35:47 +01:00
2022-09-15 16:35:47 +01:00
2022-09-08 12:07:51 +01:00
2022-09-15 16:35:47 +01:00
2022-09-15 16:35:47 +01:00
2022-09-08 12:07:51 +01:00

radicle-git

The home for all Git utilities related to Radicle. While the majority of the utilities will attempt to be general, there may be more opinionated parts that are geared towards Radicle.

Motivation

The git2 and gitoxide libraries provide low-level APIs for interacting with git repositories and the git protocol. This family of crates attempts to provide a higher-level wrapper around those to provide a more useful API for the Radicle protocol and UI clients building on top of the protocol.

Overview

The repository is defined as a series of crates:

  • git-ext -- provides higher-level types over common types found in git2.
  • git-ref-format -- provides a higher-level API for constructing git. reference paths. Prefer this over git-ext's RefLike and RefspecPattern.
  • git-trailers -- provides a way to parse and construct git trailers.
  • git-types -- provides higher-level types, e.g. Namespace, Reference, Remote, etc.
  • link-git -- provides a higher-level API for git's refdb, odb, and the git protocol.
  • macros -- provides macros for the git-ext references types.
  • std-ext -- provides some utilities extending the standard library.
  • test -- a shim crate that refers depends on all other, individual test crates.

Tests

Please refer to test/README.md for understanding how our tests are organised.

Contribute

Please read CONTRIBUTING.md for a guide on contributing to this repository.

Credits

Thanks to the previous maintainers of the radicle-link repository, Kim, Alex, and Fintan, for providing the foundation to work upon -- as well as the contributors.

S
Description
Git libraries for Radicle
Readme
1.6 MiB
Languages
Rust 97.3%
Nix 2.1%
Shell 0.6%