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

Allow wildcard matching for "branches" command #258

Merged
merged 1 commit into from
Sep 26, 2019

Conversation

grahamu
Copy link
Collaborator

@grahamu grahamu commented Sep 25, 2019

This update adds branch name wildcard pattern matching to the "branches" command.
The use case is when a repository has many active branches and you just want to see branches matching a particular naming pattern.

The branch name wildcard patterns follow Unix filename pattern matching standards (from documentation for fnmatch):

Pattern Meaning
* matches everything
? matches any single character
[seq] matches any character in seq
[!seq] matches any character not in seq

For a literal match, wrap the meta-characters in brackets. For example, '[?]' matches the character '?'.

Examples

branches without wildcard:

$ git branches
   develop               (published)
*  gu-branches-wildcard  (published)
   master                (published)

branches with wildcard:

$ git branches gu*
*  gu-branches-wildcard  (published)

@grahamu
Copy link
Collaborator Author

grahamu commented Sep 25, 2019

@frostming thanks for your consideration of this improvement to legit!

@frostming frostming merged commit 697f4b4 into master Sep 26, 2019
@frostming frostming deleted the gu-branches-wildcard branch September 26, 2019 10:30
@grahamu
Copy link
Collaborator Author

grahamu commented Sep 27, 2019

Thanks so much for the merge @frostming! I look forward to a new 1.1.0 legit package published on PyPi soon!

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

Successfully merging this pull request may close these issues.

2 participants