Skip to content

Conversation

@jmaroeder
Copy link
Contributor

I've found that the existing git cherry method of detecting branches that have been squash-merged doesn't always work.

I'm not entirely sure what causes this - I think it might have to do with when another contributor has pushed commits to a branch, which I didn't get on my local machine before the branch was squash-merged and then deleted on the remote.

I have found that these branches will show up with the [gone] tag in the remote status field.

This PR adds a --gone/-g flag that will include these branches for deletion by gbda. It is not enabled by default since there are some legitimate reasons for wanting to avoid these being deleted from the local machine, such as another user deleting a branch from a remote when the local user wasn't ready to have it be deleted.

This also adds a helper function __git.delete_branches to delete one or more branches from a list of args, rather than rely on xargs to perform this task.

Note that a branch will not show up as [gone] if it isn't already tracking a remote.

Copy link
Owner

@jhillyerd jhillyerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this out, works well for me.

Could you update the gbda entry in the README? otherwise it's not easy to discover this feature

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants