cob: Properly authorize root actions

Previously, authorization was only checked for ops after the root op.
We also avoid creating empty actions for `assign` and `label`, which
was needed for non-authorized users to be able to create issues/patches.
This commit is contained in:
cloudhead 2024-02-23 12:31:13 +01:00
parent c63aaaceac
commit 17744a03fd
No known key found for this signature in database
32 changed files with 327 additions and 322 deletions

View File

@ -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 d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61
│ Issue d87dcfe8c2b3200e78b128d9b959cfdf7063fefe
│ Author z6MknSL…StBU8Vi (you) │
│ Status open │
│ │
@ -21,7 +21,7 @@ $ rad issue list
╭───────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Labels Assignees Opened │
├───────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ● d185ee1 flux capacitor underpowered z6MknSL…StBU8Vi (you) now │
│ ● d87dcfe flux capacitor underpowered z6MknSL…StBU8Vi (you) now │
╰───────────────────────────────────────────────────────────────────────────────────────────────────╯
```
@ -45,7 +45,7 @@ $ rad patch
╭─────────────────────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Head + - Updated │
├─────────────────────────────────────────────────────────────────────────────────────────┤
│ ● 0f3cd0b Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 now │
│ ● aa45913 Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 now │
╰─────────────────────────────────────────────────────────────────────────────────────────╯
```
@ -53,16 +53,16 @@ Both issue and patch COBs can be listed.
```
$ rad cob list --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.issue
d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61
d87dcfe8c2b3200e78b128d9b959cfdf7063fefe
$ rad cob list --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.patch
0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
aa45913e757cacd46972733bddee5472c78fa32a
```
We can look at the issue COB.
```
$ rad cob show --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.issue --object d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61
commit d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61
$ rad cob show --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.issue --object d87dcfe8c2b3200e78b128d9b959cfdf7063fefe
commit d87dcfe8c2b3200e78b128d9b959cfdf7063fefe
resource 0656c217f917c3e06234771e9ecae53aba5e173e
author z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
date Thu, 15 Dec 2022 17:28:04 +0000
@ -72,28 +72,18 @@ date Thu, 15 Dec 2022 17:28:04 +0000
"type": "comment"
}
{
"assignees": [],
"type": "assign"
}
{
"title": "flux capacitor underpowered",
"type": "edit"
}
{
"labels": [],
"type": "label"
}
```
We can look at the patch COB too.
```
$ rad cob show --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.patch --object 0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
commit 0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
$ rad cob show --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.patch --object aa45913e757cacd46972733bddee5472c78fa32a
commit aa45913e757cacd46972733bddee5472c78fa32a
resource 0656c217f917c3e06234771e9ecae53aba5e173e
rel 3e674d1a1df90807e934f9ae5da2591dd6848a33
rel f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354
@ -113,21 +103,16 @@ date Thu, 15 Dec 2022 17:28:04 +0000
"type": "edit"
}
{
"labels": [],
"type": "label"
}
```
Finally let's updated the issue and see the `parent` header:
```
$ rad issue label d185ee1 --add bug --no-announce
$ rad cob show --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.issue --object d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61
commit 4dd9a3dfb60665e427a43dbf289e50b7fb90a655
$ rad issue label d87dcfe --add bug --no-announce
$ rad cob show --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --type xyz.radicle.issue --object d87dcfe8c2b3200e78b128d9b959cfdf7063fefe
commit abec0a9f3c945594c4e78d24d8ec679e56b22b79
resource 0656c217f917c3e06234771e9ecae53aba5e173e
parent d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61
parent d87dcfe8c2b3200e78b128d9b959cfdf7063fefe
author z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
date Thu, 15 Dec 2022 17:28:04 +0000
@ -138,7 +123,7 @@ date Thu, 15 Dec 2022 17:28:04 +0000
"type": "label"
}
commit d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61
commit d87dcfe8c2b3200e78b128d9b959cfdf7063fefe
resource 0656c217f917c3e06234771e9ecae53aba5e173e
author z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
date Thu, 15 Dec 2022 17:28:04 +0000
@ -148,19 +133,9 @@ date Thu, 15 Dec 2022 17:28:04 +0000
"type": "comment"
}
{
"assignees": [],
"type": "assign"
}
{
"title": "flux capacitor underpowered",
"type": "edit"
}
{
"labels": [],
"type": "label"
}
```

View File

@ -21,7 +21,7 @@ $ rad inbox --sort-by id
╭──────────────────────────────────────────────────────────────────────╮
│ heartwood │
├──────────────────────────────────────────────────────────────────────┤
│ 001 ● 58fff44 No license file issue open bob now │
│ 001 ● [ ... ] No license file issue open bob now │
│ 002 ● bob/copy Change copyright branch created bob now │
╰──────────────────────────────────────────────────────────────────────╯
```
@ -31,12 +31,12 @@ $ rad inbox --all --sort-by id
╭────────────────────────────────────────────────────────────────╮
│ radicle-git │
├────────────────────────────────────────────────────────────────┤
│ 003 ● 4dd5843 Copyright fixes patch open bob now │
│ 003 ● [ ... ] Copyright fixes patch open bob now │
╰────────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────────────────────────────────╮
│ heartwood │
├──────────────────────────────────────────────────────────────────────┤
│ 001 ● 58fff44 No license file issue open bob now │
│ 001 ● [ ... ] No license file issue open bob now │
│ 002 ● bob/copy Change copyright branch created bob now │
╰──────────────────────────────────────────────────────────────────────╯
```
@ -67,7 +67,7 @@ $ rad inbox list --sort-by id
╭──────────────────────────────────────────────────────────────────────╮
│ heartwood │
├──────────────────────────────────────────────────────────────────────┤
│ 001 ● 58fff44 No license file issue open bob now │
│ 001 ● [ ... ] No license file issue open bob now │
│ 002 bob/copy Change copyright branch created bob now │
╰──────────────────────────────────────────────────────────────────────╯
```
@ -93,7 +93,7 @@ $ rad inbox --all
╭────────────────────────────────────────────────────────────────╮
│ radicle-git │
├────────────────────────────────────────────────────────────────┤
│ 003 ● 4dd5843 Copyright fixes patch open bob now │
│ 003 ● [ ... ] Copyright fixes patch open bob now │
╰────────────────────────────────────────────────────────────────╯
```

View File

@ -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 d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61
│ Issue d87dcfe8c2b3200e78b128d9b959cfdf7063fefe
│ Author z6MknSL…StBU8Vi (you) │
│ Status open │
│ │
@ -22,17 +22,17 @@ $ rad issue list
╭───────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Labels Assignees Opened │
├───────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ● d185ee1 flux capacitor underpowered z6MknSL…StBU8Vi (you) now │
│ ● d87dcfe flux capacitor underpowered z6MknSL…StBU8Vi (you) now │
╰───────────────────────────────────────────────────────────────────────────────────────────────────╯
```
Show the issue information issue.
```
$ rad issue show d185ee1
$ rad issue show d87dcfe
╭─────────────────────────────────────────────────────────╮
│ Title flux capacitor underpowered │
│ Issue d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61
│ Issue d87dcfe8c2b3200e78b128d9b959cfdf7063fefe
│ Author z6MknSL…StBU8Vi (you) │
│ Status open │
│ │
@ -51,8 +51,8 @@ Let's assign ourselves to this one, this is to ensure work is not
duplicated. While we're at it, let's add a label.
```
$ rad issue assign d185ee1 --add did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi --no-announce
$ rad issue label d185ee1 --add good-first-issue --no-announce
$ rad issue assign d87dcfe --add did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi --no-announce
$ rad issue label d87dcfe --add good-first-issue --no-announce
```
It will now show in the list of issues assigned to us, along with the new label.
@ -62,14 +62,14 @@ $ rad issue list --assigned
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Labels Assignees Opened │
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ● d185ee1 flux capacitor underpowered z6MknSL…StBU8Vi (you) good-first-issue z6MknSL…StBU8Vi now │
│ ● d87dcfe flux capacitor underpowered z6MknSL…StBU8Vi (you) good-first-issue z6MknSL…StBU8Vi now │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```
Note: this can always be undone with the `unassign` subcommand.
```
$ rad issue assign d185ee1 --delete did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi --no-announce
$ rad issue assign d87dcfe --delete did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi --no-announce
```
Great, now we have communicated to the world about our car's defect.
@ -78,29 +78,29 @@ 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 d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61 --message 'The flux capacitor needs 1.21 Gigawatts' -q --no-announce
80ef590710edb64dfa57e8e940d6e4d0b0ae4217
$ rad issue comment d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61 --reply-to 80ef590710edb64dfa57e8e940d6e4d0b0ae4217 --message 'More power!' -q --no-announce
91009820ca0996d93b9afd5739a4d2158a2ec898
$ rad issue comment d87dcfe8c2b3200e78b128d9b959cfdf7063fefe --message 'The flux capacitor needs 1.21 Gigawatts' -q --no-announce
2193e871916d18ddd0416b5198cb08c5dc7416b7
$ rad issue comment d87dcfe8c2b3200e78b128d9b959cfdf7063fefe --reply-to 2193e871916d18ddd0416b5198cb08c5dc7416b7 --message 'More power!' -q --no-announce
880fdcd94b36e412fc906b510f41008700d65424
```
We can see our comments by showing the issue:
```
$ rad issue show d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61
$ rad issue show d87dcfe8c2b3200e78b128d9b959cfdf7063fefe
╭─────────────────────────────────────────────────────────╮
│ Title flux capacitor underpowered │
│ Issue d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61
│ Issue d87dcfe8c2b3200e78b128d9b959cfdf7063fefe
│ Author z6MknSL…StBU8Vi (you) │
│ Labels good-first-issue │
│ Status open │
│ │
│ Flux capacitor power requirements exceed current supply │
├─────────────────────────────────────────────────────────┤
│ z6MknSL…StBU8Vi (you) now 80ef590
│ z6MknSL…StBU8Vi (you) now 2193e87
│ The flux capacitor needs 1.21 Gigawatts │
├─────────────────────────────────────────────────────────┤
│ z6MknSL…StBU8Vi (you) now 9100982
│ z6MknSL…StBU8Vi (you) now 880fdcd
│ More power! │
╰─────────────────────────────────────────────────────────╯
```

View File

@ -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 b082560898736233790dedff7b1a725b18614480 opened
✓ Patch 696ec5508494692899337afe6713fe1796d0315c opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new reference] HEAD -> refs/patches
```
@ -27,8 +27,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 b082560 updated to revision [...]
✓ Patch b082560898736233790dedff7b1a725b18614480 merged
✓ Patch 696ec55 updated to revision [...]
✓ Patch 696ec5508494692899337afe6713fe1796d0315c merged
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
+ 20aa5dd...954bcdb feature/1 -> patches/b082560898736233790dedff7b1a725b18614480 (forced update)
+ 20aa5dd...954bcdb feature/1 -> patches/696ec5508494692899337afe6713fe1796d0315c (forced update)
```

View File

