seachicken / gh-poi

✨ Safely clean up your local branches
https://dev.to/seachicken/safely-clean-up-your-local-branches-9i3
MIT License
642 stars 17 forks source link

Delete branches that belong to closed PRs. #119

Open electriquo opened 7 months ago

electriquo commented 7 months ago

Description Would love to see poi delete local branches that belong to closed PRs.

seachicken commented 7 months ago

Hi, thank you for your suggestions. It might be good. Currently, this tool focuses on the "clean up safely." If we have a closed PR, something wrong created the PR, and closing, this branch may be in the works and should be retained. Can you tell me about the situation of wanting to delete closed PRs?

electriquo commented 7 months ago

poi is invoked by the user and the user should always use -dry-run when the user is unsure what will be deleted.

Can you tell me about the situation of wanting to delete closed PRs?

Github has many working models. An organization might rollout a policy where it forbids forks and requires a pull-request. In such case, each pull-request is associated with a branch. When a pull-request is closed, the user might wish to invoke poi to clean these branches.

To guarantee non-breaking change, consider adding a flag such as -del-closed

seachicken commented 7 months ago

Yes, it's good to be able to delete it as an option! If you want to add functionality, we also welcome PR submitted.

electriquo commented 7 months ago

@seachicken If I knew Go lang, I would have already made a PR ;)