Commit Graph
37 Commits
Author SHA1 Message Date
Fintan Halpenny 1d41bf0447 radicle-git-ext: remove link-git dependency
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>
2022-10-14 10:48:39 +01:00
Fintan Halpenny 4f6284caf5 Merge remote-tracking branch 'origin/namespace'
* origin/namespace:
  git-ref-format: rename namespace functions
2022-10-14 10:05:40 +01:00
Fintan Halpenny daffac4101 git-ref-format: rename namespace functions
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>
2022-10-13 09:21:53 +01:00
Fintan Halpenny 8d65feb80d Merge remote-tracking branch 'origin/macro/qualified'
* origin/macro/qualified:
  git-ref-format: qualified macro
2022-10-13 09:21:07 +01:00
Fintan Halpenny 339d7fc097 git-ref-format: qualified macro
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>
2022-10-12 17:00:05 +01:00
keepsimple1 0cec6b5997 Merge pull request #26 from keepsimple1/new-design
radicle-surf: refactoring the design - part 1
2022-10-05 09:17:35 -07:00
Han Xu cd9132c377 radicle-surf: an updated design
- A new design document.
- Uses examples/diff.rs to test out some ideas.
- Removes the type Browser.
- Removes the type Snapshot.
2022-10-04 22:01:12 -07:00
Fintan Halpenny 93d92ede2d Merge remote-tracking branch 'han/test-reorg'
* han/test-reorg:
  radicle-surf: test structure compliance.
2022-09-29 18:00:32 +01: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 d7b3da88a2 Merge remote-tracking branch 'origin/storage-port'
* origin/storage-port:
  git-storage: remove owner and config
  git-storage: fallible functions for finding objects
  git-storage: return previous targets
  git-storage: port storage from librad
2022-09-27 14:03:05 +01:00
Fintan Halpenny 0730453ac5 git-storage: remove owner and config
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>
2022-09-27 12:32:21 +01:00
Fintan Halpenny ee7a9029ce git-storage: fallible functions for finding objects
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>
2022-09-27 12:32:20 +01:00
Fintan Halpenny 5898c0ffde git-storage: return previous targets
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>
2022-09-27 12:32:20 +01:00
Fintan Halpenny e6f36318cd git-storage: port storage from librad
This provides a port of the librad::git::storage[0] API, with a focus
on being more generic and decomposing writing and reading
operations. It also takes heavy inspiration from
link_replication::io::refdb[1] for its implementation of the
transactional writes.

[0]: https://github.com/radicle-dev/radicle-link/blob/master/librad/src/git/storage.rs
[1]: https://github.com/radicle-dev/radicle-link/blob/master/link-replication/src/io/refdb.rs

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-09-27 12:32:20 +01:00
Fintan Halpenny 69e815c124 Merge remote-tracking branch 'origin/generators-port'
* origin/generators-port:
  git-ext/t: Port `gen_oid*` generator methods
2022-09-27 12:32:00 +01:00
Jorge Iglesias 46249f65ba git-ext/t: Port gen_oid* generator methods
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>
2022-09-27 13:04:36 +02:00
Fintan Halpenny b3d23d2019 Merge remote-tracking branch 'han/fix-ci2'
* han/fix-ci2:
  radicle-surf: convert git2::Oid to radicle_git_ext::Oid
  CI: create main branch only if not exist.
2022-09-27 10:17:10 +01:00
Han Xu a111d26047 radicle-surf: convert git2::Oid to radicle_git_ext::Oid
The radicle_git_ext::Oid type has better trait implementations and
should be favoured instead of git2::Oid.
2022-09-26 09:35:49 -07:00
Han Xu a9b3de3f01 CI: create main branch only if not exist.
'git branch -f main' does not work if main was checked out.

Fix: use awk to check if main branch already exists and create if not
exist.
2022-09-23 20:38:38 -07:00
Fintan Halpenny 32902d0174 nix: rust-1.64
rust-1.64 was announced[0].

Update the nix sources to pick up the latest stable. This update
requires some fixes suggested by clippy.

[0]: https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-09-23 08:45:15 +01:00
Fintan Halpenny 38c84a5958 meta: update to git2-0.15.0
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>
2022-09-22 08:42:30 +01:00
Fintan Halpenny 2ba997727d Merge remote-tracking branch 'han/merge-source'
* han/merge-source:
  fix CI errors on main branch
  merge radicle-source into radicle-surf
2022-09-22 08:33:52 +01:00
Han Xu 4f2962a7e8 fix CI errors on main branch
When CI runs on main branch, the workflow fails to create the "main"
branch as it exists already.

Fix: uses "-f" to force creating "main" branch.
2022-09-21 17:47:11 -07:00
Han Xu eb1653cdb7 merge radicle-source into radicle-surf
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.
2022-09-21 17:07:06 -07:00
Sebastian Martinez a11bedacaa git-types: Add stats method to diff::Diff
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>
2022-09-20 15:59:26 +02:00
Sebastian Martinez ff97333d0a Serialize instances for Commit BranchType BranchName and Branch
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
2022-09-19 15:40:23 +02:00
Han Xu 58d69ebf7f copy radicle-surf and radicle-source into this repo.
Signed-off-by: Han Xu <keepsimple@gmail.com>
2022-09-16 22:17:49 -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 ff300c2946 link-git: ignore thin_pack_libgit
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>
2022-09-15 16:54:28 +01:00
Fintan Halpenny 34e8c5f944 meta: add top-level README file
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-09-15 16:35:47 +01:00
Fintan Halpenny f14c0cbed6 meta: update LICENSE
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>
2022-09-15 16:35:47 +01:00
Fintan Halpenny 810e681733 meta: add CONTRIBUTING.md
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-09-15 16:35:47 +01:00
Fintan Halpenny 744124f4e5 meta: COPYING and DCO
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-09-15 16:35:47 +01:00
Fintan Halpenny 260d77a69f ci: github actions CI
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-09-15 16:35:46 +01:00
Fintan Halpenny b379909610 git-types: port librad::git::types and link_identities::urn
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-09-08 12:07:52 +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
Fintan Halpenny c43420956c Initial commit 2022-08-29 16:09:37 +01:00