Files
heartwood/radicle-cli/examples/rad-patch-diff.md
T
cloudhead 17744a03fd 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.
2024-02-23 12:31:13 +01:00

64 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Using `rad patch diff`, we can output the patch diff:
``` ./README.md
Hello World!
```
```
$ git checkout -b feature/1
$ git add README.md
$ git commit -m "Add README" -q
$ git push rad HEAD:refs/patches
```
```
$ rad patch diff 147309e
╭───────────────────────────╮
│ README.md +1 ❲created❳ │
├───────────────────────────┤
│ @@ -0,0 +1,1 @@ │
│ 1 + Hello World! │
╰───────────────────────────╯
```
If we add another file and update the patch, we can see it in the diff.
``` ./RADICLE.md
Hello Radicle!
```
```
$ git add RADICLE.md
$ git commit --amend -q
$ git push -f
```
```
$ rad patch diff 147309e
╭─────────────────────────────╮
│ RADICLE.md +1 ❲created❳ │
├─────────────────────────────┤
│ @@ -0,0 +1,1 @@ │
│ 1 + Hello Radicle! │
╰─────────────────────────────╯
╭─────────────────────────────╮
│ README.md +1 ❲created❳ │
├─────────────────────────────┤
│ @@ -0,0 +1,1 @@ │
│ 1 + Hello World! │
╰─────────────────────────────╯
```
Buf if we only want to see the changes from the first revision, we can do that
too.
```
$ rad patch diff 147309e --revision 147309e
╭───────────────────────────╮
│ README.md +1 ❲created❳ │
├───────────────────────────┤
│ @@ -0,0 +1,1 @@ │
│ 1 + Hello World! │
╰───────────────────────────╯
```