Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete branches on remote which are not ahead of main #14

Open
shivendra14 opened this issue Sep 15, 2022 · 1 comment
Open

Delete branches on remote which are not ahead of main #14

shivendra14 opened this issue Sep 15, 2022 · 1 comment

Comments

@shivendra14
Copy link

It will help to enhance the script to provide a way to delete extra brnaches on remote which are not ahead of any other specidfied branch or main. It will help reduce useless old brnahes in repo

@bill-auger
Copy link
Owner

bill-auger commented Sep 15, 2022

something like this has been suggested before - this is essentially a duplicate of #12 - it is implemented on the development branch now, as the -c/--cleanup option - please try it, review the code, and give your opinions

if that is not exactly what you were proposing, i suspect that is because your description is local-centric - local replicas are never expected to be authoritative - the canonical branches are normally on one (or more) servers, not on anyone's local system - so to be most correct, it may be prudent to also add a per-repo data array to specify exactly which host+branch pair is the canonical/stable one, against which to decide such "branches which are not ahead" - the canonical host+branch can not be inferred; because that is usually not any local branch, it is not necessarily the tracked remote branch of any local branch, and different projects use different names for it

its not obvious that a new per-repo data array is the right thing to do though; because it is not necessarily a single canonical branch which would always be used as the compare base - one can easily imagine the same maintenance task, whenever multiple people are contributing to the same feature branch - some projects keep no single canonical branch, but prefer a collection of stable per-release branches

without a new array of canonical per-repo branch designations, one would always need to specify the compare branch on the command line; so the -c/--cleanup option was initially implemented for that general usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants