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

Add a $branch variable to tab completion #353

Merged
merged 4 commits into from
Mar 2, 2019

Conversation

georgebrock
Copy link
Collaborator

Fixes #352

The tab completion DSL had a $revision variable which produces branch names, tag names, etc. In some contexts it's too general, e.g. branch -D accepts a branch name but not a tag. In those contexts we were using $anything to avoid producing invalid tab completion options.

This PR introduces a more specific $branch variable that can be used when we want to only tab complete branch names.

A $revision is more appropriate here than $anything.
The Gitsh::TabCompletion::RevisionMatcher class was ignoring some patterns
that are followed by other matcher classes. This commit makes it more
consistent with the others.
spec/units/git_repository_spec.rb Outdated Show resolved Hide resolved
spec/units/git_repository_spec.rb Outdated Show resolved Hide resolved
lib/gitsh/git_repository.rb Outdated Show resolved Hide resolved
spec/units/git_repository_spec.rb Outdated Show resolved Hide resolved
spec/units/git_repository_spec.rb Outdated Show resolved Hide resolved
lib/gitsh/git_repository.rb Outdated Show resolved Hide resolved
@georgebrock
Copy link
Collaborator Author

Checks off one of the items on #314

Copy link
Contributor

@sharplet sharplet left a comment

Choose a reason for hiding this comment

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

🦘

The $branch matchers produces branch names, and can be used in places where
the $revision matcher is too permissive, e.g. `branch -d` only accepts a
branch name, not a tag name etc.
@georgebrock georgebrock merged commit 0e118a0 into master Mar 2, 2019
@georgebrock georgebrock deleted the tab-completion-matchers branch March 2, 2019 16:53
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.

None yet

3 participants