From 1d167581f2fa2e8ef0e36a268db1affef7418c64 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Tue, 3 Oct 2023 10:35:29 +0200 Subject: [PATCH] cob: Introduce `xyz.radicle.id` COB Introduces a new COB type to store repository identity documents. The reason for this change is to: 1. Simplify the code, as the identity document logic resembled a COB, yet it had custom logic. This allows existing COB code to be used for identities. 2. Make identity document update logic more flexible, since COB actions can be added in the future. 3. Re-purpose existing tools around COBs to work on identities, eg. `rad cob`. 4. Unify the concept of an identity change proposal, with regular identity changes. This means we can remove the `id.proposal` COB in favor of using the `id` COB itself. Notes ----- * Each repository has one Identity COB. * The `Proposal` COB has been repurposed into the `Identity` COB. * Identity documents are stored as *embeds* inside the Identity COB actions. * The action that contains new document versions is called `revision`, just like the Patches COB. * The namespaced `rad/id` ref is a symbolic reference to that Identity COB. * The canonical `rad/id` ref is a direct reference to the commit in the Identity COB that contains the latest *accepted* revision of the document. * All commands for managing identities have been folded into `rad id`. Hence `rad delegate` and `rad edit` are removed. * The concept of "rebasing" an identity document is gone. * The `rad id` output has been updated to match the style of other commands. * When a revision has enough signatures, it is automatically adopted as the current identity, there is no longer the need for a "commit" action. * When an identity revision is proposed, and the current identity has a threshold of `1`, that identity is automatically accepted due to the above point. * The idea of "verifying a peer's identity branch" no longer applies, as COBs cannot be verified one history at a time. * Since the root commit of the Identity COB does not have a "Resource" to point to (it would have to point to itself, which is impossible), we've made the resource id optional for COBs. --- Cargo.lock | 1 - radicle-cli/Cargo.toml | 3 +- radicle-cli/examples/git/git-push-diverge.md | 5 +- radicle-cli/examples/rad-clone-all.md | 5 +- radicle-cli/examples/rad-cob.md | 22 +- radicle-cli/examples/rad-delegate.md | 46 - radicle-cli/examples/rad-fork.md | 7 +- radicle-cli/examples/rad-id-conflict.md | 104 + radicle-cli/examples/rad-id-multi-delegate.md | 186 ++ radicle-cli/examples/rad-id-rebase.md | 429 ---- radicle-cli/examples/rad-id.md | 440 +---- .../examples/rad-init-private-clone.md | 7 +- radicle-cli/examples/rad-inspect.md | 15 +- radicle-cli/examples/rad-issue.md | 30 +- radicle-cli/examples/rad-label.md | 12 +- .../examples/rad-merge-after-update.md | 8 +- radicle-cli/examples/rad-merge-no-ff.md | 4 +- radicle-cli/examples/rad-merge-via-push.md | 32 +- .../examples/rad-patch-ahead-behind.md | 20 +- radicle-cli/examples/rad-patch-draft.md | 18 +- radicle-cli/examples/rad-patch-pull-update.md | 24 +- radicle-cli/examples/rad-patch-update.md | 16 +- radicle-cli/examples/rad-patch-via-push.md | 59 +- radicle-cli/examples/rad-patch.md | 50 +- radicle-cli/examples/rad-review-by-hunk.md | 28 +- radicle-cli/examples/workflow/3-issues.md | 8 +- .../workflow/4-patching-contributor.md | 18 +- .../workflow/5-patching-maintainer.md | 36 +- radicle-cli/src/commands.rs | 4 - radicle-cli/src/commands/checkout.rs | 7 +- radicle-cli/src/commands/clone.rs | 11 +- radicle-cli/src/commands/cob.rs | 4 +- radicle-cli/src/commands/delegate.rs | 129 -- radicle-cli/src/commands/delegate/add.rs | 54 - radicle-cli/src/commands/delegate/list.rs | 17 - radicle-cli/src/commands/delegate/remove.rs | 55 - radicle-cli/src/commands/edit.rs | 92 - radicle-cli/src/commands/help.rs | 1 - radicle-cli/src/commands/id.rs | 975 +++++---- radicle-cli/src/commands/inspect.rs | 25 +- radicle-cli/src/commands/ls.rs | 1 - radicle-cli/src/commands/publish.rs | 16 +- radicle-cli/src/commands/review.rs | 2 +- radicle-cli/src/commands/sync.rs | 2 +- radicle-cli/src/main.rs | 14 - radicle-cli/src/terminal.rs | 2 +- radicle-cli/src/terminal/format.rs | 16 +- radicle-cli/src/terminal/io.rs | 68 - radicle-cli/src/terminal/issue.rs | 24 +- radicle-cli/src/terminal/patch.rs | 32 + radicle-cli/tests/commands.rs | 155 +- radicle-cob/src/backend/git/change.rs | 26 +- radicle-cob/src/change/store.rs | 28 +- radicle-cob/src/change_graph.rs | 4 +- .../src/object/collaboration/create.rs | 2 +- .../src/object/collaboration/update.rs | 2 +- radicle-cob/src/test/storage.rs | 2 +- radicle-cob/src/tests.rs | 14 +- radicle-cob/src/trailers.rs | 2 - radicle-httpd/src/api.rs | 4 +- radicle-httpd/src/api/error.rs | 9 +- radicle-httpd/src/api/v1/delegates.rs | 9 +- radicle-httpd/src/api/v1/projects.rs | 160 +- radicle-httpd/src/lib.rs | 1 + radicle-httpd/src/test.rs | 38 +- radicle-node/src/service.rs | 25 +- radicle-node/src/service/tracking.rs | 5 +- radicle-node/src/test/environment.rs | 2 +- radicle-node/src/tests.rs | 46 +- radicle-node/src/tests/e2e.rs | 12 +- radicle-node/src/worker.rs | 6 +- radicle-node/src/worker/fetch.rs | 10 +- radicle-node/src/worker/fetch/error.rs | 14 +- radicle-remote-helper/src/list.rs | 5 +- radicle-remote-helper/src/push.rs | 6 +- radicle-term/src/lib.rs | 15 + radicle/src/cob/common.rs | 9 +- radicle/src/cob/identity.rs | 1755 +++++++++++------ radicle/src/cob/issue.rs | 24 +- radicle/src/cob/op.rs | 20 +- radicle/src/cob/patch.rs | 19 +- radicle/src/cob/store.rs | 19 +- radicle/src/cob/test.rs | 8 +- radicle/src/cob/thread.rs | 9 +- radicle/src/git.rs | 10 +- radicle/src/identity.rs | 296 +-- radicle/src/identity/did.rs | 1 + radicle/src/identity/doc.rs | 238 +-- radicle/src/identity/doc/id.rs | 1 + radicle/src/lib.rs | 1 + radicle/src/rad.rs | 64 +- radicle/src/storage.rs | 119 +- radicle/src/storage/git.rs | 234 +-- radicle/src/storage/git/cob.rs | 47 +- .../src/storage/git/transport/local/url.rs | 1 + .../src/storage/git/transport/remote/url.rs | 1 + radicle/src/storage/refs.rs | 5 +- radicle/src/test/arbitrary.rs | 18 +- radicle/src/test/storage.rs | 68 +- 99 files changed, 3122 insertions(+), 3631 deletions(-) delete mode 100644 radicle-cli/examples/rad-delegate.md create mode 100644 radicle-cli/examples/rad-id-conflict.md create mode 100644 radicle-cli/examples/rad-id-multi-delegate.md delete mode 100644 radicle-cli/examples/rad-id-rebase.md delete mode 100644 radicle-cli/src/commands/delegate.rs delete mode 100644 radicle-cli/src/commands/delegate/add.rs delete mode 100644 radicle-cli/src/commands/delegate/list.rs delete mode 100644 radicle-cli/src/commands/delegate/remove.rs delete mode 100644 radicle-cli/src/commands/edit.rs diff --git a/Cargo.lock b/Cargo.lock index c761e0c8..7e64c1bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1824,7 +1824,6 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "similar", "tempfile", "thiserror", "timeago", diff --git a/radicle-cli/Cargo.toml b/radicle-cli/Cargo.toml index 6e589b4a..68445c13 100644 --- a/radicle-cli/Cargo.toml +++ b/radicle-cli/Cargo.toml @@ -26,7 +26,7 @@ radicle-surf = { version = "0.17.0" } serde = { version = "1.0" } serde_json = { version = "1" } serde_yaml = { version = "0.8" } -similar = { version = "2.2.1" } +tempfile = { version = "3.3.0" } thiserror = { version = "1" } timeago = { version = "0.3", default-features = false } tree-sitter = { version = "0.20.0" } @@ -73,4 +73,3 @@ path = "../radicle-term" pretty_assertions = { version = "1.3.0" } radicle = { path = "../radicle", features = ["test"] } radicle-node = { path = "../radicle-node", features = ["test"] } -tempfile = { version = "3.3.0" } diff --git a/radicle-cli/examples/git/git-push-diverge.md b/radicle-cli/examples/git/git-push-diverge.md index ffe0a71e..bedc6c50 100644 --- a/radicle-cli/examples/git/git-push-diverge.md +++ b/radicle-cli/examples/git/git-push-diverge.md @@ -5,9 +5,8 @@ canonical head. First we add a second delegate, Bob, to our repo: ``` ~alice -$ rad delegate add did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk --to rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji -Added delegate 'did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk' -✓ Update successful! +$ rad id update --title "Add Bob" --description "" --delegate did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji -q +60cbee1bbc49fcbb8063249bc4112c8886a756ba $ rad remote add did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk ✓ Remote bob@z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk added ✓ Remote-tracking branch bob@z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk/master created for z6Mkt67…v4N1tRk diff --git a/radicle-cli/examples/rad-clone-all.md b/radicle-cli/examples/rad-clone-all.md index 6db70dc0..0325515e 100644 --- a/radicle-cli/examples/rad-clone-all.md +++ b/radicle-cli/examples/rad-clone-all.md @@ -39,6 +39,9 @@ Let's check that we have all the namespaces in storage: $ rad inspect --refs z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi └── refs +    ├── cobs +    │   └── xyz.radicle.id +    │      └── [...]    ├── heads    │   └── master    └── rad @@ -49,14 +52,12 @@ z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk    ├── heads    │   └── master    └── rad -       ├── id       └── sigrefs z6Mkux1aUQD2voWWukVb5nNUR7thrHveQG4pDQua8nVhib7Z └── refs    ├── heads    │   └── master    └── rad -       ├── id       └── sigrefs ``` diff --git a/radicle-cli/examples/rad-cob.md b/radicle-cli/examples/rad-cob.md index 7788a18b..a1eb270e 100644 --- a/radicle-cli/examples/rad-cob.md +++ b/radicle-cli/examples/rad-cob.md @@ -6,7 +6,7 @@ First create an issue. $ rad issue open --title "flux capacitor underpowered" --description "Flux capacitor power requirements exceed current supply" --no-announce ╭─────────────────────────────────────────────────────────╮ │ Title flux capacitor underpowered │ -│ Issue 42028af21fabc09bfac2f25490f119f7c7e11542 │ +│ Issue 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d │ │ Author z6MknSL…StBU8Vi (you) │ │ Status open │ │ │ @@ -21,7 +21,7 @@ $ rad issue list ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ ● ID Title Author Labels Assignees Opened │ ├─────────────────────────────────────────────────────────────────────────────────────────────────────────┤ -│ ● 42028af flux capacitor underpowered z6MknSL…StBU8Vi (you) [ .. ] │ +│ ● 9bf82c1 flux capacitor underpowered z6MknSL…StBU8Vi (you) [ .. ] │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` @@ -45,7 +45,7 @@ $ rad patch ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │ ● ID Title Author Head + - Updated │ ├──────────────────────────────────────────────────────────────────────────────────────────────┤ -│ ● 73b73f3 Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 [ ... ] │ +│ ● a892664 Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 [ ... ] │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ``` @@ -53,17 +53,17 @@ Both issue and patch COBs can be listed. ``` $ rad cob list --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.issue -42028af21fabc09bfac2f25490f119f7c7e11542 +9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d $ rad cob list --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.patch -73b73f376e93e09e0419664766ac9e433bf7d389 +a8926643a8f6a65bc386b0131621994000485d4d ``` We can look at the issue COB. ``` -$ rad cob show --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.issue --object 42028af21fabc09bfac2f25490f119f7c7e11542 -commit 42028af21fabc09bfac2f25490f119f7c7e11542 -parent 175267b8910895ba87760313af254c2900743912 +$ rad cob show --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.issue --object 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d +commit 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d +parent 2317f74de0494c489a233ca6f29f2b8bff6d4f15 author z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi date Thu, 15 Dec 2022 17:28:04 +0000 @@ -92,9 +92,9 @@ date Thu, 15 Dec 2022 17:28:04 +0000 We can look at the patch COB too. ``` -$ rad cob show --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.patch --object 73b73f376e93e09e0419664766ac9e433bf7d389 -commit 73b73f376e93e09e0419664766ac9e433bf7d389 -parent 175267b8910895ba87760313af254c2900743912 +$ rad cob show --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.patch --object a8926643a8f6a65bc386b0131621994000485d4d +commit a8926643a8f6a65bc386b0131621994000485d4d +parent 2317f74de0494c489a233ca6f29f2b8bff6d4f15 parent 3e674d1a1df90807e934f9ae5da2591dd6848a33 parent f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 author z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi diff --git a/radicle-cli/examples/rad-delegate.md b/radicle-cli/examples/rad-delegate.md deleted file mode 100644 index f9519280..00000000 --- a/radicle-cli/examples/rad-delegate.md +++ /dev/null @@ -1,46 +0,0 @@ -Delegates are the authorized keys that can manage a project's -metadata, including adding a new delegate. - -Let's list the current set of delegates for a project. - -``` -$ rad delegate list rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji -[ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -] -``` - -We want to add a new maintainer to the project to help out with the -work. - -``` -$ rad delegate add did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG --to rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji -Added delegate 'did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG' -✓ Update successful! -``` - -Let's convince ourselves that there's another delegate. - -``` -$ rad delegate list rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji -[ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", - "did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG" -] -``` - -And finally, we no longer want to be part of the project so we pass on -the torch and remove ourselves from the delegate set. - -``` -$ rad delegate remove did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi --to rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji -Removed delegate 'did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi' -✓ Update successful! -``` - -``` -$ rad delegate list rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji -[ - "did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG" -] -``` diff --git a/radicle-cli/examples/rad-fork.md b/radicle-cli/examples/rad-fork.md index c4c4fb5d..3c64b1a5 100644 --- a/radicle-cli/examples/rad-fork.md +++ b/radicle-cli/examples/rad-fork.md @@ -7,6 +7,9 @@ NID. This is demonstrated below where our NID is $ rad inspect rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --refs z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi └── refs +    ├── cobs +    │   └── xyz.radicle.id +    │      └── [...]    ├── heads    │   └── master    └── rad @@ -29,6 +32,9 @@ have a copy of the main set of refs: $ rad inspect rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --refs z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi └── refs +    ├── cobs +    │   └── xyz.radicle.id +    │      └── [...]    ├── heads    │   └── master    └── rad @@ -39,7 +45,6 @@ z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk    ├── heads    │   └── master    └── rad -       ├── id       └── sigrefs ``` diff --git a/radicle-cli/examples/rad-id-conflict.md b/radicle-cli/examples/rad-id-conflict.md new file mode 100644 index 00000000..342fc1f4 --- /dev/null +++ b/radicle-cli/examples/rad-id-conflict.md @@ -0,0 +1,104 @@ +First let's add Bob as a delegate, and sync the changes to Bob: + +``` ~alice +$ rad id update --title "Add Bob" --description "Add Bob as a delegate" --delegate did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk --threshold 2 -q +bd41a1cc152a7cb8b9fb84261e4214ffa4cdb7a4 +``` +``` ~bob +$ cd heartwood +$ rad sync --fetch rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji +✓ Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from z6MknSL…StBU8Vi.. +✓ Fetched repository from 1 seed(s) +``` + +One thing that can happen is that two delegates propose a revision at the same +time: + +``` ~alice +$ rad id update --title "Edit project name" --description "" --payload "xyz.radicle.project" "name" '"heart"' -q +6c07e4e604d855f6730f884dc56216c5698ef7f8 +``` +``` ~bob +$ rad id update --title "Edit project name" --description "" --payload "xyz.radicle.project" "name" '"wood"' -q +fae22d07f7d386b89f14ac353b079c9eef71f948 +``` + +When Alice syncs with Bob, she notices the problem: there are two active +revisions. + +``` ~alice +$ rad sync --fetch rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji +✓ Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from z6Mkt67…v4N1tRk.. +✓ Fetched repository from 1 seed(s) +$ rad id list +╭──────────────────────────────────────────────────────────────────────────────────────╮ +│ ● ID Title Author Status Created │ +├──────────────────────────────────────────────────────────────────────────────────────┤ +│ ● fae22d0 Edit project name bob z6Mkt67…v4N1tRk active [ ... ] │ +│ ● 6c07e4e Edit project name alice (you) active [ ... ] │ +│ ● bd41a1c Add Bob alice (you) accepted [ ... ] │ +│ ● 2317f74 Initial revision alice (you) accepted [ ... ] │ +╰──────────────────────────────────────────────────────────────────────────────────────╯ +``` + +This isn't a problem as long as we don't try to accept both. So let's accept +Bob's: + +``` ~alice +$ rad id accept fae22d0 -q +$ rad id list +╭──────────────────────────────────────────────────────────────────────────────────────╮ +│ ● ID Title Author Status Created │ +├──────────────────────────────────────────────────────────────────────────────────────┤ +│ ● fae22d0 Edit project name bob z6Mkt67…v4N1tRk accepted [ ... ] │ +│ ● 6c07e4e Edit project name alice (you) stale [ ... ] │ +│ ● bd41a1c Add Bob alice (you) accepted [ ... ] │ +│ ● 2317f74 Initial revision alice (you) accepted [ ... ] │ +╰──────────────────────────────────────────────────────────────────────────────────────╯ +``` + +Doing so voided the other conflicting revision, and it can no longer be +accepted now. + +``` ~bob +$ rad sync --fetch rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji +✓ Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from z6MknSL…StBU8Vi.. +✓ Fetched repository from 1 seed(s) +``` +``` ~bob (fail) +$ rad id accept 6c07e4e -q +✗ Error: cannot vote on revision that is stale +$ rad id reject 6c07e4e -q +✗ Error: cannot vote on revision that is stale +``` +``` ~bob +$ rad id show 6c07e4e +╭────────────────────────────────────────────────────────────────────────╮ +│ Title Edit project name │ +│ Revision 6c07e4e604d855f6730f884dc56216c5698ef7f8 │ +│ Blob e93aa3e3c5c448bacd3537a81daf1437eccd046a │ +│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │ +│ State stale │ +│ Quorum no │ +├────────────────────────────────────────────────────────────────────────┤ +│ ✓ did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi alice │ +│ ? did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk bob (you) │ +╰────────────────────────────────────────────────────────────────────────╯ + +@@ -1,14 +1,14 @@ + { + "payload": { + "xyz.radicle.project": { + "defaultBranch": "master", + "description": "Radicle Heartwood Protocol & Stack", +- "name": "heartwood" ++ "name": "heart" + } + }, + "delegates": [ + "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", + "did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk" + ], + "threshold": 2 + } +``` diff --git a/radicle-cli/examples/rad-id-multi-delegate.md b/radicle-cli/examples/rad-id-multi-delegate.md new file mode 100644 index 00000000..12eee5ad --- /dev/null +++ b/radicle-cli/examples/rad-id-multi-delegate.md @@ -0,0 +1,186 @@ +``` ~alice +$ rad id update --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --title "Add Bob" --description "" --threshold 2 --delegate did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk --no-confirm -q +5666f744e2bc2333cab30ea0256bc4b61c3205bf +``` + +``` ~bob +$ rad sync --fetch rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji +✓ Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from z6MknSL…StBU8Vi.. +✓ Fetched repository from 1 seed(s) +$ rad id update --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --title "Add Eve" --description "" --delegate did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn --no-confirm +✓ Identity revision 9d9031417f1d86a6c0ed5ec2c4bf5820dca0eec9 created +╭────────────────────────────────────────────────────────────────────────╮ +│ Title Add Eve │ +│ Revision 9d9031417f1d86a6c0ed5ec2c4bf5820dca0eec9 │ +│ Blob 4c7fd4c7b7d7fd5d7088a7c952556fab99a034e9 │ +│ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │ +│ State active │ +│ Quorum no │ +├────────────────────────────────────────────────────────────────────────┤ +│ ✓ did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk bob (you) │ +│ ? did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi alice │ +╰────────────────────────────────────────────────────────────────────────╯ + +@@ -1,14 +1,15 @@ + { + "payload": { + "xyz.radicle.project": { + "defaultBranch": "master", + "description": "Radicle Heartwood Protocol & Stack", + "name": "heartwood" + } + }, + "delegates": [ + "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", +- "did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk" ++ "did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk", ++ "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" + ], + "threshold": 2 + } +``` + +``` ~alice +$ rad sync --fetch rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji +✓ Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from z6Mkt67…v4N1tRk.. +✓ Fetched repository from 1 seed(s) +$ rad inspect rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --delegates +did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (alice) +did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk (bob) +$ rad id accept 9d9031417f1d86a6c0ed5ec2c4bf5820dca0eec9 --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --no-confirm +✓ Revision 9d9031417f1d86a6c0ed5ec2c4bf5820dca0eec9 accepted +╭────────────────────────────────────────────────────────────────────────╮ +│ Title Add Eve │ +│ Revision 9d9031417f1d86a6c0ed5ec2c4bf5820dca0eec9 │ +│ Blob 4c7fd4c7b7d7fd5d7088a7c952556fab99a034e9 │ +│ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │ +│ State accepted │ +│ Quorum yes │ +├────────────────────────────────────────────────────────────────────────┤ +│ ✓ did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi alice (you) │ +│ ✓ did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk bob │ +╰────────────────────────────────────────────────────────────────────────╯ +$ rad inspect rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --delegates +did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (alice) +did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk (bob) +did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn +``` + +``` ~alice +$ rad id update --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --title "Make private" --description "" --visibility private --no-confirm -q +1483814d54ad1321fc4ddb1f8bf7d90454de1790 +``` + +We can list all revisions: + +``` ~alice +$ rad id list +╭─────────────────────────────────────────────────────────────────────────────────────╮ +│ ● ID Title Author Status Created │ +├─────────────────────────────────────────────────────────────────────────────────────┤ +│ ● 1483814 Make private alice (you) active [ ... ] │ +│ ● 9d90314 Add Eve bob z6Mkt67…v4N1tRk accepted [ ... ] │ +│ ● 5666f74 Add Bob alice (you) accepted [ ... ] │ +│ ● 2317f74 Initial revision alice (you) accepted [ ... ] │ +╰─────────────────────────────────────────────────────────────────────────────────────╯ +``` + +Despite being a delegate, Bob can't edit or redact Alice's revision: + +``` ~bob (fail) +$ rad id redact 1483814d54ad1321fc4ddb1f8bf7d90454de1790 +[..] +``` +``` ~bob (fail) +$ rad id edit --title "Boo!" --description "Boo!" 1483814d54ad1321fc4ddb1f8bf7d90454de1790 +[..] +``` + +Alice can edit: + +``` ~alice +$ rad id edit --title "Make private" --description "Privacy is cool." 1483814d54ad1321fc4ddb1f8bf7d90454de1790 +✓ Revision 1483814d54ad1321fc4ddb1f8bf7d90454de1790 edited +$ rad id show 1483814d54ad1321fc4ddb1f8bf7d90454de1790 +╭────────────────────────────────────────────────────────────────────────╮ +│ Title Make private │ +│ Revision 1483814d54ad1321fc4ddb1f8bf7d90454de1790 │ +│ Blob 79bc5c39103e811a3c9f11744f9a4029f063a5de │ +│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │ +│ State active │ +│ Quorum no │ +│ │ +│ Privacy is cool. │ +├────────────────────────────────────────────────────────────────────────┤ +│ ✓ did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi alice (you) │ +│ ? did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk bob │ +│ ? did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn │ +╰────────────────────────────────────────────────────────────────────────╯ + +@@ -1,15 +1,18 @@ + { + "payload": { + "xyz.radicle.project": { + "defaultBranch": "master", + "description": "Radicle Heartwood Protocol & Stack", + "name": "heartwood" + } + }, + "delegates": [ + "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", + "did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk", + "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" + ], +- "threshold": 2 ++ "threshold": 2, ++ "visibility": { ++ "type": "private" ++ } + } +``` + +And she can redact her revision: + +``` ~alice +$ rad id redact 1483814d54ad1321fc4ddb1f8bf7d90454de1790 +✓ Revision 1483814d54ad1321fc4ddb1f8bf7d90454de1790 redacted +``` +``` ~alice (fail) +$ rad id show 1483814d54ad1321fc4ddb1f8bf7d90454de1790 +✗ Error: revision `1483814d54ad1321fc4ddb1f8bf7d90454de1790` not found +``` + +Finally, Alice can also propose to remove Bob: +``` ~alice +$ rad id update --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --title "Remove Bob" --description "" --rescind did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk --no-confirm +✓ Identity revision ea60049b8265f60f3dcca21798ce50ef67779421 created +╭────────────────────────────────────────────────────────────────────────╮ +│ Title Remove Bob │ +│ Revision ea60049b8265f60f3dcca21798ce50ef67779421 │ +│ Blob 7109c1c201c223dd4e9fdb10f7330dc6f0310258 │ +│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │ +│ State active │ +│ Quorum no │ +├────────────────────────────────────────────────────────────────────────┤ +│ ✓ did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi alice (you) │ +│ ? did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk bob │ +│ ? did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn │ +╰────────────────────────────────────────────────────────────────────────╯ + +@@ -1,15 +1,14 @@ + { + "payload": { + "xyz.radicle.project": { + "defaultBranch": "master", + "description": "Radicle Heartwood Protocol & Stack", + "name": "heartwood" + } + }, + "delegates": [ + "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", +- "did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk", + "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" + ], + "threshold": 2 + } +``` diff --git a/radicle-cli/examples/rad-id-rebase.md b/radicle-cli/examples/rad-id-rebase.md deleted file mode 100644 index 3681d213..00000000 --- a/radicle-cli/examples/rad-id-rebase.md +++ /dev/null @@ -1,429 +0,0 @@ -In this example, we're going to see what happens when a proposal -drifts away from the latest Radicle identity. - -First off, we will create two proposals -- we can imagine two -delegates creating proposals concurrently. - -``` -$ rad id edit --title "Add Alice" --description "Add Alice as a delegate" --delegates did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn --no-confirm -✓ Identity proposal '6b73fce909f612d5d92084b91309d73c21fea396' created -title: Add Alice -description: Add Alice as a delegate -status: ❲open❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ -- "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -+ "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", -+ "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" - ], - "threshold": 1 - } - - -Accepted - -total: 0 -keys: [] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👎 no -``` - -``` -$ rad id edit --title "Add Bob" --description "Add Bob as a delegate" --delegates did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG --no-confirm -✓ Identity proposal '2bf3a85e209d10b11a65e7ed8a8085f6f18ac6bf' created -title: Add Bob -description: Add Bob as a delegate -status: ❲open❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ -- "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -+ "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", -+ "did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG" - ], - "threshold": 1 - } - - -Accepted - -total: 0 -keys: [] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👎 no -``` - -Now, if the first proposal was accepted and committed before the -second proposal, then the identity would be out of date. So let's run -through that and see what happens. - -``` -$ rad id accept 6b73fce909f612d5d92084b91309d73c21fea396 --no-confirm -✓ Accepted proposal ✓ -title: Add Alice -description: Add Alice as a delegate -status: ❲open❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ -- "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -+ "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", -+ "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" - ], - "threshold": 1 - } - - -Accepted - -total: 1 -keys: [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👍 yes -``` - -``` -$ rad id commit 6b73fce909f612d5d92084b91309d73c21fea396 --no-confirm -✓ Committed new identity '29ae4b72f5a315328f06fbd68dc1c396a2d5c45e' -title: Add Alice -description: Add Alice as a delegate -status: ❲committed❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ -- "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -+ "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", -+ "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" - ], - "threshold": 1 - } - - -Accepted - -total: 1 -keys: [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👍 yes -``` - -Now, when we go to accept the second proposal: - -``` -$ rad id accept 2bf3a85e209d10b11a65e7ed8a8085f6f18ac6bf --no-confirm -! Warning: Revision is out of date -! Warning: d96f425412c9f8ad5d9a9a05c9831d0728e2338d =/= 475cdfbc8662853dd132ec564e4f5eb0f152dd7f -* Consider using 'rad id rebase' to update the proposal to the latest identity -✓ Accepted proposal ✓ -title: Add Bob -description: Add Bob as a delegate -status: ❲open❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", -- "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" -+ "did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG" - ], - "threshold": 1 - } - - -Accepted - -total: 1 -keys: [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👍 yes -``` - -Note that a warning was emitted: - - ! Warning: Revision is out of date - ! Warning: d96f425412c9f8ad5d9a9a05c9831d0728e2338d =/= 475cdfbc8662853dd132ec564e4f5eb0f152dd7f - * Consider using 'rad id rebase' to update the proposal to the latest identity - -If we attempt to commit this revision, the command will fail: - -``` (fail) -$ rad id commit 2bf3a85e209d10b11a65e7ed8a8085f6f18ac6bf --no-confirm -! Warning: Revision is out of date -! Warning: d96f425412c9f8ad5d9a9a05c9831d0728e2338d =/= 475cdfbc8662853dd132ec564e4f5eb0f152dd7f -* Consider using 'rad id rebase' to update the proposal to the latest identity -✗ Error: the identity hashes do not match for revision 2bf3a85e209d10b11a65e7ed8a8085f6f18ac6bf (d96f425412c9f8ad5d9a9a05c9831d0728e2338d =/= 475cdfbc8662853dd132ec564e4f5eb0f152dd7f) -``` - -So, let's fix this by running a rebase on the proposal's revision: - -``` -$ rad id rebase 2bf3a85e209d10b11a65e7ed8a8085f6f18ac6bf --no-confirm -✓ Identity proposal '2bf3a85e209d10b11a65e7ed8a8085f6f18ac6bf' rebased -✓ Revision 'e56b3e0842a4dd37c2a997344bcb4113704e4768' -title: Add Bob -description: Add Bob as a delegate -status: ❲open❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", -- "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" -+ "did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG" - ], - "threshold": 1 - } - - -Accepted - -total: 0 -keys: [] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👎 no -``` - -We can now update the proposal to have both keys in the delegates set: - -``` -$ rad id update 2bf3a85e209d10b11a65e7ed8a8085f6f18ac6bf --rev e56b3e0842a4dd37c2a997344bcb4113704e4768 --delegates did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn --no-confirm -✓ Identity proposal '2bf3a85e209d10b11a65e7ed8a8085f6f18ac6bf' updated -✓ Revision 'f15fc641d777cfb005caaa9405e262e516b8ac60' -title: Add Bob -description: Add Bob as a delegate -status: ❲open❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", -+ "did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG", - "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" - ], - "threshold": 1 - } - - -Accepted - -total: 0 -keys: [] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👎 no -``` - -Finally, we can accept and commit this proposal, creating the final -state of our new Radicle identity: - -$ rad id show 2bf3a85e209d10b11a65e7ed8a8085f6f18ac6bf --revisions - -``` -$ rad id accept 2bf3a85e209d10b11a65e7ed8a8085f6f18ac6bf --rev f15fc641d777cfb005caaa9405e262e516b8ac60 --no-confirm -✓ Accepted proposal ✓ -title: Add Bob -description: Add Bob as a delegate -status: ❲open❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", -+ "did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG", - "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" - ], - "threshold": 1 - } - - -Accepted - -total: 1 -keys: [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👍 yes -``` - -``` -$ rad id commit 2bf3a85e209d10b11a65e7ed8a8085f6f18ac6bf --rev f15fc641d777cfb005caaa9405e262e516b8ac60 --no-confirm -✓ Committed new identity '60de897bc24898f6908fd1272633c0b15aa4096f' -title: Add Bob -description: Add Bob as a delegate -status: ❲committed❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", -+ "did:key:z6MkjchhfUsD6mmvni8mCdXHw216Xrm9bQe2mBH1P5RDjVJG", - "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" - ], - "threshold": 1 - } - - -Accepted - -total: 1 -keys: [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👍 yes -``` diff --git a/radicle-cli/examples/rad-id.md b/radicle-cli/examples/rad-id.md index 368ddae0..e01921bc 100644 --- a/radicle-cli/examples/rad-id.md +++ b/radicle-cli/examples/rad-id.md @@ -4,24 +4,32 @@ maintainer. This requires adding them as a `delegate` and possibly editing the `threshold` for passing new changes to the identity of the project. -For cases where `threshold = 1`, it is enough to use the `rad -delegate` command. For cases where `threshold > 1`, it is necessary to -gather a quorum of signatures to update the Radicle identity. To do -this, we use the `rad id` command. +For cases where `threshold > 1`, it is necessary to gather a quorum of +signatures to update the Radicle identity. To do this, we use the `rad id` +command. For now, since we are the only delegate, and `treshold` is `1`, we +can update the identity ourselves. -Let's add Bob as a delegate using their DID -`did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn`. +Let's add Bob as a delegate using their DID, +`did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn`, and update the +threshold to `2`. ``` -$ rad id edit --title "Add Bob" --description "Add Bob as a delegate" --delegates did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn --no-confirm -✓ Identity proposal '662a8065f18db50d9ee952bb36eda5b605f161e9' created -title: Add Bob -description: Add Bob as a delegate -status: ❲open❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff +$ rad id update --title "Add Bob" --description "Add Bob as a delegate" --delegate did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn --threshold 2 +✓ Identity revision d067ffc7bf65d318dd68ca4b8c7adf61a369ea2f created +╭───────────────────────────────────────────────────────────────────╮ +│ Title Add Bob │ +│ Revision d067ffc7bf65d318dd68ca4b8c7adf61a369ea2f │ +│ Blob 7109c1c201c223dd4e9fdb10f7330dc6f0310258 │ +│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │ +│ State accepted │ +│ Quorum yes │ +│ │ +│ Add Bob as a delegate │ +├───────────────────────────────────────────────────────────────────┤ +│ ✓ did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) │ +╰───────────────────────────────────────────────────────────────────╯ +@@ -1,13 +1,14 @@ { "payload": { "xyz.radicle.project": { @@ -35,367 +43,97 @@ Document Diff + "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", + "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" ], - "threshold": 1 +- "threshold": 1 ++ "threshold": 2 } - - -Accepted - -total: 0 -keys: [] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👎 no ``` Before moving on, let's take a few notes on this output. The first thing we'll notice is that the difference between the current identity document and the proposed changes are shown. Specifically, we changed -the delegates: +the delegates and threshold: - "delegates": [ - - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" - + "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", - + "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" - ], + "delegates": [ + - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" + + "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", + + "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" + ], + ... + - "threshold": 1 + + "threshold": 2 -Next we have the number of `Accepted` reviews from delegates, starting -off with none: +Next we have the number of signatures from delegates, which includes our own: - Accepted - - total: 0 - keys: [] - -The same with `Rejected` reviews: - - Rejected - - total: 0 - keys: [] + ✓ did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi Finally, we can see whether the `Quorum` was reached: - Quorum Reached + Quorum yes - 👎 no - -Let's see what happens when we reject the change: +Since the threshold was previously `1`, this change is now in effect. We +can verify that by listing the current identity document: ``` -$ rad id reject 662a8065f18db50d9ee952bb36eda5b605f161e9 --no-confirm -✓ Rejected proposal 👎 -title: Add Bob -description: Add Bob as a delegate -status: ❲open❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ -- "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -+ "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", -+ "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" - ], - "threshold": 1 - } - - -Accepted - -total: 0 -keys: [] - -Rejected - -total: 1 -keys: [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -] - -Quorum Reached - -👎 no +$ rad inspect --identity +{ + "payload": { + "xyz.radicle.project": { + "defaultBranch": "master", + "description": "Radicle Heartwood Protocol & Stack", + "name": "heartwood" + } + }, + "delegates": [ + "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", + "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" + ], + "threshold": 2 +} ``` -Our key was added to the `Rejected` set of `keys` and the `total` -increased to `1`. +We can also look at the document's COB directly: +``` +$ rad cob show --object 2317f74de0494c489a233ca6f29f2b8bff6d4f15 --type xyz.radicle.id --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji +commit d067ffc7bf65d318dd68ca4b8c7adf61a369ea2f +parent 2317f74de0494c489a233ca6f29f2b8bff6d4f15 +author z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi +date Thu, 15 Dec 2022 17:28:04 +0000 - Rejected + { + "blob": "7109c1c201c223dd4e9fdb10f7330dc6f0310258", + "description": "Add Bob as a delegate", + "parent": "2317f74de0494c489a233ca6f29f2b8bff6d4f15", + "signature": "z3sne3sdReZ4AtgxQmn7R1pQnz7E9ZEUoRfCJDJ8ytgnBMFW4DJqRHuBz2h1NK4QdGEy3QCpyVoJKfE95tNoivXwz", + "title": "Add Bob", + "type": "revision" + } - total: 1 - keys: [ - "z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" - ] +commit 2317f74de0494c489a233ca6f29f2b8bff6d4f15 +author z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi +date Thu, 15 Dec 2022 17:28:04 +0000 -Instead, let's accept the proposal: + { + "blob": "d96f425412c9f8ad5d9a9a05c9831d0728e2338d", + "parent": null, + "signature": "z5nGqUvrmfiSyLjNCHWTWYvVMcPUZcvo9TxPKzEKXYBdSgUzbrqf1cYsmpGgbQvYunnsrLSsubEmxZaRdKM4quqQR", + "title": "Initial revision", + "type": "revision" + } ``` -$ rad id accept 662a8065f18db50d9ee952bb36eda5b605f161e9 --no-confirm -✓ Accepted proposal ✓ -title: Add Bob -description: Add Bob as a delegate -status: ❲open❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi -Document Diff +Note that once a revision is accepted, it can't be edited, redacted or otherwise +acted upon: - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ -- "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -+ "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", -+ "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" - ], - "threshold": 1 - } - - -Accepted - -total: 1 -keys: [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👍 yes +``` (fail) +$ rad id redact d067ffc7bf65d318dd68ca4b8c7adf61a369ea2f +✗ Error: [..] ``` - -Our key has changed from the `Rejected` set to the `Accepted` set -instead: - - Accepted - - total: 1 - keys: [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" - ] - -As well as that, the `Quorum` has now been reached: - - Quorum Reached - - 👍 yes - -At this point, we can commit the proposal and update the identity: - +``` (fail) +$ rad id reject d067ffc7bf65d318dd68ca4b8c7adf61a369ea2f +✗ Error: [..] ``` -$ rad id commit 662a8065f18db50d9ee952bb36eda5b605f161e9 --no-confirm -✓ Committed new identity 'c96e764965aaeff1c6ea3e5b97e2b9828773c8b0' -title: Add Bob -description: Add Bob as a delegate -status: ❲committed❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ -- "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -+ "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", -+ "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" - ], - "threshold": 1 - } - - -Accepted - -total: 1 -keys: [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" -] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👍 yes +``` (fail) +$ rad id accept d067ffc7bf65d318dd68ca4b8c7adf61a369ea2f +✗ Error: [..] ``` - -Let's say we decide to also change the `threshold`, we can do so using -the `--threshold` option: - -``` -$ rad id edit --title "Update threshold" --description "Update to safer threshold" --threshold 2 --no-confirm -✓ Identity proposal 'e6c04862ed0e59739f34232c8690cbad73840a93' created -title: Update threshold -description: Update to safer threshold -status: ❲open❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", - "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" - ], -- "threshold": 1 -+ "threshold": 2 - } - - -Accepted - -total: 0 -keys: [] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👎 no -``` - -But we change our minds and decide to close the proposal instead: - -``` -$ rad id close e6c04862ed0e59739f34232c8690cbad73840a93 --no-confirm -✓ Closed identity proposal 'e6c04862ed0e59739f34232c8690cbad73840a93' -title: Update threshold -description: Update to safer threshold -status: ❲closed❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", - "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" - ], -- "threshold": 1 -+ "threshold": 2 - } - - -Accepted - -total: 0 -keys: [] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👎 no -``` - -The proposal is now closed and cannot be committed. If at a later date -we want to update the document with the same change we have to open a -new proposal. - -If at any time we want to see what proposals have been made to this -Radicle identity, then we can use the list command: - -``` -$ rad id list -662a8065f18db50d9ee952bb36eda5b605f161e9 "Add Bob" ❲committed❳ -e6c04862ed0e59739f34232c8690cbad73840a93 "Update threshold" ❲closed❳ -``` - -And if we want to view the latest state of any proposal we can use the -show command: - -``` -$ rad id show e6c04862ed0e59739f34232c8690cbad73840a93 -title: Update threshold -description: Update to safer threshold -status: ❲closed❳ -author: did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - -Document Diff - - { - "payload": { - "xyz.radicle.project": { - "defaultBranch": "master", - "description": "Radicle Heartwood Protocol & Stack", - "name": "heartwood" - } - }, - "delegates": [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi", - "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn" - ], -- "threshold": 1 -+ "threshold": 2 - } - - -Accepted - -total: 0 -keys: [] - -Rejected - -total: 0 -keys: [] - -Quorum Reached - -👎 no -``` - -On a final note, these examples used `--no-confirm`. The default mode -for making proposals is to select and confirm any actions being -performed on the proposal. diff --git a/radicle-cli/examples/rad-init-private-clone.md b/radicle-cli/examples/rad-init-private-clone.md index 8310943c..8e164e58 100644 --- a/radicle-cli/examples/rad-init-private-clone.md +++ b/radicle-cli/examples/rad-init-private-clone.md @@ -16,11 +16,8 @@ She allows Bob to view the repository. And when she syncs, one node (Bob) gets the refs. ``` ~alice -$ rad id edit --allow did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk -q -e98cd6a0a3e94837b382e59e02b3ea83991a8244 -$ rad id accept e98cd6a0a3e94837b382e59e02b3ea83991a8244 -q -$ rad id commit e98cd6a0a3e94837b382e59e02b3ea83991a8244 -q -c568f8aac97db40a5e63e1261872bfbd9a3a61e4 +$ rad id update --title "Allow Bob" --description "" --allow did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk -q +... $ rad sync --announce --timeout 3 ✓ Synced with 1 node(s) ``` diff --git a/radicle-cli/examples/rad-inspect.md b/radicle-cli/examples/rad-inspect.md index 4b045353..43600ce6 100644 --- a/radicle-cli/examples/rad-inspect.md +++ b/radicle-cli/examples/rad-inspect.md @@ -19,6 +19,9 @@ It's also possible to display all of the repository's git references: $ rad inspect --refs z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi └── refs +    ├── cobs +    │   └── xyz.radicle.id +    │      └── 2317f74de0494c489a233ca6f29f2b8bff6d4f15    ├── heads    │   └── master    └── rad @@ -46,18 +49,13 @@ history: ``` $ rad inspect --history -commit 175267b8910895ba87760313af254c2900743912 +commit 2317f74de0494c489a233ca6f29f2b8bff6d4f15 blob d96f425412c9f8ad5d9a9a05c9831d0728e2338d date Thu, 15 Dec 2022 17:28:04 +0000 - Initialize Radicle - - Rad-Signature: z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi z5nGqUvrmfiSyLjNCHWTWYvVMcPUZcvo9TxPKzEKXYBdSgUzbrqf1cYsmpGgbQvYunnsrLSsubEmxZaRdKM4quqQR + Initialize identity { - "delegates": [ - "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" - ], "payload": { "xyz.radicle.project": { "defaultBranch": "master", @@ -65,6 +63,9 @@ date Thu, 15 Dec 2022 17:28:04 +0000 "name": "heartwood" } }, + "delegates": [ + "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi" + ], "threshold": 1 } diff --git a/radicle-cli/examples/rad-issue.md b/radicle-cli/examples/rad-issue.md index 735620e9..733b9194 100644 --- a/radicle-cli/examples/rad-issue.md +++ b/radicle-cli/examples/rad-issue.md @@ -7,7 +7,7 @@ Let's say the new car you are designing with your peers has a problem with its f $ rad issue open --title "flux capacitor underpowered" --description "Flux capacitor power requirements exceed current supply" --no-announce ╭─────────────────────────────────────────────────────────╮ │ Title flux capacitor underpowered │ -│ Issue 42028af21fabc09bfac2f25490f119f7c7e11542 │ +│ Issue 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d │ │ Author z6MknSL…StBU8Vi (you) │ │ Status open │ │ │ @@ -22,17 +22,17 @@ $ rad issue list ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ ● ID Title Author Labels Assignees Opened │ ├─────────────────────────────────────────────────────────────────────────────────────────────────────────┤ -│ ● 42028af flux capacitor underpowered z6MknSL…StBU8Vi (you) [ .. ] │ +│ ● 9bf82c1 flux capacitor underpowered z6MknSL…StBU8Vi (you) [ .. ] │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` Show the issue information issue. ``` -$ rad issue show 42028af +$ rad issue show 9bf82c1 ╭─────────────────────────────────────────────────────────╮ │ Title flux capacitor underpowered │ -│ Issue 42028af21fabc09bfac2f25490f119f7c7e11542 │ +│ Issue 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d │ │ Author z6MknSL…StBU8Vi (you) │ │ Status open │ │ │ @@ -49,7 +49,7 @@ others to work on. This is to ensure work is not duplicated. Let's assign ourselves to this one. ``` -$ rad assign 42028af21fabc09bfac2f25490f119f7c7e11542 --to did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi +$ rad assign 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d --to did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi ``` It will now show in the list of issues assigned to us. @@ -59,14 +59,14 @@ $ rad issue list --assigned ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ ● ID Title Author Labels Assignees Opened │ ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ -│ ● 42028af flux capacitor underpowered z6MknSL…StBU8Vi (you) z6MknSL…StBU8Vi [ .. ] │ +│ ● 9bf82c1 flux capacitor underpowered z6MknSL…StBU8Vi (you) z6MknSL…StBU8Vi [ .. ] │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` Note: this can always be undone with the `unassign` subcommand. ``` -$ rad unassign 42028af21fabc09bfac2f25490f119f7c7e11542 --from did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi +$ rad unassign 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d --from did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi ``` Great, now we have communicated to the world about our car's defect. @@ -75,28 +75,28 @@ But wait! We've found an important detail about the car's power requirements. It will help whoever works on a fix. ``` -$ rad issue comment 42028af21fabc09bfac2f25490f119f7c7e11542 --message 'The flux capacitor needs 1.21 Gigawatts' -q -84492237dc0908b1e5b728d1a4e5f1343b6ffe9b -$ rad issue comment 42028af21fabc09bfac2f25490f119f7c7e11542 --reply-to 84492237dc0908b1e5b728d1a4e5f1343b6ffe9b --message 'More power!' -q -dd679552a15e2db73bbedf3084f5f7c62bb0d724 +$ rad issue comment 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d --message 'The flux capacitor needs 1.21 Gigawatts' -q +1a8e9d3d62d22b247064b12d1d89ad8598504129 +$ rad issue comment 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d --reply-to 1a8e9d3d62d22b247064b12d1d89ad8598504129 --message 'More power!' -q +fb6ab7e0ca5be3c34688bcae37d7302bb824decf ``` We can see our comments by showing the issue: ``` -$ rad issue show 42028af21fabc09bfac2f25490f119f7c7e11542 +$ rad issue show 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d ╭─────────────────────────────────────────────────────────╮ │ Title flux capacitor underpowered │ -│ Issue 42028af21fabc09bfac2f25490f119f7c7e11542 │ +│ Issue 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d │ │ Author z6MknSL…StBU8Vi (you) │ │ Status open │ │ │ │ Flux capacitor power requirements exceed current supply │ ├─────────────────────────────────────────────────────────┤ -│ z6MknSL…StBU8Vi (you) [ ... ] 8449223 │ +│ z6MknSL…StBU8Vi (you) [ ... ] 1a8e9d3 │ │ The flux capacitor needs 1.21 Gigawatts │ ├─────────────────────────────────────────────────────────┤ -│ z6MknSL…StBU8Vi (you) [ ... ] dd67955 │ +│ z6MknSL…StBU8Vi (you) [ ... ] fb6ab7e │ │ More power! │ ╰─────────────────────────────────────────────────────────╯ ``` diff --git a/radicle-cli/examples/rad-label.md b/radicle-cli/examples/rad-label.md index 7b9f2f4a..7decb7ae 100644 --- a/radicle-cli/examples/rad-label.md +++ b/radicle-cli/examples/rad-label.md @@ -2,16 +2,16 @@ Labeling an issue is easy, let's add the `bug` and `good-first-issue` labels to some issue: ``` -$ rad label 42028af21fabc09bfac2f25490f119f7c7e11542 bug good-first-issue +$ rad label 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d bug good-first-issue ``` We can now show the issue to check whether those labels were added: ``` -$ rad issue show 42028af21fabc09bfac2f25490f119f7c7e11542 --format header +$ rad issue show 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d --format header ╭─────────────────────────────────────────────────────────╮ │ Title flux capacitor underpowered │ -│ Issue 42028af21fabc09bfac2f25490f119f7c7e11542 │ +│ Issue 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d │ │ Author z6MknSL…StBU8Vi (you) │ │ Labels bug, good-first-issue │ │ Status open │ @@ -23,16 +23,16 @@ $ rad issue show 42028af21fabc09bfac2f25490f119f7c7e11542 --format header Untagging an issue is very similar: ``` -$ rad unlabel 42028af21fabc09bfac2f25490f119f7c7e11542 good-first-issue +$ rad unlabel 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d good-first-issue ``` Notice that the `good-first-issue` label has disappeared: ``` -$ rad issue show 42028af21fabc09bfac2f25490f119f7c7e11542 --format header +$ rad issue show 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d --format header ╭─────────────────────────────────────────────────────────╮ │ Title flux capacitor underpowered │ -│ Issue 42028af21fabc09bfac2f25490f119f7c7e11542 │ +│ Issue 9bf82c141d5a9c54bb1d6b4517eb3bb7da8fb30d │ │ Author z6MknSL…StBU8Vi (you) │ │ Labels bug │ │ Status open │ diff --git a/radicle-cli/examples/rad-merge-after-update.md b/radicle-cli/examples/rad-merge-after-update.md index ee176938..787eb6e5 100644 --- a/radicle-cli/examples/rad-merge-after-update.md +++ b/radicle-cli/examples/rad-merge-after-update.md @@ -4,7 +4,7 @@ Let's start by creating a patch. $ git checkout -b feature/1 -q $ git commit --allow-empty -q -m "First change" $ git push rad HEAD:refs/patches -✓ Patch 143bb0c962561b09e86478a53ba346b5ff934335 opened +✓ Patch f6c96cca58521d6dbb6cd4e6b7124342b9a86945 opened To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi * [new reference] HEAD -> refs/patches ``` @@ -26,8 +26,8 @@ update it, we expect it to be updated and merged: ``` (stderr) RAD_SOCKET=/dev/null $ git checkout feature/1 -q $ git push -f -✓ Patch 143bb0c updated to e595bf1246bdcee7b0c20615e479f62d2bf02249 -✓ Patch 143bb0c962561b09e86478a53ba346b5ff934335 merged +✓ Patch f6c96cc updated to [...] +✓ Patch f6c96cca58521d6dbb6cd4e6b7124342b9a86945 merged To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - + 20aa5dd...954bcdb feature/1 -> patches/143bb0c962561b09e86478a53ba346b5ff934335 (forced update) + + 20aa5dd...954bcdb feature/1 -> patches/f6c96cca58521d6dbb6cd4e6b7124342b9a86945 (forced update) ``` diff --git a/radicle-cli/examples/rad-merge-no-ff.md b/radicle-cli/examples/rad-merge-no-ff.md index a0326501..05f99a74 100644 --- a/radicle-cli/examples/rad-merge-no-ff.md +++ b/radicle-cli/examples/rad-merge-no-ff.md @@ -4,7 +4,7 @@ First, let's create a patch. $ git checkout -b feature/1 -q $ git commit --allow-empty -q -m "First change" $ git push rad HEAD:refs/patches -✓ Patch 143bb0c962561b09e86478a53ba346b5ff934335 opened +✓ Patch f6c96cca58521d6dbb6cd4e6b7124342b9a86945 opened To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi * [new reference] HEAD -> refs/patches ``` @@ -36,7 +36,7 @@ committer radicle 1671125284 +0000 Finally, we push master and expect the patch to be merged. ``` (stderr) RAD_SOCKET=/dev/null $ git push rad master -✓ Patch 143bb0c962561b09e86478a53ba346b5ff934335 merged +✓ Patch f6c96cca58521d6dbb6cd4e6b7124342b9a86945 merged To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi f2de534..737a10c master -> master ``` diff --git a/radicle-cli/examples/rad-merge-via-push.md b/radicle-cli/examples/rad-merge-via-push.md index c65e579a..15e3bf9d 100644 --- a/radicle-cli/examples/rad-merge-via-push.md +++ b/radicle-cli/examples/rad-merge-via-push.md @@ -4,7 +4,7 @@ Let's start by creating two patches. $ git checkout -b feature/1 -q $ git commit --allow-empty -q -m "First change" $ git push rad HEAD:refs/patches -✓ Patch 143bb0c962561b09e86478a53ba346b5ff934335 opened +✓ Patch f6c96cca58521d6dbb6cd4e6b7124342b9a86945 opened To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi * [new reference] HEAD -> refs/patches ``` @@ -12,7 +12,7 @@ To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkE $ git checkout -b feature/2 -q master $ git commit --allow-empty -q -m "Second change" $ git push rad HEAD:refs/patches -✓ Patch 5d0e608aa35af59f769e9d6a2c0227ea60ae2740 opened +✓ Patch 3b8203713e2945a6c46b238e6a432bd2711d3ccf opened To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi * [new reference] HEAD -> refs/patches ``` @@ -22,8 +22,8 @@ This creates some remote tracking branches for us: ``` $ git branch -r rad/master - rad/patches/143bb0c962561b09e86478a53ba346b5ff934335 - rad/patches/5d0e608aa35af59f769e9d6a2c0227ea60ae2740 + rad/patches/3b8203713e2945a6c46b238e6a432bd2711d3ccf + rad/patches/f6c96cca58521d6dbb6cd4e6b7124342b9a86945 ``` And some remote refs: @@ -33,14 +33,16 @@ $ rad inspect --refs z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi └── refs    ├── cobs +    │   ├── xyz.radicle.id +    │   │   └── 2317f74de0494c489a233ca6f29f2b8bff6d4f15    │   └── xyz.radicle.patch -    │      ├── 143bb0c962561b09e86478a53ba346b5ff934335 -    │      └── 5d0e608aa35af59f769e9d6a2c0227ea60ae2740 +    │      ├── 3b8203713e2945a6c46b238e6a432bd2711d3ccf +    │      └── f6c96cca58521d6dbb6cd4e6b7124342b9a86945    ├── heads    │   ├── master    │   └── patches -    │      ├── 143bb0c962561b09e86478a53ba346b5ff934335 -    │      └── 5d0e608aa35af59f769e9d6a2c0227ea60ae2740 +    │      ├── 3b8203713e2945a6c46b238e6a432bd2711d3ccf +    │      └── f6c96cca58521d6dbb6cd4e6b7124342b9a86945    └── rad       ├── id       └── sigrefs @@ -59,8 +61,8 @@ When we push to `rad/master`, we automatically merge the patches: ``` (stderr) RAD_SOCKET=/dev/null $ git push rad master -✓ Patch 143bb0c962561b09e86478a53ba346b5ff934335 merged -✓ Patch 5d0e608aa35af59f769e9d6a2c0227ea60ae2740 merged +✓ Patch 3b8203713e2945a6c46b238e6a432bd2711d3ccf merged +✓ Patch f6c96cca58521d6dbb6cd4e6b7124342b9a86945 merged To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi f2de534..d6399c7 master -> master ``` @@ -69,8 +71,8 @@ $ rad patch --merged ╭─────────────────────────────────────────────────────────────────────────╮ │ ● ID Title Author Head + - Updated │ ├─────────────────────────────────────────────────────────────────────────┤ -│ ✔ 143bb0c First change alice (you) 20aa5dd +0 -0 [ ... ] │ -│ ✔ 5d0e608 Second change alice (you) daf349f +0 -0 [ ... ] │ +│ ✔ [ ... ] Second change alice (you) daf349f +0 -0 [ ... ] │ +│ ✔ [ ... ] First change alice (you) 20aa5dd +0 -0 [ ... ] │ ╰─────────────────────────────────────────────────────────────────────────╯ ``` @@ -88,9 +90,11 @@ $ rad inspect --refs z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi └── refs    ├── cobs +    │   ├── xyz.radicle.id +    │   │   └── 2317f74de0494c489a233ca6f29f2b8bff6d4f15    │   └── xyz.radicle.patch -    │      ├── 143bb0c962561b09e86478a53ba346b5ff934335 -    │      └── 5d0e608aa35af59f769e9d6a2c0227ea60ae2740 +    │      ├── 3b8203713e2945a6c46b238e6a432bd2711d3ccf +    │      └── f6c96cca58521d6dbb6cd4e6b7124342b9a86945    ├── heads    │   └── master    └── rad diff --git a/radicle-cli/examples/rad-patch-ahead-behind.md b/radicle-cli/examples/rad-patch-ahead-behind.md index 1585758e..fc7271c2 100644 --- a/radicle-cli/examples/rad-patch-ahead-behind.md +++ b/radicle-cli/examples/rad-patch-ahead-behind.md @@ -37,7 +37,7 @@ $ git log --graph --decorate --abbrev-commit --pretty=oneline --all Then we create a patch from `feature/1`: ``` (stderr) $ git push rad feature/1:refs/patches -✓ Patch 69ebafb6f654fb29d23f630cc165d83d6cbf525c opened +✓ Patch 71e51dfcf7ca124a75ec6e0cb21b13bf86b8bb2e opened To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi * [new reference] feature/1 -> refs/patches ``` @@ -48,17 +48,17 @@ $ rad patch list ╭─────────────────────────────────────────────────────────────────────────────╮ │ ● ID Title Author Head + - Updated │ ├─────────────────────────────────────────────────────────────────────────────┤ -│ ● 69ebafb Add Alan z6MknSL…StBU8Vi (you) 5c88a79 +1 -0 [ ... ] │ +│ ● 71e51df Add Alan z6MknSL…StBU8Vi (you) 5c88a79 +1 -0 [ ... ] │ ╰─────────────────────────────────────────────────────────────────────────────╯ ``` When showing the patch, we see that it is `ahead 1, behind 1`, since master has diverged by one commit: ``` -$ rad patch show -v -p 69ebafb +$ rad patch show -v -p 71e51df ╭────────────────────────────────────────────────────╮ │ Title Add Alan │ -│ Patch 69ebafb6f654fb29d23f630cc165d83d6cbf525c │ +│ Patch 71e51dfcf7ca124a75ec6e0cb21b13bf86b8bb2e │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 5c88a79d75f5c2b4cc51ee6f163d2db91ee198d7 │ │ Base f64fb2c8fe28f7c458c72ec8d700373924794943 │ @@ -93,7 +93,7 @@ $ git checkout -q -b feature/2 feature/1 $ sed -i '$a Mel Farna' CONTRIBUTORS $ git commit -a -q -m "Add Mel" $ git push -o patch.message="Add Mel" rad HEAD:refs/patches -✓ Patch 53d5f17aba5fd9b7de7a02ecb6f01de561701eeb opened +✓ Patch 364cc2809f14c1bc74a8868159e87eb3844eb7e2 opened To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi * [new reference] HEAD -> refs/patches ``` @@ -101,10 +101,10 @@ To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkE When we look at the patch, we see that it has both commits, because this new patch uses the same base as the previous patch: ``` -$ rad patch show -v 53d5f17aba5fd9b7de7a02ecb6f01de561701eeb +$ rad patch show -v 364cc2809f14c1bc74a8868159e87eb3844eb7e2 ╭────────────────────────────────────────────────────╮ │ Title Add Mel │ -│ Patch 53d5f17aba5fd9b7de7a02ecb6f01de561701eeb │ +│ Patch 364cc2809f14c1bc74a8868159e87eb3844eb7e2 │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 7f63fcbcf23fc39eea784c091ad3d20d7e4bd005 │ │ Base f64fb2c8fe28f7c458c72ec8d700373924794943 │ @@ -124,7 +124,7 @@ If we want to instead create a "stacked" patch, we can do so with the ``` (stderr) $ git push -o patch.message="Add Mel #2" -o patch.base=5c88a79d75f5c2b4cc51ee6f163d2db91ee198d7 rad HEAD:refs/patches -✓ Patch 459dc67a024ff30c3bca02f0f1e5b746459ce32a opened +✓ Patch 11ab7fbec82c3aed393d7a696d6b3c7714735056 opened To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi * [new reference] HEAD -> refs/patches ``` @@ -136,10 +136,10 @@ However, since the patch is still intended to be merged into `master`, we see that it is still two commits ahead and one behind from `master`. ``` -$ rad patch show -v 459dc67a024ff30c3bca02f0f1e5b746459ce32a +$ rad patch show -v 11ab7fbec82c3aed393d7a696d6b3c7714735056 ╭────────────────────────────────────────────────────╮ │ Title Add Mel #2 │ -│ Patch 459dc67a024ff30c3bca02f0f1e5b746459ce32a │ +│ Patch 11ab7fbec82c3aed393d7a696d6b3c7714735056 │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 7f63fcbcf23fc39eea784c091ad3d20d7e4bd005 │ │ Base 5c88a79d75f5c2b4cc51ee6f163d2db91ee198d7 │ diff --git a/radicle-cli/examples/rad-patch-draft.md b/radicle-cli/examples/rad-patch-draft.md index 0c6edda7..56d63871 100644 --- a/radicle-cli/examples/rad-patch-draft.md +++ b/radicle-cli/examples/rad-patch-draft.md @@ -9,7 +9,7 @@ To open a patch in draft mode, we use the `--draft` option: ``` (stderr) $ git push -o patch.draft -o patch.message="Nothing yet" rad HEAD:refs/patches -✓ Patch 79a1a5138b7f91c6dead5544ecde285dc3d0cb45 drafted +✓ Patch 78fcb007b4a3a898379f1e220d4b9fb54ad04cfc drafted To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi * [new reference] HEAD -> refs/patches ``` @@ -17,10 +17,10 @@ To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkE We can confirm it's a draft by running `show`: ``` -$ rad patch show 79a1a5138b7f91c6dead5544ecde285dc3d0cb45 +$ rad patch show 78fcb007b4a3a898379f1e220d4b9fb54ad04cfc ╭────────────────────────────────────────────────────╮ │ Title Nothing yet │ -│ Patch 79a1a5138b7f91c6dead5544ecde285dc3d0cb45 │ +│ Patch 78fcb007b4a3a898379f1e220d4b9fb54ad04cfc │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 2a465832b5a76abe25be44a3a5d224bbd7741ba7 │ │ Branches cloudhead/draft │ @@ -36,14 +36,14 @@ $ rad patch show 79a1a5138b7f91c6dead5544ecde285dc3d0cb45 Once the patch is ready for review, we can use the `ready` command: ``` -$ rad patch ready 79a1a5138b7f91c6dead5544ecde285dc3d0cb45 +$ rad patch ready 78fcb007b4a3a898379f1e220d4b9fb54ad04cfc ``` ``` -$ rad patch show 79a1a5138b7f91c6dead5544ecde285dc3d0cb45 +$ rad patch show 78fcb007b4a3a898379f1e220d4b9fb54ad04cfc ╭────────────────────────────────────────────────────╮ │ Title Nothing yet │ -│ Patch 79a1a5138b7f91c6dead5544ecde285dc3d0cb45 │ +│ Patch 78fcb007b4a3a898379f1e220d4b9fb54ad04cfc │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 2a465832b5a76abe25be44a3a5d224bbd7741ba7 │ │ Branches cloudhead/draft │ @@ -60,11 +60,11 @@ If for whatever reason, it needed to go back into draft mode, we could use the `--undo` flag: ``` -$ rad patch ready --undo 79a1a5138b7f91c6dead5544ecde285dc3d0cb45 -$ rad patch show 79a1a5138b7f91c6dead5544ecde285dc3d0cb45 +$ rad patch ready --undo 78fcb007b4a3a898379f1e220d4b9fb54ad04cfc +$ rad patch show 78fcb007b4a3a898379f1e220d4b9fb54ad04cfc ╭────────────────────────────────────────────────────╮ │ Title Nothing yet │ -│ Patch 79a1a5138b7f91c6dead5544ecde285dc3d0cb45 │ +│ Patch 78fcb007b4a3a898379f1e220d4b9fb54ad04cfc │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 2a465832b5a76abe25be44a3a5d224bbd7741ba7 │ │ Branches cloudhead/draft │ diff --git a/radicle-cli/examples/rad-patch-pull-update.md b/radicle-cli/examples/rad-patch-pull-update.md index a8198e14..af6d8505 100644 --- a/radicle-cli/examples/rad-patch-pull-update.md +++ b/radicle-cli/examples/rad-patch-pull-update.md @@ -49,22 +49,22 @@ $ cd heartwood $ git checkout -b bob/feature -q $ git commit --allow-empty -m "Bob's commit #1" -q $ git push rad -o sync -o patch.message="Bob's patch" HEAD:refs/patches -✓ Patch 26e3e563ddc7df8dd0c9f81274c0b3cb1b764568 opened +✓ Patch 6d260fc8388e74d8fefb5dabc5a798e125ec3cf9 opened ✓ Synced with 1 node(s) To rad://zhbMU4DUXrzB8xT6qAJh6yZ7bFMK/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk * [new reference] HEAD -> refs/patches ``` ``` ~bob $ git status --short --branch -## bob/feature...rad/patches/26e3e563ddc7df8dd0c9f81274c0b3cb1b764568 +## bob/feature...rad/patches/6d260fc8388e74d8fefb5dabc5a798e125ec3cf9 ``` Alice checks it out. ``` ~alice -$ rad patch checkout 26e3e56 -✓ Switched to branch patch/26e3e56 -✓ Branch patch/26e3e56 setup to track rad/patches/26e3e563ddc7df8dd0c9f81274c0b3cb1b764568 +$ rad patch checkout 6d260fc8388e74d8fefb5dabc5a798e125ec3cf9 +✓ Switched to branch patch/6d260fc +✓ Branch patch/6d260fc setup to track rad/patches/6d260fc8388e74d8fefb5dabc5a798e125ec3cf9 $ git show commit bdcdb30b3c0f513620dd0f1c24ff8f4f71de956b Author: radicle @@ -78,19 +78,19 @@ Bob then updates the patch. ``` ~bob (stderr) $ git commit --allow-empty -m "Bob's commit #2" -q $ git push rad -o sync -o patch.message="Updated." -✓ Patch 26e3e56 updated to c04ef81bad734c65a7d5834cefcdd60c4f0484f7 +✓ Patch 6d260fc updated to 750081b35a3f831f428653bd2240eb4674ccae71 ✓ Synced with 1 node(s) To rad://zhbMU4DUXrzB8xT6qAJh6yZ7bFMK/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk - bdcdb30..cad2666 bob/feature -> patches/26e3e563ddc7df8dd0c9f81274c0b3cb1b764568 + bdcdb30..cad2666 bob/feature -> patches/6d260fc8388e74d8fefb5dabc5a798e125ec3cf9 ``` Alice pulls the update. ``` ~alice -$ rad patch show 26e3e56 +$ rad patch show 6d260fc ╭──────────────────────────────────────────────────────────────────────────────╮ │ Title Bob's patch │ -│ Patch 26e3e563ddc7df8dd0c9f81274c0b3cb1b764568 │ +│ Patch 6d260fc8388e74d8fefb5dabc5a798e125ec3cf9 │ │ Author bob z6Mkt67…v4N1tRk │ │ Head cad2666a8a2250e4dee175ed5044be2c251ff08b │ │ Commits ahead 2, behind 0 │ @@ -100,16 +100,16 @@ $ rad patch show 26e3e56 │ bdcdb30 Bob's commit #1 │ ├──────────────────────────────────────────────────────────────────────────────┤ │ ● opened by bob z6Mkt67…v4N1tRk [ ... ] │ -│ ↑ updated to c04ef81bad734c65a7d5834cefcdd60c4f0484f7 (cad2666) [ ... ] │ +│ ↑ updated to 750081b35a3f831f428653bd2240eb4674ccae71 (cad2666) [ ... ] │ ╰──────────────────────────────────────────────────────────────────────────────╯ $ git ls-remote rad f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 refs/heads/master -cad2666a8a2250e4dee175ed5044be2c251ff08b refs/heads/patches/26e3e563ddc7df8dd0c9f81274c0b3cb1b764568 +cad2666a8a2250e4dee175ed5044be2c251ff08b refs/heads/patches/6d260fc8388e74d8fefb5dabc5a798e125ec3cf9 ``` ``` ~alice $ git fetch rad $ git status --short --branch -## patch/26e3e56...rad/patches/26e3e563ddc7df8dd0c9f81274c0b3cb1b764568 [behind 1] +## patch/6d260fc...rad/patches/6d260fc8388e74d8fefb5dabc5a798e125ec3cf9 [behind 1] ``` ``` ~alice $ git pull diff --git a/radicle-cli/examples/rad-patch-update.md b/radicle-cli/examples/rad-patch-update.md index 8ae69d78..365a74c5 100644 --- a/radicle-cli/examples/rad-patch-update.md +++ b/radicle-cli/examples/rad-patch-update.md @@ -6,16 +6,16 @@ $ git commit -q -m "Not a real change" --allow-empty ``` ``` (stderr) $ git push rad HEAD:refs/patches -✓ Patch ea6fa6c274c55d0f4fdf203a192cbf1330b51221 opened +✓ Patch 2541d346ba0b9377b3d38852dfded43f23833fc1 opened To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi * [new reference] HEAD -> refs/patches ``` ``` -$ rad patch show ea6fa6c274c55d0f4fdf203a192cbf1330b51221 +$ rad patch show 2541d346ba0b9377b3d38852dfded43f23833fc1 ╭────────────────────────────────────────────────────╮ │ Title Not a real change │ -│ Patch ea6fa6c274c55d0f4fdf203a192cbf1330b51221 │ +│ Patch 2541d346ba0b9377b3d38852dfded43f23833fc1 │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 51b2f0f77b9849bfaa3e9d3ff68ee2f57771d20c │ │ Branches feature/1 │ @@ -46,17 +46,17 @@ Now, instead of using `git push` to update the patch, as we normally would, we run: ``` -$ rad patch update ea6fa6c274c55d0f4fdf203a192cbf1330b51221 -m "Updated patch" -59bbb5c5d3c9f18a686113e6354b1372eebafda4 +$ rad patch update 2541d346ba0b9377b3d38852dfded43f23833fc1 -m "Updated patch" +d9c9ef902f2957d746bb53e744e69a5c3aa564bc ``` The command outputs the new Revision ID, which we can now see here: ``` -$ rad patch show ea6fa6c274c55d0f4fdf203a192cbf1330b51221 +$ rad patch show 2541d346ba0b9377b3d38852dfded43f23833fc1 ╭──────────────────────────────────────────────────────────────────────────────╮ │ Title Not a real change │ -│ Patch ea6fa6c274c55d0f4fdf203a192cbf1330b51221 │ +│ Patch 2541d346ba0b9377b3d38852dfded43f23833fc1 │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 4d272148458a17620541555b1f0905c01658aa9f │ │ Branches feature/1 │ @@ -67,6 +67,6 @@ $ rad patch show ea6fa6c274c55d0f4fdf203a192cbf1330b51221 │ 51b2f0f Not a real change │ ├──────────────────────────────────────────────────────────────────────────────┤ │ ● opened by z6MknSL…StBU8Vi (you) [ ... ] │ -│ ↑ updated to 59bbb5c5d3c9f18a686113e6354b1372eebafda4 (4d27214) [ ... ] │ +│ ↑ updated to d9c9ef902f2957d746bb53e744e69a5c3aa564bc (4d27214) [ ... ] │ ╰──────────────────────────────────────────────────────────────────────────────╯ ``` diff --git a/radicle-cli/examples/rad-patch-via-push.md b/radicle-cli/examples/rad-patch-via-push.md index 47576e62..611c1133 100644 --- a/radicle-cli/examples/rad-patch-via-push.md +++ b/radicle-cli/examples/rad-patch-via-push.md @@ -8,7 +8,7 @@ $ git checkout -b feature/1 Switched to a new branch 'feature/1' $ git commit -a -m "Add things" -q --allow-empty $ git push -o patch.message="Add things #1" -o patch.message="See commits for details." rad HEAD:refs/patches -✓ Patch 90c77f2c33b7e472e058de4a586156f8a7fec7d6 opened +✓ Patch e49e64637ab4a29e5a16c73000dacd2afa918d9d opened To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi * [new reference] HEAD -> refs/patches ``` @@ -16,10 +16,10 @@ To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkE We can see a patch was created: ``` -$ rad patch show 90c77f2 +$ rad patch show e49e64637ab4a29e5a16c73000dacd2afa918d9d ╭────────────────────────────────────────────────────╮ │ Title Add things #1 │ -│ Patch 90c77f2c33b7e472e058de4a586156f8a7fec7d6 │ +│ Patch e49e64637ab4a29e5a16c73000dacd2afa918d9d │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 42d894a83c9c356552a57af09ccdbd5587a99045 │ │ Branches feature/1 │ @@ -39,7 +39,7 @@ branch associated with this patch: ``` $ git branch -vv -* feature/1 42d894a [rad/patches/90c77f2c33b7e472e058de4a586156f8a7fec7d6] Add things +* feature/1 42d894a [rad/patches/e49e64637ab4a29e5a16c73000dacd2afa918d9d] Add things master f2de534 [rad/master] Second commit ``` @@ -47,7 +47,7 @@ Let's check that it's up to date with our local head: ``` $ git status --short --branch -## feature/1...rad/patches/90c77f2c33b7e472e058de4a586156f8a7fec7d6 +## feature/1...rad/patches/e49e64637ab4a29e5a16c73000dacd2afa918d9d $ git fetch $ git push ``` @@ -59,13 +59,14 @@ $ git show-ref 42d894a83c9c356552a57af09ccdbd5587a99045 refs/heads/feature/1 f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 refs/heads/master f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 refs/remotes/rad/master -42d894a83c9c356552a57af09ccdbd5587a99045 refs/remotes/rad/patches/90c77f2c33b7e472e058de4a586156f8a7fec7d6 +42d894a83c9c356552a57af09ccdbd5587a99045 refs/remotes/rad/patches/e49e64637ab4a29e5a16c73000dacd2afa918d9d ``` ``` $ git ls-remote rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji 'refs/heads/patches/*' -42d894a83c9c356552a57af09ccdbd5587a99045 refs/heads/patches/90c77f2c33b7e472e058de4a586156f8a7fec7d6 +42d894a83c9c356552a57af09ccdbd5587a99045 refs/heads/patches/e49e64637ab4a29e5a16c73000dacd2afa918d9d $ git ls-remote rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi 'refs/cobs/*' -90c77f2c33b7e472e058de4a586156f8a7fec7d6 refs/cobs/xyz.radicle.patch/90c77f2c33b7e472e058de4a586156f8a7fec7d6 +2317f74de0494c489a233ca6f29f2b8bff6d4f15 refs/cobs/xyz.radicle.id/2317f74de0494c489a233ca6f29f2b8bff6d4f15 +e49e64637ab4a29e5a16c73000dacd2afa918d9d refs/cobs/xyz.radicle.patch/e49e64637ab4a29e5a16c73000dacd2afa918d9d ``` We can create another patch: @@ -74,7 +75,7 @@ We can create another patch: $ git checkout -b feature/2 -q master $ git commit -a -m "Add more things" -q --allow-empty $ git push rad HEAD:refs/patches -✓ Patch fedf0e4dcb74ff6db1d5e30a6a254b77f02ff60b opened +✓ Patch b1fd7b6883dca2ef11e0e486a7097e759ea90cdb opened To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi * [new reference] HEAD -> refs/patches ``` @@ -83,8 +84,8 @@ We see both branches with upstreams now: ``` $ git branch -vv - feature/1 42d894a [rad/patches/90c77f2c33b7e472e058de4a586156f8a7fec7d6] Add things -* feature/2 8b0ea80 [rad/patches/fedf0e4dcb74ff6db1d5e30a6a254b77f02ff60b] Add more things + feature/1 42d894a [rad/patches/e49e64637ab4a29e5a16c73000dacd2afa918d9d] Add things +* feature/2 8b0ea80 [rad/patches/b1fd7b6883dca2ef11e0e486a7097e759ea90cdb] Add more things master f2de534 [rad/master] Second commit ``` @@ -95,8 +96,8 @@ $ rad patch ╭────────────────────────────────────────────────────────────────────────────────────╮ │ ● ID Title Author Head + - Updated │ ├────────────────────────────────────────────────────────────────────────────────────┤ -│ ● 90c77f2 Add things #1 z6MknSL…StBU8Vi (you) 42d894a +0 -0 [ ... ] │ -│ ● fedf0e4 Add more things z6MknSL…StBU8Vi (you) 8b0ea80 +0 -0 [ ... ] │ +│ ● b1fd7b6 Add more things z6MknSL…StBU8Vi (you) 8b0ea80 +0 -0 [ ... ] │ +│ ● e49e646 Add things #1 z6MknSL…StBU8Vi (you) 42d894a +0 -0 [ ... ] │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ``` @@ -108,9 +109,9 @@ $ git commit -a -m "Improve code" -q --allow-empty ``` (stderr) $ git push -✓ Patch fedf0e4 updated to d0018fcc21d87c91a1ff9155aed6b4e57535566b +✓ Patch b1fd7b6 updated to c867846b9f294c271e8934820dfac2c5924ecd5a To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - 8b0ea80..02bef3f feature/2 -> patches/fedf0e4dcb74ff6db1d5e30a6a254b77f02ff60b + 8b0ea80..02bef3f feature/2 -> patches/b1fd7b6883dca2ef11e0e486a7097e759ea90cdb ``` This last `git push` worked without specifying an upstream branch despite the @@ -128,10 +129,10 @@ This allows for pushing to the remote patch branch without using the full We can then see that the patch head has moved: ``` -$ rad patch show fedf0e4 +$ rad patch show b1fd7b6 ╭──────────────────────────────────────────────────────────────────────────────╮ │ Title Add more things │ -│ Patch fedf0e4dcb74ff6db1d5e30a6a254b77f02ff60b │ +│ Patch b1fd7b6883dca2ef11e0e486a7097e759ea90cdb │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 02bef3fac41b2f98bb3c02b868a53ddfecb55b5f │ │ Branches feature/2 │ @@ -142,7 +143,7 @@ $ rad patch show fedf0e4 │ 8b0ea80 Add more things │ ├──────────────────────────────────────────────────────────────────────────────┤ │ ● opened by z6MknSL…StBU8Vi (you) [ ... ] │ -│ ↑ updated to d0018fcc21d87c91a1ff9155aed6b4e57535566b (02bef3f) [ ... ] │ +│ ↑ updated to c867846b9f294c271e8934820dfac2c5924ecd5a (02bef3f) [ ... ] │ ╰──────────────────────────────────────────────────────────────────────────────╯ ``` @@ -155,14 +156,14 @@ $ git rev-parse HEAD ``` $ git status --short --branch -## feature/2...rad/patches/fedf0e4dcb74ff6db1d5e30a6a254b77f02ff60b +## feature/2...rad/patches/b1fd7b6883dca2ef11e0e486a7097e759ea90cdb ``` ``` -$ git rev-parse refs/remotes/rad/patches/fedf0e4dcb74ff6db1d5e30a6a254b77f02ff60b +$ git rev-parse refs/remotes/rad/patches/b1fd7b6883dca2ef11e0e486a7097e759ea90cdb 02bef3fac41b2f98bb3c02b868a53ddfecb55b5f -$ git ls-remote rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi refs/heads/patches/fedf0e4dcb74ff6db1d5e30a6a254b77f02ff60b -02bef3fac41b2f98bb3c02b868a53ddfecb55b5f refs/heads/patches/fedf0e4dcb74ff6db1d5e30a6a254b77f02ff60b +$ git ls-remote rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi refs/heads/patches/b1fd7b6883dca2ef11e0e486a7097e759ea90cdb +02bef3fac41b2f98bb3c02b868a53ddfecb55b5f refs/heads/patches/b1fd7b6883dca2ef11e0e486a7097e759ea90cdb ``` ## Force push @@ -183,7 +184,7 @@ Now let's push to the patch head. ``` (stderr) (fail) $ git push To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - ! [rejected] feature/2 -> patches/fedf0e4dcb74ff6db1d5e30a6a254b77f02ff60b (non-fast-forward) + ! [rejected] feature/2 -> patches/b1fd7b6883dca2ef11e0e486a7097e759ea90cdb (non-fast-forward) error: failed to push some refs to 'rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi' hint: [..] hint: [..] @@ -196,18 +197,18 @@ use `--force` to force the update. ``` (stderr) $ git push --force -✓ Patch fedf0e4 updated to 31ecf28817c44d90686b5c3c624c1f4a534b6478 +✓ Patch b1fd7b6 updated to cf4d8577a1ec8aaa21a7ccca67ad8627c3304024 To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - + 02bef3f...9304dbc feature/2 -> patches/fedf0e4dcb74ff6db1d5e30a6a254b77f02ff60b (forced update) + + 02bef3f...9304dbc feature/2 -> patches/b1fd7b6883dca2ef11e0e486a7097e759ea90cdb (forced update) ``` That worked. We can see the new revision if we call `rad patch show`: ``` -$ rad patch show fedf0e4 +$ rad patch show b1fd7b6 ╭──────────────────────────────────────────────────────────────────────────────╮ │ Title Add more things │ -│ Patch fedf0e4dcb74ff6db1d5e30a6a254b77f02ff60b │ +│ Patch b1fd7b6883dca2ef11e0e486a7097e759ea90cdb │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 9304dbc445925187994a7a93222a3f8bde73b785 │ │ Branches feature/2 │ @@ -218,8 +219,8 @@ $ rad patch show fedf0e4 │ 8b0ea80 Add more things │ ├──────────────────────────────────────────────────────────────────────────────┤ │ ● opened by z6MknSL…StBU8Vi (you) [ ... ] │ -│ ↑ updated to d0018fcc21d87c91a1ff9155aed6b4e57535566b (02bef3f) [ ... ] │ -│ ↑ updated to 31ecf28817c44d90686b5c3c624c1f4a534b6478 (9304dbc) [ ... ] │ +│ ↑ updated to c867846b9f294c271e8934820dfac2c5924ecd5a (02bef3f) [ ... ] │ +│ ↑ updated to cf4d8577a1ec8aaa21a7ccca67ad8627c3304024 (9304dbc) [ ... ] │ ╰──────────────────────────────────────────────────────────────────────────────╯ ``` diff --git a/radicle-cli/examples/rad-patch.md b/radicle-cli/examples/rad-patch.md index 9fad65b6..26f42566 100644 --- a/radicle-cli/examples/rad-patch.md +++ b/radicle-cli/examples/rad-patch.md @@ -26,7 +26,7 @@ Once the code is ready, we open (or create) a patch with our changes for the pro ``` (stderr) $ git push rad -o patch.message="Define power requirements" -o patch.message="See details." HEAD:refs/patches -✓ Patch 73b73f376e93e09e0419664766ac9e433bf7d389 opened +✓ Patch a8926643a8f6a65bc386b0131621994000485d4d opened To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi * [new reference] HEAD -> refs/patches ``` @@ -38,14 +38,14 @@ $ rad patch ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │ ● ID Title Author Head + - Updated │ ├──────────────────────────────────────────────────────────────────────────────────────────────┤ -│ ● 73b73f3 Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 [ ... ] │ +│ ● a892664 Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 [ ... ] │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ``` ``` -$ rad patch show 73b73f376e93e09e0419664766ac9e433bf7d389 -p +$ rad patch show a8926643a8f6a65bc386b0131621994000485d4d -p ╭────────────────────────────────────────────────────╮ │ Title Define power requirements │ -│ Patch 73b73f376e93e09e0419664766ac9e433bf7d389 │ +│ Patch a8926643a8f6a65bc386b0131621994000485d4d │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 3e674d1a1df90807e934f9ae5da2591dd6848a33 │ │ Branches flux-capacitor-power │ @@ -74,7 +74,7 @@ index 0000000..e69de29 We can also see that it set an upstream for our patch branch: ``` $ git branch -vv -* flux-capacitor-power 3e674d1 [rad/patches/73b73f376e93e09e0419664766ac9e433bf7d389] Define power requirements +* flux-capacitor-power 3e674d1 [rad/patches/a8926643a8f6a65bc386b0131621994000485d4d] Define power requirements master f2de534 [rad/master] Second commit ``` @@ -90,48 +90,48 @@ $ git commit --message "Add README, just for the fun" ``` ``` (stderr) $ git push rad -o patch.message="Add README, just for the fun" -✓ Patch 73b73f3 updated to 5605784ae81dad91ba47ea55e19dd16f6280d44b +✓ Patch a892664 updated to 8d8aa0887a11f2a37fa8ed0d5723efa96fd727ed To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - 3e674d1..27857ec flux-capacitor-power -> patches/73b73f376e93e09e0419664766ac9e433bf7d389 + 3e674d1..27857ec flux-capacitor-power -> patches/a8926643a8f6a65bc386b0131621994000485d4d ``` And let's leave a quick comment for our team: ``` -$ rad patch comment 73b73f376e93e09e0419664766ac9e433bf7d389 --message 'I cannot wait to get back to the 90s!' +$ rad patch comment a8926643a8f6a65bc386b0131621994000485d4d --message 'I cannot wait to get back to the 90s!' ╭────────────────────────────────────────────╮ -│ z6MknSL…StBU8Vi (you) [ ... ] 5c418a5 │ +│ z6MknSL…StBU8Vi (you) [ ... ] b97a27f │ │ I cannot wait to get back to the 90s! │ ╰────────────────────────────────────────────╯ -$ rad patch comment 73b73f376e93e09e0419664766ac9e433bf7d389 --message 'My favorite decade!' --reply-to 5c418a5 -q -729cdf63ce4793ab3cabffbe0dce24db16e45549 +$ rad patch comment a8926643a8f6a65bc386b0131621994000485d4d --message 'My favorite decade!' --reply-to b97a27f -q +a3a462bc8ab52e2a6f3568c28a11ba53cf40bbc8 ``` Now, let's checkout the patch that we just created: ``` -$ rad patch checkout 73b73f3 -✓ Switched to branch patch/73b73f3 -✓ Branch patch/73b73f3 setup to track rad/patches/73b73f376e93e09e0419664766ac9e433bf7d389 +$ rad patch checkout a892664 +✓ Switched to branch patch/a892664 +✓ Branch patch/a892664 setup to track rad/patches/a8926643a8f6a65bc386b0131621994000485d4d ``` We can also add a review verdict as such: ``` -$ rad review 73b73f376e93e09e0419664766ac9e433bf7d389 --accept --no-message --no-sync -✓ Patch 73b73f3 accepted +$ rad review a8926643a8f6a65bc386b0131621994000485d4d --accept --no-message --no-sync +✓ Patch a892664 accepted ``` Showing the patch list now will reveal the favorable verdict: ``` -$ rad patch show 73b73f3 +$ rad patch show a892664 ╭──────────────────────────────────────────────────────────────────────────────╮ │ Title Define power requirements │ -│ Patch 73b73f376e93e09e0419664766ac9e433bf7d389 │ +│ Patch a8926643a8f6a65bc386b0131621994000485d4d │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 27857ec9eb04c69cacab516e8bf4b5fd36090f66 │ -│ Branches flux-capacitor-power, patch/73b73f3 │ +│ Branches flux-capacitor-power, patch/a892664 │ │ Commits ahead 2, behind 0 │ │ Status open │ │ │ @@ -141,7 +141,7 @@ $ rad patch show 73b73f3 │ 3e674d1 Define power requirements │ ├──────────────────────────────────────────────────────────────────────────────┤ │ ● opened by z6MknSL…StBU8Vi (you) [ ... ] │ -│ ↑ updated to 5605784ae81dad91ba47ea55e19dd16f6280d44b (27857ec) [ ... ] │ +│ ↑ updated to 8d8aa0887a11f2a37fa8ed0d5723efa96fd727ed (27857ec) [ ... ] │ │ ✓ accepted by z6MknSL…StBU8Vi (you) [ ... ] │ ╰──────────────────────────────────────────────────────────────────────────────╯ ``` @@ -149,14 +149,14 @@ $ rad patch show 73b73f3 If you make a mistake on the patch description, you can always change it! ``` -$ rad patch edit 73b73f3 --message "Define power requirements" --message "Add requirements file" -$ rad patch show 73b73f3 +$ rad patch edit a892664 --message "Define power requirements" --message "Add requirements file" +$ rad patch show a892664 ╭──────────────────────────────────────────────────────────────────────────────╮ │ Title Define power requirements │ -│ Patch 73b73f376e93e09e0419664766ac9e433bf7d389 │ +│ Patch a8926643a8f6a65bc386b0131621994000485d4d │ │ Author z6MknSL…StBU8Vi (you) │ │ Head 27857ec9eb04c69cacab516e8bf4b5fd36090f66 │ -│ Branches flux-capacitor-power, patch/73b73f3 │ +│ Branches flux-capacitor-power, patch/a892664 │ │ Commits ahead 2, behind 0 │ │ Status open │ │ │ @@ -166,7 +166,7 @@ $ rad patch show 73b73f3 │ 3e674d1 Define power requirements │ ├──────────────────────────────────────────────────────────────────────────────┤ │ ● opened by z6MknSL…StBU8Vi (you) [ ... ] │ -│ ↑ updated to 5605784ae81dad91ba47ea55e19dd16f6280d44b (27857ec) [ ... ] │ +│ ↑ updated to 8d8aa0887a11f2a37fa8ed0d5723efa96fd727ed (27857ec) [ ... ] │ │ ✓ accepted by z6MknSL…StBU8Vi (you) [ ... ] │ ╰──────────────────────────────────────────────────────────────────────────────╯ ``` diff --git a/radicle-cli/examples/rad-review-by-hunk.md b/radicle-cli/examples/rad-review-by-hunk.md index 023b19b7..0eb3ff98 100644 --- a/radicle-cli/examples/rad-review-by-hunk.md +++ b/radicle-cli/examples/rad-review-by-hunk.md @@ -61,7 +61,7 @@ $ git commit -q -m "Update files" ``` (stderr) $ git push rad HEAD:refs/patches -✓ Patch 7f6ed9bd562a36eb1d5689f95600d09247726a23 opened +✓ Patch 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 opened To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi * [new reference] HEAD -> refs/patches ``` @@ -70,7 +70,7 @@ Finally, we do a review of the patch by hunk. The output of this command should match `git diff master -W100% -U5 --patience`: ``` -$ rad review --no-sync --patch -U5 7f6ed9bd562a36eb1d5689f95600d09247726a23 +$ rad review --no-sync --patch -U5 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 7937fb3..0000000 @@ -116,8 +116,8 @@ rename to notes/INSTRUCTIONS.txt Now let's accept these hunks one by one.. ``` -$ rad review --no-sync --patch --accept --hunk 1 7f6ed9bd562a36eb1d5689f95600d09247726a23 -✓ Loaded existing review ([..]) for patch 7f6ed9bd562a36eb1d5689f95600d09247726a23 +$ rad review --no-sync --patch --accept --hunk 1 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 +✓ Loaded existing review ([..]) for patch 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 7937fb3..0000000 @@ -127,8 +127,8 @@ index 7937fb3..0000000 -*.draft ``` ``` -$ rad review --no-sync --patch --accept --hunk 1 7f6ed9bd562a36eb1d5689f95600d09247726a23 -✓ Loaded existing review ([..]) for patch 7f6ed9bd562a36eb1d5689f95600d09247726a23 +$ rad review --no-sync --patch --accept --hunk 1 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 +✓ Loaded existing review ([..]) for patch 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 diff --git a/DISCLAIMER.txt b/DISCLAIMER.txt new file mode 100644 index 0000000..2b5bd86 @@ -138,8 +138,8 @@ index 0000000..2b5bd86 +All food is served as-is, with no warranty! ``` ``` -$ rad review --no-sync --patch --accept -U3 --hunk 1 7f6ed9bd562a36eb1d5689f95600d09247726a23 -✓ Loaded existing review ([..]) for patch 7f6ed9bd562a36eb1d5689f95600d09247726a23 +$ rad review --no-sync --patch --accept -U3 --hunk 1 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 +✓ Loaded existing review ([..]) for patch 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 diff --git a/MENU.txt b/MENU.txt index 867958c..3af9741 100644 --- a/MENU.txt @@ -153,8 +153,8 @@ index 867958c..3af9741 100644 [..] ``` ``` -$ rad review --no-sync --patch --accept -U3 --hunk 1 7f6ed9bd562a36eb1d5689f95600d09247726a23 -✓ Loaded existing review ([..]) for patch 7f6ed9bd562a36eb1d5689f95600d09247726a23 +$ rad review --no-sync --patch --accept -U3 --hunk 1 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 +✓ Loaded existing review ([..]) for patch 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 diff --git a/MENU.txt b/MENU.txt index 4e2e828..3af9741 100644 --- a/MENU.txt @@ -169,8 +169,8 @@ index 4e2e828..3af9741 100644 ``` ``` -$ rad review --no-sync --patch --accept --hunk 1 7f6ed9bd562a36eb1d5689f95600d09247726a23 -✓ Loaded existing review ([..]) for patch 7f6ed9bd562a36eb1d5689f95600d09247726a23 +$ rad review --no-sync --patch --accept --hunk 1 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 +✓ Loaded existing review ([..]) for patch 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 diff --git a/INSTRUCTIONS.txt b/notes/INSTRUCTIONS.txt similarity index 100% rename from INSTRUCTIONS.txt @@ -178,7 +178,7 @@ rename to notes/INSTRUCTIONS.txt ``` ``` -$ rad review --no-sync --patch --accept --hunk 1 7f6ed9bd562a36eb1d5689f95600d09247726a23 -✓ Loaded existing review ([..]) for patch 7f6ed9bd562a36eb1d5689f95600d09247726a23 +$ rad review --no-sync --patch --accept --hunk 1 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 +✓ Loaded existing review ([..]) for patch 4f4fdb0fbb3327975b92fd1fa88e7427b1b141e2 ✓ All hunks have been reviewed ``` diff --git a/radicle-cli/examples/workflow/3-issues.md b/radicle-cli/examples/workflow/3-issues.md index 7c88341a..9f9154c3 100644 --- a/radicle-cli/examples/workflow/3-issues.md +++ b/radicle-cli/examples/workflow/3-issues.md @@ -7,7 +7,7 @@ Let's say the new car you are designing with your peers has a problem with its f $ rad issue open --title "flux capacitor underpowered" --description "Flux capacitor power requirements exceed current supply" --no-announce ╭─────────────────────────────────────────────────────────╮ │ Title flux capacitor underpowered │ -│ Issue 2f6eb49efac492327f71437b6bfc01b49afa0981 │ +│ Issue d457c205de780d37d1c16efbe5333aed4662a6c3 │ │ Author bob (you) │ │ Status open │ │ │ @@ -22,7 +22,7 @@ $ rad issue list ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │ ● ID Title Author Labels Assignees Opened │ ├────────────────────────────────────────────────────────────────────────────────────────────────┤ -│ ● 2f6eb49 flux capacitor underpowered bob (you) [ .. ] │ +│ ● d457c20 flux capacitor underpowered bob (you) [ .. ] │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` @@ -31,6 +31,6 @@ found an important detail about the car's power requirements. It will help whoever works on a fix. ``` -$ rad issue comment 2f6eb49efac492327f71437b6bfc01b49afa0981 --message 'The flux capacitor needs 1.21 Gigawatts' -q -d2b50873009b93680698aef4f57f43f7e850b651 +$ rad issue comment d457c205de780d37d1c16efbe5333aed4662a6c3 --message 'The flux capacitor needs 1.21 Gigawatts' -q +2e8b9538aedaea418e90e90d19e61edf3f022933 ``` diff --git a/radicle-cli/examples/workflow/4-patching-contributor.md b/radicle-cli/examples/workflow/4-patching-contributor.md index 6d87b082..78e9be93 100644 --- a/radicle-cli/examples/workflow/4-patching-contributor.md +++ b/radicle-cli/examples/workflow/4-patching-contributor.md @@ -26,7 +26,7 @@ Once the code is ready, we open a patch with our changes. ``` (stderr) $ git push rad -o no-sync -o patch.message="Define power requirements" -o patch.message="See details." HEAD:refs/patches -✓ Patch 69e881c606639691330051d7d8f013854f32fb87 opened +✓ Patch 4bfb6fe940f815e3fcce6a2796e051df85db9fe1 opened To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk * [new reference] HEAD -> refs/patches ``` @@ -38,12 +38,12 @@ $ rad patch ╭─────────────────────────────────────────────────────────────────────────────────────╮ │ ● ID Title Author Head + - Updated │ ├─────────────────────────────────────────────────────────────────────────────────────┤ -│ ● 69e881c Define power requirements bob (you) 3e674d1 +0 -0 [ ... ] │ +│ ● 4bfb6fe Define power requirements bob (you) 3e674d1 +0 -0 [ ... ] │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ -$ rad patch show 69e881c606639691330051d7d8f013854f32fb87 +$ rad patch show 4bfb6fe940f815e3fcce6a2796e051df85db9fe1 ╭────────────────────────────────────────────────────╮ │ Title Define power requirements │ -│ Patch 69e881c606639691330051d7d8f013854f32fb87 │ +│ Patch 4bfb6fe940f815e3fcce6a2796e051df85db9fe1 │ │ Author bob (you) │ │ Head 3e674d1a1df90807e934f9ae5da2591dd6848a33 │ │ Branches flux-capacitor-power │ @@ -62,7 +62,7 @@ We can also confirm that the patch branch is in storage: ``` $ git ls-remote rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk refs/heads/patches/* -3e674d1a1df90807e934f9ae5da2591dd6848a33 refs/heads/patches/69e881c606639691330051d7d8f013854f32fb87 +3e674d1a1df90807e934f9ae5da2591dd6848a33 refs/heads/patches/4bfb6fe940f815e3fcce6a2796e051df85db9fe1 ``` Wait, let's add a README too! Just for fun. @@ -77,14 +77,14 @@ $ git commit --message "Add README, just for the fun" ``` ``` (stderr) RAD_SOCKET=/dev/null $ git push -o patch.message="Add README, just for the fun" -✓ Patch 69e881c updated to dcf3e6dd97c95cf8653cbb8ce47df20d28eb1821 +✓ Patch 4bfb6fe updated to 7782e60eb51b6e852abb184b092249327354c625 To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk - 3e674d1..27857ec flux-capacitor-power -> patches/69e881c606639691330051d7d8f013854f32fb87 + 3e674d1..27857ec flux-capacitor-power -> patches/4bfb6fe940f815e3fcce6a2796e051df85db9fe1 ``` And let's leave a quick comment for our team: ``` -$ rad patch comment 69e881c606639691330051d7d8f013854f32fb87 --message 'I cannot wait to get back to the 90s!' -q -c758bd868bb7d6c8509ee9168b3876082a8e377c +$ rad patch comment 4bfb6fe940f815e3fcce6a2796e051df85db9fe1 --message 'I cannot wait to get back to the 90s!' -q +a3ba1df99fbd874affc790c95cd18607940f1a90 ``` diff --git a/radicle-cli/examples/workflow/5-patching-maintainer.md b/radicle-cli/examples/workflow/5-patching-maintainer.md index e9707353..18bcffb0 100644 --- a/radicle-cli/examples/workflow/5-patching-maintainer.md +++ b/radicle-cli/examples/workflow/5-patching-maintainer.md @@ -22,7 +22,7 @@ $ git fetch bob ✓ Synced with 1 peer(s) From rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk * [new branch] master -> bob/master - * [new branch] patches/69e881c606639691330051d7d8f013854f32fb87 -> bob/patches/69e881c606639691330051d7d8f013854f32fb87 + * [new branch] patches/4bfb6fe940f815e3fcce6a2796e051df85db9fe1 -> bob/patches/4bfb6fe940f815e3fcce6a2796e051df85db9fe1 ``` The contributor's changes are now visible to us. @@ -30,12 +30,12 @@ The contributor's changes are now visible to us. ``` $ git branch -r bob/master - bob/patches/69e881c606639691330051d7d8f013854f32fb87 + bob/patches/4bfb6fe940f815e3fcce6a2796e051df85db9fe1 rad/master -$ rad patch show 69e881c +$ rad patch show 4bfb6fe ╭──────────────────────────────────────────────────────────────────────────────╮ │ Title Define power requirements │ -│ Patch 69e881c606639691330051d7d8f013854f32fb87 │ +│ Patch 4bfb6fe940f815e3fcce6a2796e051df85db9fe1 │ │ Author bob z6Mkt67…v4N1tRk │ │ Head 27857ec9eb04c69cacab516e8bf4b5fd36090f66 │ │ Commits ahead 2, behind 0 │ @@ -47,7 +47,7 @@ $ rad patch show 69e881c │ 3e674d1 Define power requirements │ ├──────────────────────────────────────────────────────────────────────────────┤ │ ● opened by bob z6Mkt67…v4N1tRk [ ... ] │ -│ ↑ updated to dcf3e6dd97c95cf8653cbb8ce47df20d28eb1821 (27857ec) [ ... ] │ +│ ↑ updated to 7782e60eb51b6e852abb184b092249327354c625 (27857ec) [ ... ] │ ╰──────────────────────────────────────────────────────────────────────────────╯ ``` @@ -57,20 +57,20 @@ way will tell others about the corrections we needed before merging the changes. ``` -$ rad patch checkout 69e881c606639691330051d7d8f013854f32fb87 -✓ Switched to branch patch/69e881c -✓ Branch patch/69e881c setup to track rad/patches/69e881c606639691330051d7d8f013854f32fb87 +$ rad patch checkout 4bfb6fe940f815e3fcce6a2796e051df85db9fe1 +✓ Switched to branch patch/4bfb6fe +✓ Branch patch/4bfb6fe setup to track rad/patches/4bfb6fe940f815e3fcce6a2796e051df85db9fe1 $ git mv REQUIREMENTS REQUIREMENTS.md $ git commit -m "Use markdown for requirements" -[patch/69e881c f567f69] Use markdown for requirements +[patch/4bfb6fe f567f69] Use markdown for requirements 1 file changed, 0 insertions(+), 0 deletions(-) rename REQUIREMENTS => REQUIREMENTS.md (100%) ``` ``` (stderr) $ git push rad -o no-sync -o patch.message="Use markdown for requirements" -✓ Patch 69e881c updated to 70dd9a31882d184a9fe8f1f590471f5543c4d85b +✓ Patch 4bfb6fe updated to fab4fddf6bcae7d55432417cdf5a7d0270d0d7d3 To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi - * [new branch] patch/69e881c -> patches/69e881c606639691330051d7d8f013854f32fb87 + * [new branch] patch/4bfb6fe -> patches/4bfb6fe940f815e3fcce6a2796e051df85db9fe1 ``` Great, all fixed up, lets merge the code. @@ -78,7 +78,7 @@ Great, all fixed up, lets merge the code. ``` $ git checkout master Your branch is up to date with 'rad/master'. -$ git merge patch/69e881c +$ git merge patch/4bfb6fe Updating f2de534..f567f69 Fast-forward README.md | 0 @@ -89,7 +89,7 @@ Fast-forward ``` ``` (stderr) $ git push rad master -✓ Patch 69e881c606639691330051d7d8f013854f32fb87 merged at revision 70dd9a3 +✓ Patch 4bfb6fe940f815e3fcce6a2796e051df85db9fe1 merged at revision fab4fdd ✓ Synced with 1 node(s) To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi f2de534..f567f69 master -> master @@ -98,10 +98,10 @@ To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkE The patch is now merged and closed :). ``` -$ rad patch show 69e881c +$ rad patch show 4bfb6fe ╭──────────────────────────────────────────────────────────────────────────────╮ │ Title Define power requirements │ -│ Patch 69e881c606639691330051d7d8f013854f32fb87 │ +│ Patch 4bfb6fe940f815e3fcce6a2796e051df85db9fe1 │ │ Author bob z6Mkt67…v4N1tRk │ │ Head 27857ec9eb04c69cacab516e8bf4b5fd36090f66 │ │ Commits ahead 0, behind 1 │ @@ -113,9 +113,9 @@ $ rad patch show 69e881c │ 3e674d1 Define power requirements │ ├──────────────────────────────────────────────────────────────────────────────┤ │ ● opened by bob z6Mkt67…v4N1tRk [ ... ] │ -│ ↑ updated to dcf3e6dd97c95cf8653cbb8ce47df20d28eb1821 (27857ec) [ ... ] │ -│ * revised by alice (you) in 70dd9a3 (f567f69) [ ... ] │ -│ ✓ merged by alice (you) at revision 70dd9a3 (f567f69) [ ... ] │ +│ ↑ updated to 7782e60eb51b6e852abb184b092249327354c625 (27857ec) [ ... ] │ +│ * revised by alice (you) in fab4fdd (f567f69) [ ... ] │ +│ ✓ merged by alice (you) at revision fab4fdd (f567f69) [ ... ] │ ╰──────────────────────────────────────────────────────────────────────────────╯ ``` diff --git a/radicle-cli/src/commands.rs b/radicle-cli/src/commands.rs index eabd19b4..21f1ae45 100644 --- a/radicle-cli/src/commands.rs +++ b/radicle-cli/src/commands.rs @@ -8,12 +8,8 @@ pub mod rad_checkout; pub mod rad_clone; #[path = "commands/cob.rs"] pub mod rad_cob; -#[path = "commands/delegate.rs"] -pub mod rad_delegate; #[path = "commands/diff.rs"] pub mod rad_diff; -#[path = "commands/edit.rs"] -pub mod rad_edit; #[path = "commands/fork.rs"] pub mod rad_fork; #[path = "commands/help.rs"] diff --git a/radicle-cli/src/commands/checkout.rs b/radicle-cli/src/commands/checkout.rs index 311512b9..4c7bcacb 100644 --- a/radicle-cli/src/commands/checkout.rs +++ b/radicle-cli/src/commands/checkout.rs @@ -82,10 +82,11 @@ fn execute(options: Options, profile: &Profile) -> anyhow::Result { let id = options.id; let storage = &profile.storage; let remote = options.remote.unwrap_or(profile.did()); - let doc = storage + let doc: Doc<_> = storage .repository(id)? - .identity_doc_of(&remote) - .context("project could not be found in local storage")?; + .identity_doc() + .context("project could not be found in local storage")? + .into(); let payload = doc.project()?; let path = PathBuf::from(payload.name()); diff --git a/radicle-cli/src/commands/clone.rs b/radicle-cli/src/commands/clone.rs index d1339589..a855e913 100644 --- a/radicle-cli/src/commands/clone.rs +++ b/radicle-cli/src/commands/clone.rs @@ -9,8 +9,8 @@ use thiserror::Error; use radicle::cob; use radicle::git::raw; +use radicle::identity::doc; use radicle::identity::doc::{DocError, Id}; -use radicle::identity::{doc, IdentityError}; use radicle::node; use radicle::node::tracking::Scope; use radicle::node::{Handle as _, Node}; @@ -18,6 +18,7 @@ use radicle::prelude::*; use radicle::rad; use radicle::storage; use radicle::storage::git::Storage; +use radicle::storage::RepositoryError; use crate::commands::rad_checkout as checkout; use crate::commands::rad_sync as sync; @@ -188,8 +189,8 @@ pub enum CloneError { Doc(#[from] DocError), #[error("payload: {0}")] Payload(#[from] doc::PayloadError), - #[error("project error: {0}")] - Identity(#[from] IdentityError), + #[error(transparent)] + Repository(#[from] RepositoryError), #[error("repository {0} not found")] NotFound(Id), #[error("no seeds found for {0}")] @@ -258,7 +259,7 @@ pub fn clone( } } - let doc = repository.identity_doc_of(&me)?; + let doc = repository.identity_doc()?; let proj = doc.project()?; let path = Path::new(proj.name()); @@ -279,5 +280,5 @@ pub fn clone( spinner.finish(); - Ok((working, repository, doc, proj)) + Ok((working, repository, doc.into(), proj)) } diff --git a/radicle-cli/src/commands/cob.rs b/radicle-cli/src/commands/cob.rs index b4927503..8bbbd6fa 100644 --- a/radicle-cli/src/commands/cob.rs +++ b/radicle-cli/src/commands/cob.rs @@ -137,7 +137,9 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> { .to_rfc2822(); term::print(term::format::yellow(format!("commit {}", op.id))); - term::print(term::format::tertiary(format!("parent {}", op.identity))); + if let Some(oid) = op.identity { + term::print(term::format::tertiary(format!("parent {oid}"))); + } for parent in op.parents { term::print(format!("parent {}", parent)); } diff --git a/radicle-cli/src/commands/delegate.rs b/radicle-cli/src/commands/delegate.rs deleted file mode 100644 index 60d1fe79..00000000 --- a/radicle-cli/src/commands/delegate.rs +++ /dev/null @@ -1,129 +0,0 @@ -use std::ffi::OsString; - -use anyhow::{anyhow, Context as _}; - -use radicle::identity::Id; -use radicle::prelude::Did; - -use crate::terminal as term; -use crate::terminal::args::{Args, Error, Help}; - -#[path = "delegate/add.rs"] -mod add; -#[path = "delegate/list.rs"] -mod list; -#[path = "delegate/remove.rs"] -mod remove; - -pub const HELP: Help = Help { - name: "delegate", - description: "Manage the delegates of an identity", - version: env!("CARGO_PKG_VERSION"), - usage: r#" -Usage - - rad delegate add [--to ] [