@ -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 b082560898736233790dedff7b1a725b18614480 opened
✓ Patch 696ec5508494692899337afe6713fe1796d0315c opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new reference] HEAD -> refs/patches
```
@ -36,7 +36,7 @@ committer radicle <radicle@localhost> 1671125284 +0000
Finally, we push master and expect the patch to be merged.
``` (stderr) RAD_SOCKET=/dev/null
$ git push rad master
✓ Patch b082560898736233790dedff7b1a725b18614480 merged
✓ Patch 696ec5508494692899337afe6713fe1796d0315c merged
✓ Canonical head updated to 737a10cfa29111afeb0d43cf3545cee386b939ec
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
f2de534..737a10c master -> master

View File

@ -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 b082560898736233790dedff7b1a725b18614480 opened
✓ Patch 696ec5508494692899337afe6713fe1796d0315c 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 80fe6a0c283d7209f8839c79bc90ff9ecd9fdedd opened
✓ Patch 356f73863a8920455ff6e77cd9c805d68910551b 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/80fe6a0c283d7209f8839c79bc90ff9ecd9fdedd
rad/patches/b082560898736233790dedff7b1a725b18614480
rad/patches/356f73863a8920455ff6e77cd9c805d68910551b
rad/patches/696ec5508494692899337afe6713fe1796d0315c
```
And some remote refs:
@ -36,13 +36,13 @@ z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
   │   ├── xyz.radicle.id
   │   │   └── 0656c217f917c3e06234771e9ecae53aba5e173e
   │   └── xyz.radicle.patch
   │      ├── 80fe6a0c283d7209f8839c79bc90ff9ecd9fdedd
   │      └── b082560898736233790dedff7b1a725b18614480
   │      ├── 356f73863a8920455ff6e77cd9c805d68910551b
   │      └── 696ec5508494692899337afe6713fe1796d0315c
   ├── heads
   │   ├── master
   │   └── patches
   │      ├── 80fe6a0c283d7209f8839c79bc90ff9ecd9fdedd
   │      └── b082560898736233790dedff7b1a725b18614480
   │      ├── 356f73863a8920455ff6e77cd9c805d68910551b
   │      └── 696ec5508494692899337afe6713fe1796d0315c
   └── rad
      ├── id
      └── sigrefs
@ -61,8 +61,8 @@ When we push to `rad/master`, we automatically merge the patches:
``` (stderr) RAD_SOCKET=/dev/null
$ git push rad master
✓ Patch 80fe6a0c283d7209f8839c79bc90ff9ecd9fdedd merged
✓ Patch b082560898736233790dedff7b1a725b18614480 merged
✓ Patch 356f73863a8920455ff6e77cd9c805d68910551b merged
✓ Patch 696ec5508494692899337afe6713fe1796d0315c merged
✓ Canonical head updated to d6399c71702b40bae00825b3c444478d06b4e91c
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
f2de534..d6399c7 master -> master
@ -75,10 +75,10 @@ $ rad patch --merged
│ ✔ [ ... ] Second change alice (you) daf349f +0 -0 now │
│ ✔ [ ... ] First change alice (you) 20aa5dd +0 -0 now │
╰────────────────────────────────────────────────────────────────────╯
$ rad patch show 80fe6a0c283d7209f8839c79bc90ff9ecd9fdedd
$ rad patch show 356f73863a8920455ff6e77cd9c805d68910551b
╭────────────────────────────────────────────────────────────────╮
│ Title Second change │
│ Patch 80fe6a0c283d7209f8839c79bc90ff9ecd9fdedd
│ Patch 356f73863a8920455ff6e77cd9c805d68910551b
│ Author alice (you) │
│ Head daf349ff76bedf48c5f292290b682ee7be0683cf │
│ Branches feature/2 │
@ -88,7 +88,7 @@ $ rad patch show 80fe6a0c283d7209f8839c79bc90ff9ecd9fdedd
│ daf349f Second change │
├────────────────────────────────────────────────────────────────┤
│ ● opened by alice (you) (daf349f) now │
│ └─ ✓ merged by alice (you) at revision 80fe6a0 (d6399c7) now │
│ └─ ✓ merged by alice (you) at revision 356f738 (d6399c7) now │
╰────────────────────────────────────────────────────────────────╯
```
@ -109,8 +109,8 @@ z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
   │   ├── xyz.radicle.id
   │   │   └── 0656c217f917c3e06234771e9ecae53aba5e173e
   │   └── xyz.radicle.patch
   │      ├── 80fe6a0c283d7209f8839c79bc90ff9ecd9fdedd
   │      └── b082560898736233790dedff7b1a725b18614480
   │      ├── 356f73863a8920455ff6e77cd9c805d68910551b
   │      └── 696ec5508494692899337afe6713fe1796d0315c
   ├── heads
   │   └── master
   └── rad

View File

@ -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 0d1b997bc21ffa5cb7cda244d94e1d6bfcc4a513 opened
✓ Patch 217f050f8891def8fb863f7c0b4f85c89f97299d opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new reference] feature/1 -> refs/patches
```
@ -48,17 +48,17 @@ $ rad patch list
╭────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Head + - Updated │
├────────────────────────────────────────────────────────────────────────┤
│ ● 0d1b997 Add Alan z6MknSL…StBU8Vi (you) 5c88a79 +1 -0 now │
│ ● 217f050 Add Alan z6MknSL…StBU8Vi (you) 5c88a79 +1 -0 now │
╰────────────────────────────────────────────────────────────────────────╯
```
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 0d1b997
$ rad patch show -v -p 217f050
╭────────────────────────────────────────────────────╮
│ Title Add Alan │
│ Patch 0d1b997bc21ffa5cb7cda244d94e1d6bfcc4a513
│ Patch 217f050f8891def8fb863f7c0b4f85c89f97299d
│ 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 f0064bba0336095123345a1f983edb72242f592c opened
✓ Patch e22ff008e2a0ed47262890d13263031d7555b555 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 f0064bba0336095123345a1f983edb72242f592c
$ rad patch show -v e22ff008e2a0ed47262890d13263031d7555b555
╭────────────────────────────────────────────────────╮
│ Title Add Mel │
│ Patch f0064bba0336095123345a1f983edb72242f592c
│ Patch e22ff008e2a0ed47262890d13263031d7555b555
│ 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=HEAD^ rad HEAD:refs/patches
✓ Patch 9fbe7185ab3246dec08391f833fffb6c40f0760e opened
✓ Patch a467ffa260c4fbe355b6fb550ba0c4956078717e 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 9fbe7185ab3246dec08391f833fffb6c40f0760e
$ rad patch show -v a467ffa260c4fbe355b6fb550ba0c4956078717e
╭────────────────────────────────────────────────────╮
│ Title Add Mel #2
│ Patch 9fbe7185ab3246dec08391f833fffb6c40f0760e │
│ Patch a467ffa260c4fbe355b6fb550ba0c4956078717e │
│ Author z6MknSL…StBU8Vi (you) │
│ Head 7f63fcbcf23fc39eea784c091ad3d20d7e4bd005 │
│ Base 5c88a79d75f5c2b4cc51ee6f163d2db91ee198d7 │

View File

@ -18,7 +18,7 @@ $ git push rad flux-capacitor-power
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new branch] flux-capacitor-power -> flux-capacitor-power
$ git push rad -o patch.message="Define power requirements" -o patch.message="See details." HEAD:refs/patches
✓ Patch 0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f opened
✓ Patch aa45913e757cacd46972733bddee5472c78fa32a opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new reference] HEAD -> refs/patches
```
@ -35,7 +35,7 @@ $ git commit --message "Add README, just for the fun"
```
``` (stderr)
$ git push rad -o patch.message="Add README, just for the fun" HEAD:refs/patches
✓ Patch 3c3036d038ef50cccb9dbccb46302bf0867ba683 opened
✓ Patch 183d343ab47d7fe18baf1b24b7209ad033d7fe5c opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new reference] HEAD -> refs/patches
```
@ -43,10 +43,10 @@ To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkE
Our second patch looks like the following:
```
$ rad patch show 3c3036d -v
$ rad patch show 183d343ab47d7fe18baf1b24b7209ad033d7fe5c -v
╭────────────────────────────────────────────────────╮
│ Title Add README, just for the fun │
│ Patch 3c3036d038ef50cccb9dbccb46302bf0867ba683
│ Patch 183d343ab47d7fe18baf1b24b7209ad033d7fe5c
│ Author z6MknSL…StBU8Vi (you) │
│ Head 27857ec9eb04c69cacab516e8bf4b5fd36090f66 │
│ Base f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 │
@ -66,18 +66,18 @@ commit `3e674d1` as part of this patch, so we create a new revision
with a new `base`:
```
$ rad patch update 3c3036d -b 3e674d1 -m "Whoops, forgot to set the base" --no-announce
d94313559de9009d261135736a3c5f3f3e873b5d
$ rad patch update 183d343 -b 3e674d1 -m "Whoops, forgot to set the base" --no-announce
ebe76f9c2148eb595d7a745f82275786bf3458c3
```
Now, if we show the patch we can see the patch's base has changed and
we have a single commit:
```
$ rad patch show 3c3036d -v
$ rad patch show 183d343 -v
╭─────────────────────────────────────────────────────────────────────╮
│ Title Add README, just for the fun │
│ Patch 3c3036d038ef50cccb9dbccb46302bf0867ba683
│ Patch 183d343ab47d7fe18baf1b24b7209ad033d7fe5c
│ Author z6MknSL…StBU8Vi (you) │
│ Head 27857ec9eb04c69cacab516e8bf4b5fd36090f66 │
│ Base 3e674d1a1df90807e934f9ae5da2591dd6848a33 │
@ -88,6 +88,6 @@ $ rad patch show 3c3036d -v
│ 27857ec Add README, just for the fun │
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by z6MknSL…StBU8Vi (you) (27857ec) now │
│ ↑ updated to d94313559de9009d261135736a3c5f3f3e873b5d (27857ec) now │
│ ↑ updated to ebe76f9c2148eb595d7a745f82275786bf3458c3 (27857ec) now │
╰─────────────────────────────────────────────────────────────────────╯
```

View File

@ -13,7 +13,7 @@ $ git commit -v -m "Define power requirements"
``` ~alice (stderr)
$ git push rad -o patch.message="Define power requirements" -o patch.message="See details." HEAD:refs/patches
✓ Patch 0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f opened
✓ Patch aa45913e757cacd46972733bddee5472c78fa32a opened
✓ Synced with 1 node(s)
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new reference] HEAD -> refs/patches
@ -26,9 +26,9 @@ $ cd heartwood
$ rad sync -f
✓ Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from z6MknSL…StBU8Vi..
✓ Fetched repository from 1 seed(s)
$ rad patch checkout 0f3cd0b --name alice-init
$ rad patch checkout aa45913 --name alice-init
✓ Switched to branch alice-init
✓ Branch alice-init setup to track rad/patches/0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
✓ Branch alice-init setup to track rad/patches/aa45913e757cacd46972733bddee5472c78fa32a
```
Meanwhile, we may see some more changes that we need to make, so we
@ -45,10 +45,10 @@ $ git commit --message "Add README, just for the fun"
``` ~alice (stderr)
$ git push rad -o patch.message="Add README, just for the fun"
✓ Patch 0f3cd0b updated to revision 6e6644973e3ecd0965b7bc5743f05a5fe1c7bff9
✓ Patch aa45913 updated to revision 3156bed9d64d4675d6cf56612d217fc5f4e8a53a
✓ Synced with 1 node(s)
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
3e674d1..27857ec flux-capacitor-power -> patches/0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
3e674d1..27857ec flux-capacitor-power -> patches/aa45913e757cacd46972733bddee5472c78fa32a
```
Bob fetches these new changes and can see their branch is now behind:
@ -56,13 +56,13 @@ Bob fetches these new changes and can see their branch is now behind:
``` ~bob (stderr)
$ git fetch rad
From rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji
3e674d1..27857ec patches/0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f -> rad/patches/0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
3e674d1..27857ec patches/aa45913e757cacd46972733bddee5472c78fa32a -> rad/patches/aa45913e757cacd46972733bddee5472c78fa32a
```
``` ~bob
$ git status
On branch alice-init
Your branch is behind 'rad/patches/0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f' by 1 commit, and can be fast-forwarded.
Your branch is behind 'rad/patches/aa45913e757cacd46972733bddee5472c78fa32a' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working tree clean
@ -74,17 +74,17 @@ overwrite any changes. Bob can choose to use the `--force` (`-f`) flag to
ensure that they are looking at the latest changes:
``` ~bob (fail)
$ rad patch checkout 0f3cd0b --name alice-init
$ rad patch checkout aa45913 --name alice-init
✗ Performing checkout... <canceled>
✗ Error: branch 'alice-init' already exists (use `--force` to overwrite)
```
``` ~bob
$ rad patch checkout 0f3cd0b -f --name alice-init
$ rad patch checkout aa45913 -f --name alice-init
✓ Switched to branch alice-init
$ git status
On branch alice-init
Your branch is up to date with 'rad/patches/0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f'.
Your branch is up to date with 'rad/patches/aa45913e757cacd46972733bddee5472c78fa32a'.
nothing to commit, working tree clean
```

View File

@ -5,7 +5,7 @@ So first, let's add another change to the patch and a `LICENSE` file.
$ touch LICENSE
$ git add LICENSE
$ git commit --message "Add LICENSE, just for the business"
[patch/0f3cd0b 639f44a] Add LICENSE, just for the business
[patch/aa45913 639f44a] Add LICENSE, just for the business
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 LICENSE
$ git push rad -o patch.message="Add LICENSE, just for the business"
@ -14,13 +14,13 @@ $ git push rad -o patch.message="Add LICENSE, just for the business"
We can see the list of revisions of the patch by `show`ing it:
```
$ rad patch show 0f3cd0b
$ rad patch show aa45913
╭─────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │
│ Patch 0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
│ Patch aa45913e757cacd46972733bddee5472c78fa32a
│ Author z6MknSL…StBU8Vi (you) │
│ Head 639f44a25145a37f747f3c84265037a9461e44c5 │
│ Branches patch/0f3cd0b
│ Branches patch/aa45913
│ Commits ahead 3, behind 0 │
│ Status open │
│ │
@ -31,16 +31,16 @@ $ rad patch show 0f3cd0b
│ 3e674d1 Define power requirements │
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by z6MknSL…StBU8Vi (you) (3e674d1) now │
│ ↑ updated to 6e6644973e3ecd0965b7bc5743f05a5fe1c7bff9 (27857ec) now │
│ ↑ updated to 9b707980e143c5370d5406050f04d60b705cf849 (639f44a) now │
│ ↑ updated to 3156bed9d64d4675d6cf56612d217fc5f4e8a53a (27857ec) now │
│ ↑ updated to 2f5324f61e05cda65b667eeea02570d077a8e724 (639f44a) now │
╰─────────────────────────────────────────────────────────────────────╯
```
So, let's checkout the previous revision, `0c0942e2`:
```
$ rad patch checkout 0f3cd0b --revision 6e66449 -f
✓ Switched to branch patch/0f3cd0b
$ rad patch checkout aa45913 --revision 3156bed9d64d4675d6cf56612d217fc5f4e8a53a -f
✓ Switched to branch patch/aa45913
```
And we can confirm that the current commit corresponds to `27857ec`:

View File

@ -22,7 +22,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 0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f opened
✓ Patch aa45913e757cacd46972733bddee5472c78fa32a opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new reference] HEAD -> refs/patches
```
@ -30,9 +30,9 @@ To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkE
Now, let's checkout the patch that we just created:
```
$ rad patch checkout 0f3cd0b
✓ Switched to branch patch/0f3cd0b
✓ Branch patch/0f3cd0b setup to track rad/patches/0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
$ rad patch checkout aa45913e757cacd46972733bddee5472c78fa32a
✓ Switched to branch patch/aa45913
✓ Branch patch/aa45913 setup to track rad/patches/aa45913e757cacd46972733bddee5472c78fa32a
```
Note that `rad patch checkout` can be used to switch to the patch branch
@ -40,8 +40,8 @@ as long as we haven't made changes to it.
```
$ git checkout master -q
$ rad patch checkout 0f3cd0b
✓ Switched to branch patch/0f3cd0b
$ rad patch checkout aa45913
✓ Switched to branch patch/aa45913
```
Now, let's add a README too!
@ -50,7 +50,7 @@ Now, let's add a README too!
$ touch README.md
$ git add README.md
$ git commit --message "Add README, just for the fun"
[patch/0f3cd0b 27857ec] Add README, just for the fun
[patch/aa45913 27857ec] Add README, just for the fun
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README.md
```
@ -59,7 +59,7 @@ We can now finish off the update:
``` (stderr)
$ git push rad -o patch.message="Add README, just for the fun"
✓ Patch 0f3cd0b updated to revision 6e6644973e3ecd0965b7bc5743f05a5fe1c7bff9
✓ Patch aa45913 updated to revision 3156bed9d64d4675d6cf56612d217fc5f4e8a53a
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
3e674d1..27857ec patch/0f3cd0b -> patches/0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
3e674d1..27857ec patch/aa45913 -> patches/aa45913e757cacd46972733bddee5472c78fa32a
```

View File

@ -10,7 +10,7 @@ $ git commit -m "Add README" -q
$ git push rad HEAD:refs/patches
```
```
$ rad patch diff b1fbd2c
$ rad patch diff 147309e
╭───────────────────────────╮
│ README.md +1 created
├───────────────────────────┤
@ -31,7 +31,7 @@ $ git commit --amend -q
$ git push -f
```
```
$ rad patch diff b1fbd2c
$ rad patch diff 147309e
╭─────────────────────────────╮
│ RADICLE.md +1 created
├─────────────────────────────┤
@ -52,7 +52,7 @@ Buf if we only want to see the changes from the first revision, we can do that
too.
```
$ rad patch diff b1fbd2c --revision b1fbd2c
$ rad patch diff 147309e --revision 147309e
╭───────────────────────────╮
│ README.md +1 created
├───────────────────────────┤

View File

@ -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 b5df71076ba95d80acb1de3a13f94995632df95e drafted
✓ Patch 97e18f8598237a396a1c0ac1509c89028e666c97 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 b5df71076ba95d80acb1de3a13f94995632df95e
$ rad patch show 97e18f8598237a396a1c0ac1509c89028e666c97
╭────────────────────────────────────────────────────╮
│ Title Nothing yet │
│ Patch b5df71076ba95d80acb1de3a13f94995632df95e
│ Patch 97e18f8598237a396a1c0ac1509c89028e666c97
│ Author z6MknSL…StBU8Vi (you) │
│ Head 2a465832b5a76abe25be44a3a5d224bbd7741ba7 │
│ Branches cloudhead/draft │
@ -36,14 +36,14 @@ $ rad patch show b5df71076ba95d80acb1de3a13f94995632df95e
Once the patch is ready for review, we can use the `ready` command:
```
$ rad patch ready b5df71076ba95d80acb1de3a13f94995632df95e --no-announce
$ rad patch ready 97e18f8598237a396a1c0ac1509c89028e666c97 --no-announce
```
```
$ rad patch show b5df71076ba95d80acb1de3a13f94995632df95e
$ rad patch show 97e18f8598237a396a1c0ac1509c89028e666c97
╭────────────────────────────────────────────────────╮
│ Title Nothing yet │
│ Patch b5df71076ba95d80acb1de3a13f94995632df95e
│ Patch 97e18f8598237a396a1c0ac1509c89028e666c97
│ 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 b5df71076ba95d80acb1de3a13f94995632df95e --no-announce
$ rad patch show b5df71076ba95d80acb1de3a13f94995632df95e
$ rad patch ready --undo 97e18f8598237a396a1c0ac1509c89028e666c97 --no-announce
$ rad patch show 97e18f8598237a396a1c0ac1509c89028e666c97
╭────────────────────────────────────────────────────╮
│ Title Nothing yet │
│ Patch b5df71076ba95d80acb1de3a13f94995632df95e
│ Patch 97e18f8598237a396a1c0ac1509c89028e666c97
│ Author z6MknSL…StBU8Vi (you) │
│ Head 2a465832b5a76abe25be44a3a5d224bbd7741ba7 │
│ Branches cloudhead/draft │

View File

@ -16,7 +16,7 @@ $ git commit --message "Add README, just for the fun"
``` (stderr)
$ git push rad -o patch.message="Add README, just for the fun" HEAD:refs/patches
✓ Patch 59e17793443e35a5e76b3dd58d419d316d8211ee opened
✓ Patch 89f7afb1511b976482b21f6b2f39aef7f4fb88a2 opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new reference] HEAD -> refs/patches
```
@ -32,18 +32,18 @@ $ git commit -v -m "Define the LICENSE"
``` (stderr)
$ git push -f -o patch.message="Add License"
✓ Patch 59e1779 updated to revision 7169d286cc0e3060ef97639c92b7c951260ade74
✓ Patch 89f7afb updated to revision 5d78dd5376453e25df5988ec86951c99cb73742c
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
03c02af..8945f61 changes -> patches/59e17793443e35a5e76b3dd58d419d316d8211ee
03c02af..8945f61 changes -> patches/89f7afb1511b976482b21f6b2f39aef7f4fb88a2
```
Let's look at the patch, to see what it looks like before editing it:
```
$ rad patch show 59e1779
$ rad patch show 89f7afb
╭─────────────────────────────────────────────────────────────────────╮
│ Title Add README, just for the fun │
│ Patch 59e17793443e35a5e76b3dd58d419d316d8211ee
│ Patch 89f7afb1511b976482b21f6b2f39aef7f4fb88a2
│ Author z6MknSL…StBU8Vi (you) │
│ Head 8945f6189adf027892c85ac57f7e9341049c2537 │
│ Branches changes │
@ -54,7 +54,7 @@ $ rad patch show 59e1779
│ 03c02af Add README, just for the fun │
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by z6MknSL…StBU8Vi (you) (03c02af) now │
│ ↑ updated to 7169d286cc0e3060ef97639c92b7c951260ade74 (8945f61) now │
│ ↑ updated to 5d78dd5376453e25df5988ec86951c99cb73742c (8945f61) now │
╰─────────────────────────────────────────────────────────────────────╯
```
@ -62,11 +62,11 @@ We can change the title and description of the patch itself by using a
multi-line message (using two `--message` options here):
```
$ rad patch edit 59e1779 --message "Add Metadata" --message "Add README & LICENSE" --no-announce
$ rad patch show 59e1779
$ rad patch edit 89f7afb --message "Add Metadata" --message "Add README & LICENSE" --no-announce
$ rad patch show 89f7afb
╭─────────────────────────────────────────────────────────────────────╮
│ Title Add Metadata │
│ Patch 59e17793443e35a5e76b3dd58d419d316d8211ee
│ Patch 89f7afb1511b976482b21f6b2f39aef7f4fb88a2
│ Author z6MknSL…StBU8Vi (you) │
│ Head 8945f6189adf027892c85ac57f7e9341049c2537 │
│ Branches changes │
@ -79,7 +79,7 @@ $ rad patch show 59e1779
│ 03c02af Add README, just for the fun │
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by z6MknSL…StBU8Vi (you) (03c02af) now │
│ ↑ updated to 7169d286cc0e3060ef97639c92b7c951260ade74 (8945f61) now │
│ ↑ updated to 5d78dd5376453e25df5988ec86951c99cb73742c (8945f61) now │
╰─────────────────────────────────────────────────────────────────────╯
```
@ -90,11 +90,11 @@ If we want to change a specific revision's description, we can use the
`--revision` option:
```
$ rad patch edit 59e1779 --revision 7169d28 --message "Changes: Adds LICENSE file" --no-announce
$ rad patch show 59e1779
$ rad patch edit 89f7afb --revision 5d78dd5 --message "Changes: Adds LICENSE file" --no-announce
$ rad patch show 89f7afb
╭─────────────────────────────────────────────────────────────────────╮
│ Title Add Metadata │
│ Patch 59e17793443e35a5e76b3dd58d419d316d8211ee
│ Patch 89f7afb1511b976482b21f6b2f39aef7f4fb88a2
│ Author z6MknSL…StBU8Vi (you) │
│ Head 8945f6189adf027892c85ac57f7e9341049c2537 │
│ Branches changes │
@ -107,7 +107,7 @@ $ rad patch show 59e1779
│ 03c02af Add README, just for the fun │
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by z6MknSL…StBU8Vi (you) (03c02af) now │
│ ↑ updated to 7169d286cc0e3060ef97639c92b7c951260ade74 (8945f61) now │
│ ↑ updated to 5d78dd5376453e25df5988ec86951c99cb73742c (8945f61) now │
╰─────────────────────────────────────────────────────────────────────╯
```

View File

@ -12,7 +12,7 @@ $ git push rad -o patch.message="Changes" HEAD:refs/patches
$ git checkout master -q
$ git branch -D alice/1 -q
$ git update-ref -d refs/remotes/rad/alice/1
$ git update-ref -d refs/remotes/rad/patches/eebe0783450d21db6e2a956b586fb728e747b12e
$ git update-ref -d refs/remotes/rad/patches/5e2dedcc5d515fcbc1cca483d3376609fe889bfb
$ git gc --prune=now
$ git branch -r
rad/master
@ -23,5 +23,5 @@ $ git pull
Already up to date.
$ git branch -r
rad/master
rad/patches/eebe0783450d21db6e2a956b586fb728e747b12e
rad/patches/5e2dedcc5d515fcbc1cca483d3376609fe889bfb
```

View File

@ -4,7 +4,7 @@ Let's start by creating a draft patch.
$ git checkout -b feature/1 -q
$ git commit --allow-empty -q -m "First change"
$ git push -o patch.draft rad HEAD:refs/patches
✓ Patch d3b1d28d4c566e81ea3b8dcd2a23faef3e2471a5 drafted
✓ Patch 8dfb4dcafc4346158c8160410dd3f2b0616ad4fe drafted
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new reference] HEAD -> refs/patches
```
@ -13,7 +13,7 @@ To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkE
$ git checkout master -q
$ git merge feature/1
$ git push rad master
✓ Patch d3b1d28d4c566e81ea3b8dcd2a23faef3e2471a5 merged
✓ Patch 8dfb4dcafc4346158c8160410dd3f2b0616ad4fe merged
✓ Canonical head updated to 20aa5dde6210796c3a2f04079b42316a31d02689
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
f2de534..20aa5dd master -> master

View File

@ -4,10 +4,10 @@ When preferred seeds are configured, opening a patch outputs the patch URL.
$ git checkout -b changes -q
$ git commit --allow-empty -q -m "Changes"
$ git push rad HEAD:refs/patches
✓ Patch 806276a013152675fe4361e6c15275bd5c8d43b4 opened
✓ Patch acab0ec777a97d013f30be5d5d1aec32562ecb02 opened
✓ Synced with 1 node(s)
https://app.radicle.xyz/nodes/[..]/rad:z3yXbb1sR6UG6ixxV2YF9jUP7ABra/patches/806276a013152675fe4361e6c15275bd5c8d43b4
https://app.radicle.xyz/nodes/[..]/rad:z3yXbb1sR6UG6ixxV2YF9jUP7ABra/patches/acab0ec777a97d013f30be5d5d1aec32562ecb02
To rad://z3yXbb1sR6UG6ixxV2YF9jUP7ABra/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
* [new reference] HEAD -> refs/patches
@ -18,13 +18,13 @@ If we update the patch, the URL is also output.
``` (stderr)
$ git commit --amend --allow-empty -q -m "Other changes"
$ git push -f
✓ Patch 806276a updated to revision 374490d831db6574ddf9e4b8a8a3ef81e6783907
✓ Patch acab0ec updated to revision f7a830d829d0cdf398f63a32b0d5ee31f08e21ab
✓ Synced with 1 node(s)
https://app.radicle.xyz/nodes/[..]/rad:z3yXbb1sR6UG6ixxV2YF9jUP7ABra/patches/806276a013152675fe4361e6c15275bd5c8d43b4
https://app.radicle.xyz/nodes/[..]/rad:z3yXbb1sR6UG6ixxV2YF9jUP7ABra/patches/acab0ec777a97d013f30be5d5d1aec32562ecb02
To rad://z3yXbb1sR6UG6ixxV2YF9jUP7ABra/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
+ e12525d...b2b6432 changes -> patches/806276a013152675fe4361e6c15275bd5c8d43b4 (forced update)
+ e12525d...b2b6432 changes -> patches/acab0ec777a97d013f30be5d5d1aec32562ecb02 (forced update)
```
While simply pushing a commit outputs a URL to the new source tree.
@ -33,7 +33,7 @@ While simply pushing a commit outputs a URL to the new source tree.
$ git checkout master -q
$ git merge changes -q
$ git push rad master
✓ Patch 806276a013152675fe4361e6c15275bd5c8d43b4 merged
✓ Patch acab0ec777a97d013f30be5d5d1aec32562ecb02 merged
✓ Canonical head updated to b2b6432af93f8fe188e32d400263021b602cfec8
✓ Synced with 1 node(s)

View File

@ -53,22 +53,22 @@ Bob then opens a patch.
$ 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 d83a9a0e808dea392a10c0a62246484a18842039 opened
✓ Patch 55b9721ed7f6bfec38f43729e9b6631c5dc812fb opened
✓ Synced with 1 node(s)
To rad://zhbMU4DUXrzB8xT6qAJh6yZ7bFMK/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
* [new reference] HEAD -> refs/patches
```
``` ~bob
$ git status --short --branch
## bob/feature...rad/patches/d83a9a0e808dea392a10c0a62246484a18842039
## bob/feature...rad/patches/55b9721ed7f6bfec38f43729e9b6631c5dc812fb
```
Alice checks it out.
``` ~alice
$ rad patch checkout d83a9a0
✓ Switched to branch patch/d83a9a0
✓ Branch patch/d83a9a0 setup to track rad/patches/d83a9a0e808dea392a10c0a62246484a18842039
$ rad patch checkout 55b9721ed7f6bfec38f43729e9b6631c5dc812fb
✓ Switched to branch patch/55b9721
✓ Branch patch/55b9721 setup to track rad/patches/55b9721ed7f6bfec38f43729e9b6631c5dc812fb
$ git show
commit bdcdb30b3c0f513620dd0f1c24ff8f4f71de956b
Author: radicle <radicle@localhost>
@ -82,19 +82,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 d83a9a0 updated to revision 37d68f4660541fc4fcbba5b7f81cc8f79b6cb05c
✓ Patch 55b9721 updated to revision f91e056da05b2d9a58af1160c76245bc3debf7a8
✓ Synced with 1 node(s)
To rad://zhbMU4DUXrzB8xT6qAJh6yZ7bFMK/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
bdcdb30..cad2666 bob/feature -> patches/d83a9a0e808dea392a10c0a62246484a18842039
bdcdb30..cad2666 bob/feature -> patches/55b9721ed7f6bfec38f43729e9b6631c5dc812fb
```
Alice pulls the update.
``` ~alice
$ rad patch show d83a9a0
$ rad patch show 55b9721
╭─────────────────────────────────────────────────────────────────────╮
│ Title Bob's patch │
│ Patch d83a9a0e808dea392a10c0a62246484a18842039
│ Patch 55b9721ed7f6bfec38f43729e9b6631c5dc812fb
│ Author bob z6Mkt67…v4N1tRk │
│ Head cad2666a8a2250e4dee175ed5044be2c251ff08b │
│ Commits ahead 2, behind 0 │
@ -104,16 +104,16 @@ $ rad patch show d83a9a0
│ bdcdb30 Bob's commit #1
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by bob z6Mkt67…v4N1tRk (bdcdb30) now │
│ ↑ updated to 37d68f4660541fc4fcbba5b7f81cc8f79b6cb05c (cad2666) now │
│ ↑ updated to f91e056da05b2d9a58af1160c76245bc3debf7a8 (cad2666) now │
╰─────────────────────────────────────────────────────────────────────╯
$ git ls-remote rad
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 refs/heads/master
cad2666a8a2250e4dee175ed5044be2c251ff08b refs/heads/patches/d83a9a0e808dea392a10c0a62246484a18842039
cad2666a8a2250e4dee175ed5044be2c251ff08b refs/heads/patches/55b9721ed7f6bfec38f43729e9b6631c5dc812fb
```
``` ~alice
$ git fetch rad
$ git status --short --branch
## patch/d83a9a0...rad/patches/d83a9a0e808dea392a10c0a62246484a18842039 [behind 1]
## patch/55b9721...rad/patches/55b9721ed7f6bfec38f43729e9b6631c5dc812fb [behind 1]
```
``` ~alice
$ git pull

View File

@ -6,16 +6,16 @@ $ git commit -q -m "Not a real change" --allow-empty
```
``` (stderr)
$ git push rad HEAD:refs/patches
✓ Patch bbe51b0a6b0edb6836eec7ca6fe9e8e918b05954 opened
✓ Patch b6a23eb08656de0ef1fcc0b5fe8820841e5cb2e5 opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new reference] HEAD -> refs/patches
```
```
$ rad patch show bbe51b0a6b0edb6836eec7ca6fe9e8e918b05954
$ rad patch show b6a23eb08656de0ef1fcc0b5fe8820841e5cb2e5
╭────────────────────────────────────────────────────╮
│ Title Not a real change │
│ Patch bbe51b0a6b0edb6836eec7ca6fe9e8e918b05954
│ Patch b6a23eb08656de0ef1fcc0b5fe8820841e5cb2e5
│ 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 bbe51b0a6b0edb6836eec7ca6fe9e8e918b05954 -m "Updated patch" --no-announce
c5fa2b805fa9dd61c999a810c35d39081b586472
$ rad patch update b6a23eb08656de0ef1fcc0b5fe8820841e5cb2e5 -m "Updated patch" --no-announce
ea7def3857f62f404606d7cd6490cd0de4eaebd1
```
The command outputs the new Revision ID, which we can now see here:
```
$ rad patch show bbe51b0a6b0edb6836eec7ca6fe9e8e918b05954
$ rad patch show b6a23eb08656de0ef1fcc0b5fe8820841e5cb2e5
╭─────────────────────────────────────────────────────────────────────╮
│ Title Not a real change │
│ Patch bbe51b0a6b0edb6836eec7ca6fe9e8e918b05954
│ Patch b6a23eb08656de0ef1fcc0b5fe8820841e5cb2e5
│ Author z6MknSL…StBU8Vi (you) │
│ Head 4d272148458a17620541555b1f0905c01658aa9f │
│ Branches feature/1 │
@ -67,6 +67,6 @@ $ rad patch show bbe51b0a6b0edb6836eec7ca6fe9e8e918b05954
│ 51b2f0f Not a real change │
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by z6MknSL…StBU8Vi (you) (51b2f0f) now │
│ ↑ updated to c5fa2b805fa9dd61c999a810c35d39081b586472 (4d27214) now │
│ ↑ updated to ea7def3857f62f404606d7cd6490cd0de4eaebd1 (4d27214) now │
╰─────────────────────────────────────────────────────────────────────╯
```

