repos / git-pr

a self-hosted git collaboration server
git clone https://github.com/picosh/git-pr.git

commit
13ca134
parent
29e9d14
author
jolheiser
date
2024-07-16 21:34:21 -0400 EDT
feat: list only your own PRs

Signed-off-by: jolheiser <git@jolheiser.com>
1 files changed,  +9, -0
M cli.go
M cli.go
+9, -0
 1@@ -185,6 +185,10 @@ Here's how it works:
 2 								Name:  "reviewed",
 3 								Usage: "only show reviewed PRs",
 4 							},
 5+							&cli.BoolFlag{
 6+								Name:  "mine",
 7+								Usage: "only show your own PRs",
 8+							},
 9 						},
10 						Action: func(cCtx *cli.Context) error {
11 							repoID := cCtx.Args().First()
12@@ -203,6 +207,7 @@ Here's how it works:
13 							onlyAccepted := cCtx.Bool("accepted")
14 							onlyClosed := cCtx.Bool("closed")
15 							onlyReviewed := cCtx.Bool("reviewed")
16+							onlyMine := cCtx.Bool("mine")
17 
18 							writer := NewTabWriter(sesh)
19 							fmt.Fprintln(writer, "ID\tRepoID\tName\tStatus\tUser\tDate")
20@@ -229,6 +234,10 @@ Here's how it works:
21 									continue
22 								}
23 
24+								if onlyMine && user.Name != userName {
25+									continue
26+								}
27+
28 								fmt.Fprintf(
29 									writer,
30 									"%d\t%s\t%s\t[%s]\t%s\t%s\n",