Updating `radicle-git-ref-core` with update to `Namespaced` logic,
releasing the crate at version `0.5.0`.
This requires bumps to:
- `radicle-git-ref-macro-0.5.0`
- `radicle-git-ext-0.10.0`
- `radicle-surf-0.25.0`
The [manual page](man:gitnamespaces(7)) says:
> Git supports dividing the refs of a single repository into
> multiple namespaces, each of which has its own branches,
> tags, and `HEAD`.
Here, the mention of `HEAD` implies that requiring all
namespaced to start with
refs/namespaces/*/refs
is too strict, as there are legal namespaced refs such as
refs/namespaces/*/HEAD
which are not captured. Relax the corresponding condition, change
documentation and add a test to avoid regression.
The computation for getting the last commit that touched a `Tree` can be
expensive. This is avoided when constructing the `Tree` and is moved to a method
on the `Tree` and `Entry`, aptly named `last_commit`.
`Tree::commit` is kept, however, it now refers to the `Commit` that was used
when constructing the `Tree`. This is required to calculate the last commit. It
was also necessary to add the path of the `Tree`.
For adding `Entry::last_commit`, it was necessary to add the path of the
`Entry`. Incidentally, this can be useful for consumers, since just the `name`
would mean that they would have to manually construct the full path.
The deny tooling removed many of the keys that were in the `deny.toml`.
The auditing of the repository reported that `proc-macro-error` is
unmaintained ([RUSTSEC-2024-0370]). This is replaced with the fork, `proc-macro-error2`,
which is a drop-in replacement.
It also produced a vulnerability report ([RUSTSEC-2024-0421]) for the
`idna` crate, a transitive dependency of `url`. This is fixed by
pinning `url` to `>= 2.5.4`
[RUSTSEC-2024-0370]: https://rustsec.org/advisories/RUSTSEC-2024-0370
[RUSTSEC-2024-0421]: https://rustsec.org/advisories/RUSTSEC-2024-0421
It also pins `url` to be `>= 2.5.4`, since
The `base64` dependency is only required with the `serde`
feature. Move the import of `Engine` into the implentation sites.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Some elements of the `QaulifiedPattern` and `NamespacedPattern` API
were missing:
- `From` implementations
- `Display` implementations
- `Serialize` and `Deserialize` implementations
- `qualified_pattern` macro
This also requires bumping versions:
- `git-ref-format`: 0.3.1
- `git-ref-core`: 0.3.1
- `git-ref-format-macro`: 0.3.1
- `radicle-git-ext`: 0.8.1
- `radicle-surf`: 0.22.1
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
This allows us to parse time values on their own.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
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
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>