Open riotrah opened 2 weeks ago
Thank you for the good suggestion 😄 I sometimes want to delete "closed," too and I think it would be better to have the option to delete it since we can check it with a dry run.
The main thing to consider is what to do with the interface of the options.
Since this tool is a command that starts with "gh," we place importance on affinity with the gh interface so that users can operate it intuitively. Since exclusion with --no-xxx
probably falls outside this policy, how about adding targets like gh pr list?
gh poi --state closed
(currently gh seems to include closed and merged https://github.com/cli/cli/issues/8102)
merged
gh poi --draft
However, if they only want to delete closed PRs, they can still do gh poi --closed --no-merged.
There are very few cases where you would want to delete only closed PRs, so it is better to start by only allowing the deletion of merged and closed PRs.
Description Hi!
Great extension.
I was thinking about my own usage of this tool, plus #119, and thought about the following more general proposal to choice in deletion:
poi
offers a couple new flags:--closed
/--no-closed
--merged
/--no-merged
--draft
/--no-draft
gh poi --closed --merged
--merged
is defaultedOr, slight alternative:
--merged
is always true, thus no need for--merged
flag, so if the user runsgh poi --closed
, it will delete both merged and closed PRs. However, if they only want to delete closed PRs, they can still dogh poi --closed --no-merged
.Additional context
When would you use
poi
to delete other than merged branches? Isn't that the whole point? I thinkpoi
has nice output, branch protection,--dry-run
feature and convenient access withgh
, so it has value even if only deleting closed/draft, as the alternative of manual deletion is worse and lacks the above features/protections, and I don't think it would be too hard to add such flags (as far as I can tell, correct me if I'm wrong!)