link-git is still at an early stage and it's not certain what we will
want to keep out of it, thus publishing it should be avoided.
Remove `link-git` from `radicle-git-ext` for the time being.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
The namespace functions can read confusingly:
* `namespaced` - the naming sounds like it is namespacing the input,
when in fact it is ensuring that the input is namespaced.
* `add_namespace` - can be read as adding the namespace to the end of
a ref, when in fact it is placed at the beginning.
Change the naming, respectively, to:
* `to_namespaced` - this uses the conversion naming convention
detailed here[0].
* `with_namespace` - reads as plainly namespacing the ref string.
[0]: https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
Add a `qualified!` macro to the set of git-ref-format macros. This
allows the construction of a `refs/<cat>/<name>` reference from a
string literal.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
The idea of an owner came from radicle-link storing the signer in the
storage which was needed for performing signing when writing
particular rad references. The peer_id and personal identity was also
stored within the monorepo config.
Since git-storage is just general reading & writing of references and
objects, these concepts are not necessarily needed at this
level. Remove the owner from Write and remove the config module.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
When an object does not exist the `find_*` functions will return
None. It will be a common case that users of the API will follow the
pattern of `find_blob(store, oid)?.ok_or(Error::NotFound)`.
Add fallible functions corresponding to each `find_` function
returning a `git2::Error` if the object is not found.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
The Updated values only tell the updated value of the target. It can
be useful to also return the previous value, e.g. for reporting,
hooks, etc.
Add `Option<Oid>` to the Update::Direct and Update::Symbolic variants.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
Ported from `radicle-link`.
Note that the `Strategy` returns the radicle-git `Oid`type
but it uses `git2::Oid` internally to generate it
since our `Oid` does not expose the `hash_object` and `zero` functions.
Signed-off-by: Jorge Iglesias Garcia <me@jorgeig.com>
The git2 crate has moved forward and is now at version 0.15.0 while the
dependencies in radicle-git were using 0.13.
Bump the dependencies to version 0.15.0.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
Initially, radicle-source was envisioned to be another layer on top
of radicle-surf, however, it ended up duplicating a lot of concepts.
We consolidate them by merging radicle-source into radicle-surf.
This meant removing modules branch.rs, tag.rs, oid.rs and error.rs.
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>
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>
The test `thin_pack_libgit` is flaky when it comes to running in a CI
environment, but passes locally. It only seems to fail on the Linux
distribution of the github actions workflow.
For now, it is marked to be ignored.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
Port over LICENSE from the radicle-link repository, while also adding
a copyright for Radicle Git Contributors for any further additions to
this repository.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
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>