mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-03 18:30:32 +08:00
The output of this command is confusing. It is not clear which of the
hashes printed is that of the revision and which one is the respective
head commit.
Further, the hash is omitted on the initial revision, adding confusion.
Further, the terminology of "revised" vs. "updated" is confusing.
This rewrites `timeline.rs` to drop the distinction between various
revisions (in wording, the small icon is still different) and cleans up
the output.
Attention is paid to alignment of the output. Now all verbs of updates
("accepted", "rejected", "reviewed", "merged") are aligned, and authors
("… by …") are also aligned.
The rewrite itself is not for better code quality or readability.
Note that all the code in this file only accessed via one `fn` by one
callsite in the implementation of `rad patch`.
3.6 KiB
3.6 KiB
Let's explore the rad patch update plumbing command. First we create a patch:
$ git checkout -q -b feature/1
$ git commit -q -m "Not a real change" --allow-empty
$ git push rad HEAD:refs/patches
✓ Patch b6a23eb08656de0ef1fcc0b5fe8820841e5cb2e5 opened
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
* [new reference] HEAD -> refs/patches
$ rad patch show b6a23eb08656de0ef1fcc0b5fe8820841e5cb2e5
╭────────────────────────────────────────────────────╮
│ Title Not a real change │
│ Patch b6a23eb08656de0ef1fcc0b5fe8820841e5cb2e5 │
│ Author alice (you) │
│ Head 51b2f0f77b9849bfaa3e9d3ff68ee2f57771d20c │
│ Base [.. ] │
│ Branches feature/1 │
│ Commits ahead 1, behind 0 │
│ Status open │
├────────────────────────────────────────────────────┤
│ 51b2f0f Not a real change │
├────────────────────────────────────────────────────┤
│ ● Revision b6a23eb @ 51b2f0f by alice (you) now │
╰────────────────────────────────────────────────────╯
We can make some changes to the repository:
$ git mv README README.md
$ git commit -q -m "Rename readme file"
Let's push the changes, but not to the magic ref, that way the push doesn't update our patch:
$ git push rad HEAD:refs/heads/feature/1
Now, instead of using git push to update the patch, as we normally would,
we run:
$ 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 b6a23eb08656de0ef1fcc0b5fe8820841e5cb2e5
╭────────────────────────────────────────────────────╮
│ Title Not a real change │
│ Patch b6a23eb08656de0ef1fcc0b5fe8820841e5cb2e5 │
│ Author alice (you) │
│ Head 4d272148458a17620541555b1f0905c01658aa9f │
│ Base [.. ] │
│ Branches feature/1 │
│ Commits ahead 2, behind 0 │
│ Status open │
├────────────────────────────────────────────────────┤
│ 4d27214 Rename readme file │
│ 51b2f0f Not a real change │
├────────────────────────────────────────────────────┤
│ ● Revision b6a23eb @ 51b2f0f by alice (you) now │
│ ↑ Revision ea7def3 @ 4d27214 by alice (you) now │
╰────────────────────────────────────────────────────╯