pico
created pr with
117.1
cmds
checkout latest patchset:
ssh pr.pico.sh print 117 | git am -3checkout any patchset in a patch request:
ssh pr.pico.sh print 117.[rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 117
Patchset
117.1
refactor: `--comment` flag is now a bool that reads from stdin for comment
Eric Bower
2026-02-26T01:31:10ZReplaced `--comment` flag which was a string into a bool and now require comment to be provided by stdin for commands `accept`, `close`, and `reopen`. `echo "lgtm!" | ssh pr.pico.sh pr accept --comment 100` If no `--comment` flag provided then you don't need to provide stdin.
Semantic diff summary
0 added,
7 modified,
0 signature changed,
0 removed
across 2 analyzed files
(1 file skipped: unsupported file type)
+9
-2
CHANGELOG.md
#
| ... | ... | @@ -6,11 +6,18 @@ Use spec: https://common-changelog.org/ | |
| 6 | 6 | ||
| 7 | 7 | ### Changed | |
| 8 | 8 | ||
| 9 | - | - Upgraded to `go1.25` | |
| 10 | - | - Removed charm's `wish` with pico's `pssh` | |
| 9 | + | ## v2026-02-25 | |
| 10 | + | ||
| 11 | + | ### Changed | |
| 12 | + | ||
| 13 | + | - Replaced `--comment` flag which was a string into a bool and now require comment to be provided by stdin for commands `accept`, `close`, and `reopen` | |
| 14 | + | - `echo "lgtm!" | ssh pr.pico.sh pr accept --comment 100` | |
| 15 | + | - If no `--comment` flag provided then you don't need to provide stdin | |
| 11 | 16 | ||
| 12 | 17 | ## v2026-02-24 | |
| 13 | 18 | ||
| 14 | 19 | ### Changed | |
| 15 | 20 | ||
| 16 | 21 | - Added `ssh {username}@pr register` command and now require explicit registration to use this service | |
| 22 | + | - Upgraded to `go1.25` | |
| 23 | + | - Removed charm's `wish` with pico's `pssh` |
+35
-9
cli.go
#
| ... | ... | @@ -621,9 +621,9 @@ To get started, submit a new patch request: | |
| 621 | 621 | Args: true, | |
| 622 | 622 | ArgsUsage: "[prID], [prID]...", | |
| 623 | 623 | Flags: []cli.Flag{ | |
| 624 | - | &cli.StringFlag{ | |
| 624 | + | &cli.BoolFlag{ | |
| 625 | 625 | Name: "comment", | |
| 626 | - | Usage: "add a comment to the patchset(s)", | |
| 626 | + | Usage: "If this flag is provided, pass comment through stdin", | |
| 627 | 627 | }, | |
| 628 | 628 | }, | |
| 629 | 629 | Action: func(cCtx *cli.Context) error { |
| ... | ... | @@ -667,7 +667,16 @@ To get started, submit a new patch request: | |
| 667 | 667 | return fmt.Errorf("PR has already been accepted") | |
| 668 | 668 | } | |
| 669 | 669 | ||
| 670 | - | err = pr.UpdatePatchRequestStatus(prID, user.ID, StatusAccepted, cCtx.String("comment")) | |
| 670 | + | comment := cCtx.Bool("comment") | |
| 671 | + | var commentTxt []byte | |
| 672 | + | if comment { | |
| 673 | + | commentTxt, err = io.ReadAll(sesh) | |
| 674 | + | if err != nil { | |
| 675 | + | return fmt.Errorf("when comment flag enabled must provide it from stdin") | |
| 676 | + | } | |
| 677 | + | } | |
| 678 | + | ||
| 679 | + | err = pr.UpdatePatchRequestStatus(prID, user.ID, StatusAccepted, string(commentTxt)) | |
| 671 | 680 | if err != nil { | |
| 672 | 681 | return err | |
| 673 | 682 | } |
| ... | ... | @@ -688,9 +697,9 @@ To get started, submit a new patch request: | |
| 688 | 697 | Args: true, | |
| 689 | 698 | ArgsUsage: "[prID], [prID]...", | |
| 690 | 699 | Flags: []cli.Flag{ | |
| 691 | - | &cli.StringFlag{ | |
| 700 | + | &cli.BoolFlag{ | |
| 692 | 701 | Name: "comment", | |
| 693 | - | Usage: "add a comment to the patchset(s)", | |
| 702 | + | Usage: "If this flag is provided, pass comment through stdin", | |
| 694 | 703 | }, | |
| 695 | 704 | }, | |
| 696 | 705 | Action: func(cCtx *cli.Context) error { |
| ... | ... | @@ -739,7 +748,16 @@ To get started, submit a new patch request: | |
| 739 | 748 | return errNotExist(be.Cfg.Host, pubkey) | |
| 740 | 749 | } | |
| 741 | 750 | ||
| 742 | - | err = pr.UpdatePatchRequestStatus(prID, user.ID, StatusClosed, cCtx.String("comment")) | |
| 751 | + | comment := cCtx.Bool("comment") | |
| 752 | + | var commentTxt []byte | |
| 753 | + | if comment { | |
| 754 | + | commentTxt, err = io.ReadAll(sesh) | |
| 755 | + | if err != nil { | |
| 756 | + | return fmt.Errorf("when comment flag enabled must provide it from stdin") | |
| 757 | + | } | |
| 758 | + | } | |
| 759 | + | ||
| 760 | + | err = pr.UpdatePatchRequestStatus(prID, user.ID, StatusClosed, string(commentTxt)) | |
| 743 | 761 | if err != nil { | |
| 744 | 762 | return err | |
| 745 | 763 | } |
| ... | ... | @@ -759,9 +777,9 @@ To get started, submit a new patch request: | |
| 759 | 777 | Args: true, | |
| 760 | 778 | ArgsUsage: "[prID]", | |
| 761 | 779 | Flags: []cli.Flag{ | |
| 762 | - | &cli.StringFlag{ | |
| 780 | + | &cli.BoolFlag{ | |
| 763 | 781 | Name: "comment", | |
| 764 | - | Usage: "add a comment to the patchset", | |
| 782 | + | Usage: "If this flag is provided, pass comment through stdin", | |
| 765 | 783 | }, | |
| 766 | 784 | }, | |
| 767 | 785 | Action: func(cCtx *cli.Context) error { |
| ... | ... | @@ -804,7 +822,15 @@ To get started, submit a new patch request: | |
| 804 | 822 | return errNotExist(be.Cfg.Host, pubkey) | |
| 805 | 823 | } | |
| 806 | 824 | ||
| 807 | - | err = pr.UpdatePatchRequestStatus(prID, user.ID, StatusOpen, cCtx.String("comment")) | |
| 825 | + | comment := cCtx.Bool("comment") | |
| 826 | + | var commentTxt []byte | |
| 827 | + | if comment { | |
| 828 | + | commentTxt, err = io.ReadAll(sesh) | |
| 829 | + | if err != nil { | |
| 830 | + | return fmt.Errorf("when comment flag enabled must provide it from stdin") | |
| 831 | + | } | |
| 832 | + | } | |
| 833 | + | err = pr.UpdatePatchRequestStatus(prID, user.ID, StatusOpen, string(commentTxt)) | |
| 808 | 834 | if err == nil { | |
| 809 | 835 | sesh.Printf("Reopened PR %s (#%d)\n", prq.Name, prq.ID) | |
| 810 | 836 | } |
+1
-1
e2e_test.go
#
| ... | ... | @@ -121,7 +121,7 @@ func testMultiTenantE2E(t *testing.T) { | |
| 121 | 121 | t.Log("Create pr with admin repo and user can accept with comment") | |
| 122 | 122 | suite.adminKey.MustCmd(nil, "repo create ai") | |
| 123 | 123 | suite.userKey.MustCmd(suite.patch, "pr create admin/ai") | |
| 124 | - | suite.adminKey.MustCmd(suite.otherPatch, "pr accept --comment 'nice work' 9") | |
| 124 | + | suite.adminKey.MustCmd([]byte("nice work"), "pr accept --comment 9") | |
| 125 | 125 | ||
| 126 | 126 | t.Log("Create pr with default `bin` repo") | |
| 127 | 127 | actual, err := suite.userKey.Cmd(suite.patch, "pr create") |