Commit Graph
15 Commits
Author SHA1 Message Date
Fintan Halpenny 3e3c5e0f0e git-storage: remove crate
This crate is not being published and is not used anywhere, so it is
being removed from the set of crates.
2025-09-11 09:05:28 +01:00
Fintan Halpenny b4ca7f31db test: improve commit and submodule testing
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
2024-03-13 14:22:10 +00:00
Fintan Halpenny 1668d9fab3 Archive crates
Move git-commit, git-trailers, and link-git to an archived directory
to hide them away -- showing the intent that radicle-git-ext will be
the main crate for git functionality.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-27 11:01:21 +01:00
Fintan Halpenny a0eae0e8eb meta: update to tempfile 3.4
A vulnerability in a transitive dependency, remove_dir_all, used by
tempfile was found[0].

Update tempfile to 3.4, which does not depend on remove_dir_all.

[0]: https://rustsec.org/advisories/RUSTSEC-2023-0018

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-03-09 12:38:38 +00:00
Han Xu 59515f68e8 move git-ref-format to under radicle-git-ext
Signed-off-by: Han Xu <keepsimple@gmail.com>
2023-02-21 20:19:30 -08:00
Han Xu c844605121 radicle-git-ext: merge in git-commit
Removed `mod references` and its uses in `radicle-macros` and
`radicle-git-types` crates.

Signed-off-by: Han Xu <keepsimple@gmail.com>
2023-02-19 18:43:55 -08:00
Fintan Halpenny 9d137e5e7d test: add roundtrip::json_value
Adds a roundtrip helper for going to/from a json value. This can have
slightly different semantics in comparison to/from a json string.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-12-08 15:17:19 +00:00
Fintan Halpenny 3284149bd6 radicle-surf: rename serialize to serde
Instead of creating a named feature flag, opt for using the `serde`
package name as the feature flag name. This makes it more clear that
the feature is only enabling serde serialization and nothing else.

This patch also cleans up the testing flags by removing the serialize
flag for testing, as this should just always be tested, and also adds
the syntax flag for future testing.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-30 13:22:44 +00:00
Fintan Halpenny a4ec9e07e1 radicle-surf: organise tests
Reorganise the tests into module files, rather than all being in a
single file. No tests were changed in this patch.

The `serialize` flag was also not enabled in `test/Cargo.toml`. This
is enabled to ensure those tests are run moving forward.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-24 12:25:31 +00:00
Fintan Halpenny 9c80fb06a7 meta: clean up cargo dependencies
The aim of this patch is to solve some of the `cargo deny`
warnings. This required updating some dependencies. Some dependencies
of radicle-surf were not used, so they were outright removed.

The last_commit benchmark in radicle-surf is irrelevant as we use more
efficient methods for getting repository histories, so it has been
removed.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-24 11:26:32 +00:00
Fintan Halpenny 8745e46745 git-commit: introduce git-commit crate
Porting the commit code that is found in heartwood[0]. It represents a
parsed git commit object -- sans the id for the commit itself.

[0]: https://github.com/radicle-dev/heartwood/blob/16b22d9178fa6a1aaf2ecb01ec97e067399c5286/radicle/src/git.rs#L392-L575

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-04 12:33:17 +00:00
Jorge Iglesias Garcia f6b72dce85 git-storage: add ODB tests
We add tests for ODB functionality, as well as a new `TreeBuilder`
Struct to make building git trees easier (see below).

The `git2::TreeBuilder` can be a pain to use since it has a lifetime
that is tied to the `git2::Repository`. This was causing issues when
trying to write generators for property tests.

Instead, define a custom TreeBuilder which is a defunctionalised list
operations that represent the `insert` and `remove` methods on
`git2::TreeBuilder`.

The implementation of writing a tree then becomes converting the
custom `TreeBuilder` into a `git2::TreeBuilder`.

Signed-off-by: Jorge Iglesias Garcia <me@jorgeig.com>
2022-10-24 16:52:56 +08:00
Han Xu 0c941740c8 radicle-surf: test structure compliance.
The test structure should be that all tests are gathered under a 't'
sub-crate, followed by the 'test' crate depending on this new crate.
2022-09-29 09:37:54 -07:00
Fintan Halpenny ce7dc3890a meta: use long crate names
To help with clarity and potential publishing of the crates, the full
`radicle-` prefix is used for the crate names.

Note that it wasn't chosen got `git-ref-format` and `git-trailers`
since they are truly general libraries (bar the feature flag for link
specific reference names).

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-09-15 17:58:14 +01:00
Fintan Halpenny 70b571b67b radicle-git init
Port over all git relevant parts of the radicle-link repository[0].
The packages that are kept are:
* git-ext
* git-ref-format
* git-trailers
* link-git
* macros
* std-ext
* test -- only the portions that test the above

The development and testing scripts are also added for local and CI
testing.

[0]: https://github.com/radicle-dev/radicle-link/
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-09-08 12:07:51 +01:00