The formatting no longer needs nightly and only uses stable features.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
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.
Add the Nix flake machinery for developing using Nix tooling.
This requires that the following are added:
- Cargo.lock
- rust-toolchain
To ensure that versions are pinned.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Two of the tests in radicle-git-ext and radicle-surf relied on using
the Git repository itself. This can end up being an issue when
sandboxing is involved.
This improves the situation by being able to generate commit data to
add to a temporary repository.
It also adds a helper for creating a local, temporary submodule for
testing the submodule interactions in the radicle-surf API.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
The formatting configuration is not worth the maintenance of a nightly
version. Remove it and allow the default formatting to be used
instead.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Removing the Nix tooling managed by niv in favour of a future
`flake.nix`.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Git [submodules] are encoded as commits when walking a Git tree. To
allow the support of them in `radicle-surf`, the tree entry is checked
for this case. The entry will be treated such that it is has a name,
prefix, Oid, and the submodule's URL.
It's important to note that the Oid is not usable within the context
of the repository that is being browsed, since they are entirely
separate.
Instead, the URL should be used in conjunction with the Oid for
browsing purposes outside of `radicle-surf`. However, in a future
iteration it may be considered to be able to browse the local contents
of the submodule, if possible.
N.b. getting the submodule and its URL is not supported for a bare
repository, since it will complain about not having a working tree.
[submodules]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Run `niv update` to get the latest Rust toolchain.
This required applying some clippy improvements:
- Removing unnecessary re-export of Oid in `stats` module.
- Replace `get(0)` with `first`
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Update git2 version to 0.18.1 and provide an updated release version
of radicle-git-ext 0.7.0 and radicle-surf 0.18.0.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
The current `blob` function is limited to always associating a Blob
with a Commit.
Expose `BlobRef` through a `blob_ref` method, and add useful methods
and serialization to it.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
* sebastinez/add-small-disclaimer-on-diff-commits-fn:
surf: Add a small explainer on binary detection in diffs
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
* sebastinez/add-current-oid-to-filediff:
surf: Add `DiffFile`s to `FileDiff` variants without a diff
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
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>
In some cases a moved file can also be modified and in these cases
there will be a diff as well as new Oid's for the two sides of the
diff.
Add DiffFile to the Moved type, changing the insert_moved method to
accept the DiffFile's and the DiffContent.
When serializing a Moved, if the old and the new are the same then the
serialization of the diff files and content are skipped -- same as the
old behaviour. Otherwise, the two sides are serialized along with the
content.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Update the toolchain to rust-1.72.0. This brought with it a new clippy
check for needless '#'s for string literals. However, this is a false
positive and is being tracked here[[0]].
[0]: https://github.com/rust-lang/rust-clippy/issues/11402
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Put the Diff type in lines with its associated types by opening it up to
construction by crate consumers. The existing associated types have all
their fields public.
Open construction up by making the `Diff::insert_*` methods public and
updating the Diff's stats manually. `Diff::stat` correctness is covered
by existing tests.
The homepage and repository fields were out of date. Update them to
the new radicle-git link.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
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`.
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>
Add features to radicle-git-ext to access the bstr and
percent-encoding features of git-ref-format.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Publish radicle-surf, updating radicle-git-ext and allowing a minicbor
feature flag.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Publish radicle-git-ext to include the following changes:
* Hiding minicbor behind a feature flag
* Fix to commit author's time display/parse
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
* origin/dave/fix-author-timestamp:
git-ext: Display/parse timezone offset in the format git2 expects.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>