cli: Add rad patch set command

Sets the current branch's upstream to point to the given patch.
This allows for pushes to update the patch.

When opening a patch, if the current branch already has an upstream,
it isn't updated automatically. This is why this command exists.
This commit is contained in:
cloudhead
2023-09-06 20:03:58 +02:00
parent 579ddfe725
commit 287a920d12
5 changed files with 34 additions and 3 deletions
+11
View File
@@ -22,6 +22,7 @@ rad-patch - Manage radicle patches.
*rad patch* _redact_ <revision-id> [<option>...] +
*rad patch* _ready_ <patch-id> [--undo] [<option>...] +
*rad patch* _edit_ <patch-id> [<option>...] +
*rad patch* _set_ <patch-id> [<option>...] +
== Description
@@ -79,6 +80,13 @@ to *open*.
*--undo*:: Change a patch back to *draft*
=== set
Set the current branch upstream to a patch reference. This configures your
branch such that pushing will update the specified patch.
*<patch-id>*:: The patch to set this branch's upstream to
=== update
Updates a patch to the current repository *HEAD*. This is a low-level command
@@ -166,6 +174,9 @@ upstream set. In the above example, we used the *--force* option, since the
commit was amended. This is common practice when a patch has been reworked
after receiving a review.
If the branch upstream is not set to the patch reference, ie. *rad/patches/<id>*,
you can do so using `rad patch set <id>`.
As with opening a patch, you will be asked to enter a reason for updating the
patch, via your editor. Simply save and exit when you're done; or leave it
blank to skip this step.