fork of radicle with Git LFS support, backed by IPFS
Go to file
Fintan Halpenny df15b497ab
radicle: namespace peers
The previous iteration of the storage layout for projects organised
peer's subtrees by the `refs/remotes` category. This layout leads to
problems when linking a working copy to the storage project. The fetch
refspec would look something like:

  fetch = +refs/remotes/abc/heads/*:refs/remotes/rad/*

This works perfectly fine when running:

  git fetch rad

but will fail when one tries to specify:

  git fetch rad main

Instead, the command would need to be:

  git fetch remotes/abc/heads/main

This patch proposes to move the use of `refs/namespaces` for each
peer. The layout looks similar in that each peer has a subtree, but
instead it is under `refs/namespaces/<peer>/refs/...`.

The previous refspec would look more familiar in its new form:

  fetch = +refs/heads/*:refs/remotes/rad/*

With this in place running:

  git --namespace=abc rad main

Will work as expected and place the reference under
`refs/remotes/rad/main`. Similary, `git --namespace=abc push` will
work as expected.

Another benefit of this approach is that the use of namespacing means
that a tag is pushed it will be placed under the respective namespace
rather than in the global `refs/tags` category.

The actual implementation needed to work around the fact that
`git2`/`libgit2` does not have any options for fetching or pushing
using namespaces. The working copy code uses processes to shell out to
`git` for namespacing needs.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-10-12 12:30:05 +02:00
.github/workflows Update Rust to 1.64 2022-09-26 11:27:31 +02:00
.nix meta: add nix tooling 2022-10-12 12:21:01 +02:00
radicle radicle: namespace peers 2022-10-12 12:30:05 +02:00
radicle-node Handle errors correctly in storage 2022-10-11 09:31:48 +02:00
radicle-ssh Improve ssh crate API 2022-10-03 11:13:53 +02:00
radicle-tools radicle: namespace peers 2022-10-12 12:30:05 +02:00
.gitignore Initial commit 2022-09-13 10:13:13 +02:00
Cargo.lock radicle: namespace peers 2022-10-12 12:30:05 +02:00
Cargo.toml Add SSH functionality with new `radicle-ssh` 2022-10-03 10:34:59 +02:00
rust-toolchain Update Rust to 1.64 2022-09-26 11:27:31 +02:00