mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-10-26 14:50:36 +08:00
Previously, COB change commits would not distinguish between their parents. This means that they would try to load source code commits (eg. for patch COBs) and then fail since those commits wouldn't have a manifest or `Rad-Resource`. We introduce a backwards compatible change here which is that parent oids that are not COB commits are accompanied by a commit trailer called `Rad-Related`. This is for all related content that should be pulled in but is not part of the change graph proper. When building the change graph, we simply ignore commits that are marked as "related".
64 lines
2.1 KiB
Markdown
64 lines
2.1 KiB
Markdown
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 b1fbd2c
|
||
╭───────────────────────────╮
|
||
│ 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 b1fbd2c
|
||
╭─────────────────────────────╮
|
||
│ 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 b1fbd2c --revision b1fbd2c
|
||
╭───────────────────────────╮
|
||
│ README.md +1 ❲created❳ │
|
||
├───────────────────────────┤
|
||
│ @@ -0,0 +1,1 @@ │
|
||
│ 1 + Hello World! │
|
||
╰───────────────────────────╯
|
||
|
||
```
|