View File

@ -8,8 +8,8 @@ $ 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 d43d4eeffedad8411d9e077208464156fd2fe1f0 opened
hint: to update, run `git push` or `git push rad -f HEAD:patches/d43d4eeffedad8411d9e077208464156fd2fe1f0`
✓ Patch 6035d2f582afbe01ff23ea87528ae523d76875b6 opened
hint: to update, run `git push` or `git push rad -f HEAD:patches/6035d2f582afbe01ff23ea87528ae523d76875b6`
hint: offline push, your node is not running
hint: to sync with the network, run `rad node start`
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
@ -19,10 +19,10 @@ To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkE
We can see a patch was created:
```
$ rad patch show d43d4eeffedad8411d9e077208464156fd2fe1f0
$ rad patch show 6035d2f582afbe01ff23ea87528ae523d76875b6
╭────────────────────────────────────────────────────╮
│ Title Add things #1
│ Patch d43d4eeffedad8411d9e077208464156fd2fe1f0
│ Patch 6035d2f582afbe01ff23ea87528ae523d76875b6
│ Author z6MknSL…StBU8Vi (you) │
│ Head 42d894a83c9c356552a57af09ccdbd5587a99045 │
│ Branches feature/1 │
@ -42,7 +42,7 @@ branch associated with this patch:
```
$ git branch -vv
* feature/1 42d894a [rad/patches/d43d4eeffedad8411d9e077208464156fd2fe1f0] Add things
* feature/1 42d894a [rad/patches/6035d2f582afbe01ff23ea87528ae523d76875b6] Add things
master f2de534 [rad/master] Second commit
```
@ -50,7 +50,7 @@ Let's check that it's up to date with our local head:
```
$ git status --short --branch
## feature/1...rad/patches/d43d4eeffedad8411d9e077208464156fd2fe1f0
## feature/1...rad/patches/6035d2f582afbe01ff23ea87528ae523d76875b6
$ git fetch
$ git push
```
@ -62,14 +62,14 @@ $ git show-ref
42d894a83c9c356552a57af09ccdbd5587a99045 refs/heads/feature/1
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 refs/heads/master
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 refs/remotes/rad/master
42d894a83c9c356552a57af09ccdbd5587a99045 refs/remotes/rad/patches/d43d4eeffedad8411d9e077208464156fd2fe1f0
42d894a83c9c356552a57af09ccdbd5587a99045 refs/remotes/rad/patches/6035d2f582afbe01ff23ea87528ae523d76875b6
```
```
$ git ls-remote rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji 'refs/heads/patches/*'
42d894a83c9c356552a57af09ccdbd5587a99045 refs/heads/patches/d43d4eeffedad8411d9e077208464156fd2fe1f0
42d894a83c9c356552a57af09ccdbd5587a99045 refs/heads/patches/6035d2f582afbe01ff23ea87528ae523d76875b6
$ git ls-remote rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi 'refs/cobs/*'
0656c217f917c3e06234771e9ecae53aba5e173e refs/cobs/xyz.radicle.id/0656c217f917c3e06234771e9ecae53aba5e173e
d43d4eeffedad8411d9e077208464156fd2fe1f0 refs/cobs/xyz.radicle.patch/d43d4eeffedad8411d9e077208464156fd2fe1f0
6035d2f582afbe01ff23ea87528ae523d76875b6 refs/cobs/xyz.radicle.patch/6035d2f582afbe01ff23ea87528ae523d76875b6
```
We can create another patch:
@ -78,7 +78,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 178c07e0b0ae3cc082438952085397d2aae9500a opened
✓ Patch 95808913573cead52ad7b42c7b475260ec45c4b2 opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new reference] HEAD -> refs/patches
```
@ -87,8 +87,8 @@ We see both branches with upstreams now:
```
$ git branch -vv
feature/1 42d894a [rad/patches/d43d4eeffedad8411d9e077208464156fd2fe1f0] Add things
* feature/2 8b0ea80 [rad/patches/178c07e0b0ae3cc082438952085397d2aae9500a] Add more things
feature/1 42d894a [rad/patches/6035d2f582afbe01ff23ea87528ae523d76875b6] Add things
* feature/2 8b0ea80 [rad/patches/95808913573cead52ad7b42c7b475260ec45c4b2] Add more things
master f2de534 [rad/master] Second commit
```
@ -99,8 +99,8 @@ $ rad patch
╭───────────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Head + - Updated │
├───────────────────────────────────────────────────────────────────────────────┤
│ ● 178c07e Add more things z6MknSL…StBU8Vi (you) 8b0ea80 +0 -0 now │
│ ● d43d4ee Add things #1 z6MknSL…StBU8Vi (you) 42d894a +0 -0 now │
│ ● 6035d2f Add things #1 z6MknSL…StBU8Vi (you) 42d894a +0 -0 now │
│ ● 9580891 Add more things z6MknSL…StBU8Vi (you) 8b0ea80 +0 -0 now │
╰───────────────────────────────────────────────────────────────────────────────╯
```
@ -112,9 +112,9 @@ $ git commit -a -m "Improve code" -q --allow-empty
``` (stderr)
$ git push rad
✓ Patch 178c07e updated to revision f82a63ebfcda8b43f2119d5fcadbe52e07c3272e
✓ Patch 9580891 updated to revision d7040c6c97629c2b94f86fb639bebbff5de39697
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
8b0ea80..02bef3f feature/2 -> patches/178c07e0b0ae3cc082438952085397d2aae9500a
8b0ea80..02bef3f feature/2 -> patches/95808913573cead52ad7b42c7b475260ec45c4b2
```
This last `git push` worked without specifying an upstream branch despite the
@ -132,10 +132,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 178c07e
$ rad patch show 9580891
╭─────────────────────────────────────────────────────────────────────╮
│ Title Add more things │
│ Patch 178c07e0b0ae3cc082438952085397d2aae9500a
│ Patch 95808913573cead52ad7b42c7b475260ec45c4b2
│ Author z6MknSL…StBU8Vi (you) │
│ Head 02bef3fac41b2f98bb3c02b868a53ddfecb55b5f │
│ Branches feature/2 │
@ -146,7 +146,7 @@ $ rad patch show 178c07e
│ 8b0ea80 Add more things │
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by z6MknSL…StBU8Vi (you) (8b0ea80) now │
│ ↑ updated to f82a63ebfcda8b43f2119d5fcadbe52e07c3272e (02bef3f) now │
│ ↑ updated to d7040c6c97629c2b94f86fb639bebbff5de39697 (02bef3f) now │
╰─────────────────────────────────────────────────────────────────────╯
```
@ -159,14 +159,14 @@ $ git rev-parse HEAD
```
$ git status --short --branch
## feature/2...rad/patches/178c07e0b0ae3cc082438952085397d2aae9500a
## feature/2...rad/patches/95808913573cead52ad7b42c7b475260ec45c4b2
```
```
$ git rev-parse refs/remotes/rad/patches/178c07e0b0ae3cc082438952085397d2aae9500a
$ git rev-parse refs/remotes/rad/patches/95808913573cead52ad7b42c7b475260ec45c4b2
02bef3fac41b2f98bb3c02b868a53ddfecb55b5f
$ git ls-remote rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi refs/heads/patches/178c07e0b0ae3cc082438952085397d2aae9500a
02bef3fac41b2f98bb3c02b868a53ddfecb55b5f refs/heads/patches/178c07e0b0ae3cc082438952085397d2aae9500a
$ git ls-remote rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi refs/heads/patches/95808913573cead52ad7b42c7b475260ec45c4b2
02bef3fac41b2f98bb3c02b868a53ddfecb55b5f refs/heads/patches/95808913573cead52ad7b42c7b475260ec45c4b2
```
## Force push
@ -187,7 +187,7 @@ Now let's push to the patch head.
``` (stderr) (fail)
$ git push
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
! [rejected] feature/2 -> patches/178c07e0b0ae3cc082438952085397d2aae9500a (non-fast-forward)
! [rejected] feature/2 -> patches/95808913573cead52ad7b42c7b475260ec45c4b2 (non-fast-forward)
error: failed to push some refs to 'rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi'
hint: [..]
hint: [..]
@ -200,18 +200,18 @@ use `--force` to force the update.
``` (stderr)
$ git push --force
✓ Patch 178c07e updated to revision d125e0b78e1e496d7653d220d09354b1b434a3ab
✓ Patch 9580891 updated to revision 670d02794aa05afd6e0851f4aa848bc87c4712c7
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
+ 02bef3f...9304dbc feature/2 -> patches/178c07e0b0ae3cc082438952085397d2aae9500a (forced update)
+ 02bef3f...9304dbc feature/2 -> patches/95808913573cead52ad7b42c7b475260ec45c4b2 (forced update)
```
That worked. We can see the new revision if we call `rad patch show`:
```
$ rad patch show 178c07e
$ rad patch show 9580891
╭─────────────────────────────────────────────────────────────────────╮
│ Title Add more things │
│ Patch 178c07e0b0ae3cc082438952085397d2aae9500a
│ Patch 95808913573cead52ad7b42c7b475260ec45c4b2
│ Author z6MknSL…StBU8Vi (you) │
│ Head 9304dbc445925187994a7a93222a3f8bde73b785 │
│ Branches feature/2 │
@ -222,8 +222,8 @@ $ rad patch show 178c07e
│ 8b0ea80 Add more things │
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by z6MknSL…StBU8Vi (you) (8b0ea80) now │
│ ↑ updated to f82a63ebfcda8b43f2119d5fcadbe52e07c3272e (02bef3f) now │
│ ↑ updated to d125e0b78e1e496d7653d220d09354b1b434a3ab (9304dbc) now │
│ ↑ updated to d7040c6c97629c2b94f86fb639bebbff5de39697 (02bef3f) now │
│ ↑ updated to 670d02794aa05afd6e0851f4aa848bc87c4712c7 (9304dbc) now │
╰─────────────────────────────────────────────────────────────────────╯
```

