cli: Use git push to open or update patches

This adds the ability to the git-remote-helper to open and update
patches via a `git push` to the magic ref `refs/patches` and
`refs/heads/patches/<patch-id>`.

The main change is that we had to move away from offering the `connect`
capability in the remote helper, to offering `push` and `fetch`
individually.

To get a feel for how this works, see the `rad-patch-via-push.md`
example.
This commit is contained in:
Alexis Sellier
2023-05-12 12:22:08 +02:00
parent f8ee109aaa
commit fd1237b2db
25 changed files with 1198 additions and 131 deletions
@@ -62,6 +62,13 @@ $ rad patch show 5f0a547f7a91bf002bb0542035a647fd5af134a5
╰─────────────────────────────────────────────────────────────────────────────────────────╯
```
We can also confirm that the patch branch is in storage:
```
$ git ls-remote rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk refs/heads/flux-capacitor-power
3e674d1a1df90807e934f9ae5da2591dd6848a33 refs/heads/flux-capacitor-power
```
Wait, let's add a README too! Just for fun.
```
@@ -16,7 +16,13 @@ peer. Upcoming versions of radicle will not require this step.
```
$ rad remote add z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk --name bob
✓ Remote bob added with rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
```
``` (stderr)
$ git fetch bob
From rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
* [new branch] flux-capacitor-power -> bob/flux-capacitor-power
* [new branch] master -> bob/master
```
The contributor's changes are now visible to us.