Skip to content

Conversation

@johnpyp
Copy link
Contributor

@johnpyp johnpyp commented Dec 15, 2025

This PR improves git delete-branch bash and zsh completions by making them each accept multiple unique branch names.

The __gitex_branch_names_unique is identical to __gitex_branch_names (and corresponding in bash) except that:

  • The added -F flag in zsh and the for loop in bash make it so that if a branch was already specified in the argument list, it doesn't get specified again.
  • The COMPWORDS[@]:2 and ${words[2,-1]} stuff is there to make it so that the code doesn't include the delete-branch argument as one of the already deleted branches, which accounts for the admittedly very unlikely edgecase that delete-branch itself is a branch

Copy link
Collaborator

@hyperupcall hyperupcall left a comment

Choose a reason for hiding this comment

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

Thanks!

@hyperupcall hyperupcall merged commit 6f4cf0c into tj:main Dec 18, 2025
6 checks passed
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.

3 participants