View File

@ -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 0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f opened
✓ Patch aa45913e757cacd46972733bddee5472c78fa32a opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new reference] HEAD -> refs/patches
```
@ -38,14 +38,14 @@ $ rad patch
╭─────────────────────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Head + - Updated │
├─────────────────────────────────────────────────────────────────────────────────────────┤
│ ● 0f3cd0b Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 now │
│ ● aa45913 Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 now │
╰─────────────────────────────────────────────────────────────────────────────────────────╯
```
```
$ rad patch show 0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f -p
$ rad patch show aa45913e757cacd46972733bddee5472c78fa32a -p
╭────────────────────────────────────────────────────╮
│ Title Define power requirements │
│ Patch 0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
│ Patch aa45913e757cacd46972733bddee5472c78fa32a
│ Author z6MknSL…StBU8Vi (you) │
│ Head 3e674d1a1df90807e934f9ae5da2591dd6848a33 │
│ Branches flux-capacitor-power │
@ -78,14 +78,14 @@ $ rad patch list --authored
╭─────────────────────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Head + - Updated │
├─────────────────────────────────────────────────────────────────────────────────────────┤
│ ● 0f3cd0b Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 now │
│ ● aa45913 Define power requirements z6MknSL…StBU8Vi (you) 3e674d1 +0 -0 now │
╰─────────────────────────────────────────────────────────────────────────────────────────╯
```
We can also see that it set an upstream for our patch branch:
```
$ git branch -vv
* flux-capacitor-power 3e674d1 [rad/patches/0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f] Define power requirements
* flux-capacitor-power 3e674d1 [rad/patches/aa45913e757cacd46972733bddee5472c78fa32a] Define power requirements
master f2de534 [rad/master] Second commit
```
@ -93,12 +93,12 @@ We can also label patches as well as assign DIDs to the patch to help
organise your workflow:
```
$ rad patch label 0f3cd0b --add fun --no-announce
$ rad patch assign 0f3cd0b --add did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi --no-announce
$ rad patch show 0f3cd0b
$ rad patch label aa45913 --add fun --no-announce
$ rad patch assign aa45913 --add did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi --no-announce
$ rad patch show aa45913
╭────────────────────────────────────────────────────╮
│ Title Define power requirements │
│ Patch 0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
│ Patch aa45913e757cacd46972733bddee5472c78fa32a
│ Author z6MknSL…StBU8Vi (you) │
│ Labels fun │
│ Head 3e674d1a1df90807e934f9ae5da2591dd6848a33 │
@ -126,49 +126,49 @@ $ git commit --message "Add README, just for the fun"
```
``` (stderr)
$ git push rad -o patch.message="Add README, just for the fun"
✓ Patch 0f3cd0b updated to revision 8144632f7cc54793386279283a24565f5841e9f8
✓ Patch aa45913 updated to revision 6e5a3b7b2ce27b32e7ccc2f0b3f4594897dde638
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
3e674d1..27857ec flux-capacitor-power -> patches/0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
3e674d1..27857ec flux-capacitor-power -> patches/aa45913e757cacd46972733bddee5472c78fa32a
```
And let's leave a quick comment for our team:
```
$ rad patch comment 0f3cd0b --message 'I cannot wait to get back to the 90s!' --no-announce
$ rad patch comment aa45913 --message 'I cannot wait to get back to the 90s!' --no-announce
╭───────────────────────────────────────╮
│ z6MknSL…StBU8Vi (you) now 0f81124
│ z6MknSL…StBU8Vi (you) now 686ec1c
│ I cannot wait to get back to the 90s! │
╰───────────────────────────────────────╯
$ rad patch comment 0f3cd0b --message 'My favorite decade!' --reply-to 0f81124 -q --no-announce
7e96054a98a2dc4e3c66cd16479cbe9adf7015dc
$ rad patch comment aa45913 --message 'My favorite decade!' --reply-to 686ec1c -q --no-announce
f4336e42daf76342f787d574b5ee779d89d05c7a
```
Now, let's checkout the patch that we just created:
```
$ rad patch checkout 0f3cd0b
✓ Switched to branch patch/0f3cd0b
✓ Branch patch/0f3cd0b setup to track rad/patches/0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
$ rad patch checkout aa45913
✓ Switched to branch patch/aa45913
✓ Branch patch/aa45913 setup to track rad/patches/aa45913e757cacd46972733bddee5472c78fa32a
```
We can also add a review verdict as such:
```
$ rad patch review 0f3cd0b --accept --no-message --no-announce
✓ Patch 0f3cd0b accepted
$ rad patch review aa45913 --accept --no-message --no-announce
✓ Patch aa45913 accepted
```
Showing the patch list now will reveal the favorable verdict:
```
$ rad patch show 0f3cd0b
$ rad patch show aa45913
╭─────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │
│ Patch 0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
│ Patch aa45913e757cacd46972733bddee5472c78fa32a
│ Author z6MknSL…StBU8Vi (you) │
│ Labels fun │
│ Head 27857ec9eb04c69cacab516e8bf4b5fd36090f66 │
│ Branches flux-capacitor-power, patch/0f3cd0b
│ Branches flux-capacitor-power, patch/aa45913
│ Commits ahead 2, behind 0 │
│ Status open │
│ │
@ -178,7 +178,7 @@ $ rad patch show 0f3cd0b
│ 3e674d1 Define power requirements │
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by z6MknSL…StBU8Vi (you) (3e674d1) now │
│ ↑ updated to 8144632f7cc54793386279283a24565f5841e9f8 (27857ec) now │
│ ↑ updated to 6e5a3b7b2ce27b32e7ccc2f0b3f4594897dde638 (27857ec) now │
│ └─ ✓ accepted by z6MknSL…StBU8Vi (you) now │
╰─────────────────────────────────────────────────────────────────────╯
```
@ -186,15 +186,15 @@ $ rad patch show 0f3cd0b
If you make a mistake on the patch description, you can always change it!
```
$ rad patch edit 0f3cd0b --message "Define power requirements" --message "Add requirements file" --no-announce
$ rad patch show 0f3cd0b
$ rad patch edit aa45913 --message "Define power requirements" --message "Add requirements file" --no-announce
$ rad patch show aa45913
╭─────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │
│ Patch 0f3cd0b3a69c8f70bfa2d3366122c07704e5bb5f
│ Patch aa45913e757cacd46972733bddee5472c78fa32a
│ Author z6MknSL…StBU8Vi (you) │
│ Labels fun │
│ Head 27857ec9eb04c69cacab516e8bf4b5fd36090f66 │
│ Branches flux-capacitor-power, patch/0f3cd0b
│ Branches flux-capacitor-power, patch/aa45913
│ Commits ahead 2, behind 0 │
│ Status open │
│ │
@ -204,7 +204,7 @@ $ rad patch show 0f3cd0b
│ 3e674d1 Define power requirements │
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by z6MknSL…StBU8Vi (you) (3e674d1) now │
│ ↑ updated to 8144632f7cc54793386279283a24565f5841e9f8 (27857ec) now │
│ ↑ updated to 6e5a3b7b2ce27b32e7ccc2f0b3f4594897dde638 (27857ec) now │
│ └─ ✓ accepted by z6MknSL…StBU8Vi (you) now │
╰─────────────────────────────────────────────────────────────────────╯
```

View File

@ -12,9 +12,9 @@ $ git checkout -b alice/1 -q
$ git rev-parse HEAD
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354
$ git checkout master -q
$ rad patch checkout 4895eaa
✓ Switched to branch patch/4895eaa
✓ Branch patch/4895eaa setup to track rad/patches/4895eaa8c751e0cd75ce5ef39c65e0cc05b7235d
$ rad patch checkout d004b67
✓ Switched to branch patch/d004b67
✓ Branch patch/d004b67 setup to track rad/patches/d004b67355456c46de10c0d287e4a791ad1a6945
$ rad remote add z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
✓ Follow policy updated for z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
✓ Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from z6Mkt67…v4N1tRk..
@ -23,19 +23,19 @@ $ rad remote add z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
$ git checkout master -q
$ cat .git/FETCH_HEAD
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 not-for-merge branch 'master' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
8d5f1bae4b69d8e3f6cbfc6f4bd675ed19990afc not-for-merge branch 'patches/4895eaa8c751e0cd75ce5ef39c65e0cc05b7235d' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
8d5f1bae4b69d8e3f6cbfc6f4bd675ed19990afc not-for-merge branch 'patches/d004b67355456c46de10c0d287e4a791ad1a6945' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
$ git rev-parse master
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354
```
``` ~alice (stderr)
$ git checkout patch/4895eaa -q
$ git checkout patch/d004b67 -q
$ git commit --allow-empty -m "Changes #2" -q
$ git push
✓ Patch 4895eaa updated to revision aa9f560826c79344536fae8770687b9d4fbb99cd
✓ Patch d004b67 updated to revision 2eb705c3da98e05c083df15be5b1bd6856a0bd77
✓ Synced with 1 node(s)
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new branch] patch/4895eaa -> patches/4895eaa8c751e0cd75ce5ef39c65e0cc05b7235d
* [new branch] patch/d004b67 -> patches/d004b67355456c46de10c0d287e4a791ad1a6945
```
``` ~bob
@ -47,27 +47,27 @@ $ git push
$ git checkout master -q
$ git pull
From rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji
+ c2aaf1c...8d5f1ba patches/4895eaa8c751e0cd75ce5ef39c65e0cc05b7235d -> rad/patches/4895eaa8c751e0cd75ce5ef39c65e0cc05b7235d (forced update)
+ c2aaf1c...8d5f1ba patches/d004b67355456c46de10c0d287e4a791ad1a6945 -> rad/patches/d004b67355456c46de10c0d287e4a791ad1a6945 (forced update)
$ git checkout - -q
$ git commit --allow-empty -m "Changes #3" -q
$ git push
✓ Patch 4895eaa updated to revision 9f997dc90ecc5e8a0562a81356ed0432fe3bdaf8
✓ Patch d004b67 updated to revision 7b5015a8dac188bb0d44a334aa68a51298750b07
✓ Synced with 1 node(s)
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
c2aaf1c..d9f8caf patch/4895eaa -> patches/4895eaa8c751e0cd75ce5ef39c65e0cc05b7235d
c2aaf1c..d9f8caf patch/d004b67 -> patches/d004b67355456c46de10c0d287e4a791ad1a6945
```
``` ~alice
$ cat .git/FETCH_HEAD
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 branch 'master' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji
8d5f1bae4b69d8e3f6cbfc6f4bd675ed19990afc not-for-merge branch 'patches/4895eaa8c751e0cd75ce5ef39c65e0cc05b7235d' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji
8d5f1bae4b69d8e3f6cbfc6f4bd675ed19990afc not-for-merge branch 'patches/d004b67355456c46de10c0d287e4a791ad1a6945' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji
```
``` ~bob (stderr)
$ git checkout master -q
$ git pull
From rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji
+ c2aaf1c...8d5f1ba patches/4895eaa8c751e0cd75ce5ef39c65e0cc05b7235d -> rad/patches/4895eaa8c751e0cd75ce5ef39c65e0cc05b7235d (forced update)
+ c2aaf1c...8d5f1ba patches/d004b67355456c46de10c0d287e4a791ad1a6945 -> rad/patches/d004b67355456c46de10c0d287e4a791ad1a6945 (forced update)
```
``` ~bob

View File

@ -61,7 +61,7 @@ $ git commit -q -m "Update files"
``` (stderr)
$ git push rad HEAD:refs/patches
✓ Patch 09f4d8b2335190a38d462373f197492ce3e9c3ca opened
✓ Patch 7a2ac7e2841cc1e7394f99f107555a499b1d3f23 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 patch review --patch -U5 09f4d8b2335190a38d462373f197492ce3e9c3ca --no-announce
$ rad patch review --patch -U5 7a2ac7e2841cc1e7394f99f107555a499b1d3f23 --no-announce
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 patch review --patch --accept --hunk 1 09f4d8b2335190a38d462373f197492ce3e9c3ca --no-announce
✓ Loaded existing review ([..]) for patch 09f4d8b2335190a38d462373f197492ce3e9c3ca
$ rad patch review --patch --accept --hunk 1 7a2ac7e2841cc1e7394f99f107555a499b1d3f23 --no-announce
✓ Loaded existing review ([..]) for patch 7a2ac7e2841cc1e7394f99f107555a499b1d3f23
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 7937fb3..0000000
@ -127,8 +127,8 @@ index 7937fb3..0000000
-*.draft
```
```
$ rad patch review --patch --accept --hunk 1 09f4d8b2335190a38d462373f197492ce3e9c3ca --no-announce
✓ Loaded existing review ([..]) for patch 09f4d8b2335190a38d462373f197492ce3e9c3ca
$ rad patch review --patch --accept --hunk 1 7a2ac7e2841cc1e7394f99f107555a499b1d3f23 --no-announce
✓ Loaded existing review ([..]) for patch 7a2ac7e2841cc1e7394f99f107555a499b1d3f23
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 patch review --patch --accept -U3 --hunk 1 09f4d8b2335190a38d462373f197492ce3e9c3ca --no-announce
✓ Loaded existing review ([..]) for patch 09f4d8b2335190a38d462373f197492ce3e9c3ca
$ rad patch review --patch --accept -U3 --hunk 1 7a2ac7e2841cc1e7394f99f107555a499b1d3f23 --no-announce
✓ Loaded existing review ([..]) for patch 7a2ac7e2841cc1e7394f99f107555a499b1d3f23
diff --git a/MENU.txt b/MENU.txt
index 867958c..3af9741 100644
--- a/MENU.txt
@ -153,8 +153,8 @@ index 867958c..3af9741 100644
[..]
```
```
$ rad patch review --patch --accept -U3 --hunk 1 09f4d8b2335190a38d462373f197492ce3e9c3ca --no-announce
✓ Loaded existing review ([..]) for patch 09f4d8b2335190a38d462373f197492ce3e9c3ca
$ rad patch review --patch --accept -U3 --hunk 1 7a2ac7e2841cc1e7394f99f107555a499b1d3f23 --no-announce
✓ Loaded existing review ([..]) for patch 7a2ac7e2841cc1e7394f99f107555a499b1d3f23
diff --git a/MENU.txt b/MENU.txt
index 4e2e828..3af9741 100644
--- a/MENU.txt
@ -169,8 +169,8 @@ index 4e2e828..3af9741 100644
```
```
$ rad patch review --patch --accept --hunk 1 09f4d8b2335190a38d462373f197492ce3e9c3ca --no-announce
✓ Loaded existing review ([..]) for patch 09f4d8b2335190a38d462373f197492ce3e9c3ca
$ rad patch review --patch --accept --hunk 1 7a2ac7e2841cc1e7394f99f107555a499b1d3f23 --no-announce
✓ Loaded existing review ([..]) for patch 7a2ac7e2841cc1e7394f99f107555a499b1d3f23
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 patch review --patch --accept --hunk 1 09f4d8b2335190a38d462373f197492ce3e9c3ca --no-announce
✓ Loaded existing review ([..]) for patch 09f4d8b2335190a38d462373f197492ce3e9c3ca
$ rad patch review --patch --accept --hunk 1 7a2ac7e2841cc1e7394f99f107555a499b1d3f23 --no-announce
✓ Loaded existing review ([..]) for patch 7a2ac7e2841cc1e7394f99f107555a499b1d3f23
✓ All hunks have been reviewed
```

View File

@ -36,9 +36,9 @@ $ rad sync status --sort-by alias
╭─────────────────────────────────────────────────────────────────────────────────────╮
│ ● Node Address Status Tip Timestamp │
├─────────────────────────────────────────────────────────────────────────────────────┤
│ ● alice (you) alice.radicle.xyz:8776 9f615f9 [ ... ] │
│ ● bob z6Mkt67…v4N1tRk bob.radicle.xyz:8776 synced 9f615f9 [ ... ] │
│ ● eve z6Mkux1…nVhib7Z eve.radicle.xyz:8776 synced 9f615f9 [ ... ] │
│ ● alice (you) alice.radicle.xyz:8776 a9ce0d1 [ ... ] │
│ ● bob z6Mkt67…v4N1tRk bob.radicle.xyz:8776 synced a9ce0d1 [ ... ] │
│ ● eve z6Mkux1…nVhib7Z eve.radicle.xyz:8776 synced a9ce0d1 [ ... ] │
╰─────────────────────────────────────────────────────────────────────────────────────╯
```

View File

@ -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 d0609890491d8b1892cb6229155508967418eafd
│ Issue 9037b7a42323d4b79e6a48b7d05d3bbaae11d69b
│ Author bob (you) │
│ Status open │
│ │
@ -22,7 +22,7 @@ $ rad issue list
╭──────────────────────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Labels Assignees Opened │
├──────────────────────────────────────────────────────────────────────────────────────────┤
│ ● d060989 flux capacitor underpowered bob (you) now │
│ ● 9037b7a flux capacitor underpowered bob (you) now │
╰──────────────────────────────────────────────────────────────────────────────────────────╯
```
@ -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 d0609890491d8b1892cb6229155508967418eafd --message 'The flux capacitor needs 1.21 Gigawatts' -q
df9b63af142250fc1d0ee7dc4f82ae23d55d3250
$ rad issue comment 9037b7a42323d4b79e6a48b7d05d3bbaae11d69b --message 'The flux capacitor needs 1.21 Gigawatts' -q
400cb155f512b4880858bb05f935104c34167b28
```

View File

@ -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 a99d55e5958a8c52ff7efbc8ff000d9bbdac79c7 opened
✓ Patch e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46 opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
* [new reference] HEAD -> refs/patches
```
@ -38,12 +38,12 @@ $ rad patch
╭────────────────────────────────────────────────────────────────────────────────╮
│ ● ID Title Author Head + - Updated │
├────────────────────────────────────────────────────────────────────────────────┤
│ ● a99d55e Define power requirements bob (you) 3e674d1 +0 -0 now │
│ ● e4934b6 Define power requirements bob (you) 3e674d1 +0 -0 now │
╰────────────────────────────────────────────────────────────────────────────────╯
$ rad patch show a99d55e5958a8c52ff7efbc8ff000d9bbdac79c7
$ rad patch show e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46
╭────────────────────────────────────────────────────╮
│ Title Define power requirements │
│ Patch a99d55e5958a8c52ff7efbc8ff000d9bbdac79c7
│ Patch e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46
│ 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/a99d55e5958a8c52ff7efbc8ff000d9bbdac79c7
3e674d1a1df90807e934f9ae5da2591dd6848a33 refs/heads/patches/e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46
```
Wait, let's add a README too! Just for fun.
@ -77,15 +77,15 @@ $ 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 a99d55e updated to revision 25e7d77ed913ca07d06253988b73f392071d213d
✓ Patch e4934b6 updated to revision 773b9aab58b11e9fa83d0ed0baca2bea6ff889c9
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
3e674d1..27857ec flux-capacitor-power -> patches/a99d55e5958a8c52ff7efbc8ff000d9bbdac79c7
3e674d1..27857ec flux-capacitor-power -> patches/e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46
```
And let's leave a quick comment for our team:
```
$ rad patch comment a99d55e5958a8c52ff7efbc8ff000d9bbdac79c7 --message 'I cannot wait to get back to the 90s!' -q
8808e8b1d86dc51f5ed5c8b518df197e2c8f2fad
$ rad patch comment e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46 --message 'I cannot wait to get back to the 90s!' -q
8c66f87afadc7c7c857f8bb92973c25f64e75776
✓ Synced with 1 node(s)
```

View File

@ -20,16 +20,16 @@ $ rad inbox --sort-by id
╭────────────────────────────────────────────────────────────────────────────╮
│ heartwood │
├────────────────────────────────────────────────────────────────────────────┤
│ 001 ● d060989 flux capacitor underpowered issue open bob now │
│ 002 ● a99d55e Define power requirements patch open bob now │
│ 001 ● 9037b7a flux capacitor underpowered issue open bob now │
│ 002 ● e4934b6 Define power requirements patch open bob now │
╰────────────────────────────────────────────────────────────────────────────╯
$ git branch -r
bob/patches/a99d55e5958a8c52ff7efbc8ff000d9bbdac79c7
bob/patches/e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46
rad/master
$ rad patch show a99d55e
$ rad patch show e4934b6
╭─────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │
│ Patch a99d55e5958a8c52ff7efbc8ff000d9bbdac79c7
│ Patch e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46
│ Author bob z6Mkt67…v4N1tRk │
│ Head 27857ec9eb04c69cacab516e8bf4b5fd36090f66 │
│ Commits ahead 2, behind 0 │
@ -41,7 +41,7 @@ $ rad patch show a99d55e
│ 3e674d1 Define power requirements │
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by bob z6Mkt67…v4N1tRk (3e674d1) now │
│ ↑ updated to 25e7d77ed913ca07d06253988b73f392071d213d (27857ec) now │
│ ↑ updated to 773b9aab58b11e9fa83d0ed0baca2bea6ff889c9 (27857ec) now │
╰─────────────────────────────────────────────────────────────────────╯
```
@ -51,31 +51,31 @@ way will tell others about the corrections we needed before merging the
changes.
```
$ rad patch checkout a99d55e5958a8c52ff7efbc8ff000d9bbdac79c7
✓ Switched to branch patch/a99d55e
✓ Branch patch/a99d55e setup to track rad/patches/a99d55e5958a8c52ff7efbc8ff000d9bbdac79c7
$ rad patch checkout e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46
✓ Switched to branch patch/e4934b6
✓ Branch patch/e4934b6 setup to track rad/patches/e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46
$ git mv REQUIREMENTS REQUIREMENTS.md
$ git commit -m "Use markdown for requirements"
[patch/a99d55e f567f69] Use markdown for requirements
[patch/e4934b6 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 a99d55e updated to revision d094c1b78f004305b29dee6bd2fe32e2d6945438
✓ Patch e4934b6 updated to revision 9d62420e779e5cfe1dc02c51eddec9a0907aa844
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new branch] patch/a99d55e -> patches/a99d55e5958a8c52ff7efbc8ff000d9bbdac79c7
* [new branch] patch/e4934b6 -> patches/e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46
```
Great, all fixed up, lets accept and merge the code.
```
$ rad patch review a99d55e --revision d094c1b --accept
✓ Patch a99d55e accepted
$ rad patch review e4934b6 --revision 9d62420 --accept
✓ Patch e4934b6 accepted
✓ Synced with 1 node(s)
$ git checkout master
Your branch is up to date with 'rad/master'.
$ git merge patch/a99d55e
$ git merge patch/e4934b6
Updating f2de534..f567f69
Fast-forward
README.md | 0
@ -86,7 +86,7 @@ Fast-forward
```
``` (stderr)
$ git push rad master
✓ Patch a99d55e5958a8c52ff7efbc8ff000d9bbdac79c7 merged at revision d094c1b
✓ Patch e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46 merged at revision 9d62420
✓ Canonical head updated to f567f695d25b4e8fb63b5f5ad2a584529826e908
✓ Synced with 1 node(s)
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
@ -96,10 +96,10 @@ To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkE
The patch is now merged and closed :).
```
$ rad patch show a99d55e
$ rad patch show e4934b6
╭─────────────────────────────────────────────────────────────────────╮
│ Title Define power requirements │
│ Patch a99d55e5958a8c52ff7efbc8ff000d9bbdac79c7
│ Patch e4934b6d9dbe01ce3c7fbb5b77a80d5f1dacdc46
│ Author bob z6Mkt67…v4N1tRk │
│ Head 27857ec9eb04c69cacab516e8bf4b5fd36090f66 │
│ Commits ahead 0, behind 1 │
@ -111,10 +111,10 @@ $ rad patch show a99d55e
│ 3e674d1 Define power requirements │
├─────────────────────────────────────────────────────────────────────┤
│ ● opened by bob z6Mkt67…v4N1tRk (3e674d1) now │
│ ↑ updated to 25e7d77ed913ca07d06253988b73f392071d213d (27857ec) now │
│ * revised by alice (you) in d094c1b (f567f69) now │
│ ↑ updated to 773b9aab58b11e9fa83d0ed0baca2bea6ff889c9 (27857ec) now │
│ * revised by alice (you) in 9d62420 (f567f69) now │
│ └─ ✓ accepted by alice (you) now │
│ └─ ✓ merged by alice (you) at revision d094c1b (f567f69) now │
│ └─ ✓ merged by alice (you) at revision 9d62420 (f567f69) now │
╰─────────────────────────────────────────────────────────────────────╯
```

View File

@ -2053,7 +2053,7 @@ mod routes {
#[tokio::test]
async fn test_projects_issues_create() {
const CREATED_ISSUE_ID: &str = "b2d0999498f98b0d1fa12d859d2d0306380333a0";
const CREATED_ISSUE_ID: &str = "fcd0d5940b55df596cf8079fd1845903f1104bcd";
let tmp = tempfile::tempdir().unwrap();
let ctx = contributor(tmp.path());
@ -2528,7 +2528,7 @@ mod routes {
#[tokio::test]
async fn test_projects_create_patches() {
const CREATED_PATCH_ID: &str = "e21d5b18f8d6c75cfa9c35186b821b1764cb1ab8";
const CREATED_PATCH_ID: &str = "9aabc4055fd811f915c55e9a6ea9f525aa3e88f2";
let tmp = tempfile::tempdir().unwrap();
let ctx = contributor(tmp.path());
@ -2835,7 +2835,7 @@ mod routes {
"reviews": [],
},
{
"id": "46fc3974dac96255e73daf2e1169cd929e713064",
"id": "cccf3b0675220f25b054b6625d84611cb6506d9a",
"author": {
"id": CONTRIBUTOR_DID,
},
@ -3453,7 +3453,7 @@ mod routes {
"timestamp": TIMESTAMP,
"reviews": [
{
"id": "37ed60b8a11949d5db32bce3dd5ab117d3a82841",
"id": "140a44a4eac2cdb74b2f5f95a9dce97847eb9636",
"author": {
"id": CONTRIBUTOR_DID,
},
@ -3461,7 +3461,7 @@ mod routes {
"summary": "A small review",
"comments": [
{
"id": "9aebcd3b27fabb1700427d8ee7b8958b9a50a8f8",
"id": "0dcfca53416761cf975cc4cd6d452790cee06b49",
"author": {
"id": "did:key:z6Mkk7oqY4pPxhMmGEotDYsFo97vhCj85BLY1H256HrJmjN8",
},

View File

@ -32,14 +32,14 @@ pub const HEAD: &str = "e8c676b9e3b42308dc9d218b70faa5408f8e58ca";
pub const PARENT: &str = "ee8d6a29304623a78ebfa5eeed5af674d0e58f83";
pub const INITIAL_COMMIT: &str = "f604ce9fd5b7cc77b7609beda45ea8760bee78f7";
pub const DID: &str = "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi";
pub const ISSUE_ID: &str = "45d118885b6b06360ee539573f5ceb24be2979f8";
pub const ISSUE_DISCUSSION_ID: &str = "d11b03464c9bf58b09460713c8e2c74f0725d3bd";
pub const ISSUE_COMMENT_ID: &str = "e3aa754cb47d2299781fed49cc91c4b41e06c219";
pub const ISSUE_ID: &str = "ca67d195c0b308b51810dedd93157a20764d5db5";
pub const ISSUE_DISCUSSION_ID: &str = "41e2823caa54f1d53e375035ed4aabd0a89fa855";
pub const ISSUE_COMMENT_ID: &str = "e9f963fab82ad875e46b29a327c5d3d51f825cdc";
pub const SESSION_ID: &str = "u9MGAkkfkMOv0uDDB2WeUHBT7HbsO2Dy";
pub const TIMESTAMP: u64 = 1671125284;
pub const CONTRIBUTOR_RID: &str = "rad:z4XaCmN3jLSeiMvW15YTDpNbDHFhG";
pub const CONTRIBUTOR_DID: &str = "did:key:z6Mkk7oqY4pPxhMmGEotDYsFo97vhCj85BLY1H256HrJmjN8";
pub const CONTRIBUTOR_PATCH_ID: &str = "89ddf1bf50a6e98f41372e8d554b4ac8e37e7d36";
pub const CONTRIBUTOR_PATCH_ID: &str = "3e3f0dc34b3eeb64cfbc7218fbd52b97246e0564";
/// Create a new profile.
pub fn profile(home: &Path, seed: [u8; 32]) -> radicle::Profile {

View File

@ -144,7 +144,19 @@ impl store::Cob for Issue {
let mut issue = Issue::new(thread);
for action in actions {
issue.action(action, op.id, op.author, op.timestamp, &[], &doc, repo)?;
match issue.authorization(&action, &op.author, &doc)? {
Authorization::Allow => {
issue.action(action, op.id, op.author, op.timestamp, &[], &doc, repo)?;
}
Authorization::Deny => {
return Err(Error::NotAuthorized(op.author, action));
}
Authorization::Unknown => {
// Note that this shouldn't really happen since there's no concurrency in the
// root operation.
continue;
}
}
}
Ok(issue)
}
@ -736,10 +748,14 @@ where
) -> Result<IssueMut<'a, 'g, R>, Error> {
let (id, issue) = Transaction::initial("Create issue", &mut self.raw, signer, |tx| {
tx.thread(description, embeds)?;
tx.assign(assignees.to_owned())?;
tx.edit(title)?;
tx.label(labels.to_owned())?;
if !assignees.is_empty() {
tx.assign(assignees.to_owned())?;
}
if !labels.is_empty() {
tx.label(labels.to_owned())?;
}
Ok(())
})?;

View File

@ -1132,7 +1132,19 @@ impl store::Cob for Patch {
let mut patch = Patch::new(title, target, (RevisionId(op.id), revision));
for action in actions {
patch.action(action, op.id, op.author, op.timestamp, &[], &doc, repo)?;
match patch.authorization(&action, &op.author, &doc)? {
Authorization::Allow => {
patch.action(action, op.id, op.author, op.timestamp, &[], &doc, repo)?;
}
Authorization::Deny => {
return Err(Error::NotAuthorized(op.author, action));
}
Authorization::Unknown => {
// Note that this shouldn't really happen since there's no concurrency in the
// root operation.
continue;
}
}
}
Ok(patch)
}
@ -2397,8 +2409,10 @@ where
let (id, patch) = Transaction::initial("Create patch", &mut self.raw, signer, |tx| {
tx.revision(description, base, oid)?;
tx.edit(title, target)?;
tx.label(labels.to_owned())?;
if !labels.is_empty() {
tx.label(labels.to_owned())?;
}
if state != Lifecycle::default() {
tx.lifecycle(state)?;
}

View File

@ -596,7 +596,7 @@ mod test {
.unwrap();
let mut db = Store::open(":memory:").unwrap();
let qualified =
qualified!("refs/cobs/xyz.radicle.issue/d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61");
qualified!("refs/cobs/xyz.radicle.issue/d87dcfe8c2b3200e78b128d9b959cfdf7063fefe");
let namespaced = qualified.with_namespace((&nid).into());
let update = RefUpdate::Updated {
name: namespaced.to_ref_string(),
@ -622,7 +622,7 @@ mod test {
update,
kind: NotificationKind::Cob {
type_name: cob::issue::TYPENAME.clone(),
id: "d185ee16a00bac874c0bcbc2a8ad80fdce5e1e61".parse().unwrap(),
id: "d87dcfe8c2b3200e78b128d9b959cfdf7063fefe".parse().unwrap(),
},
status: NotificationStatus::Unread,
timestamp,