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

Branch-name autocompletion and selection #3

Open
2 tasks
obensource opened this issue Jan 30, 2018 · 0 comments
Open
2 tasks

Branch-name autocompletion and selection #3

obensource opened this issue Jan 30, 2018 · 0 comments

Comments

@obensource
Copy link
Owner

obensource commented Jan 30, 2018

Let's implement branch-name autocompletion and selection!

Description

A common git shortcut is to hit <tab> after typing the checkout command and a few characters of a branch name (eg. $git checkout awe + <tab>). This returns a list of all branches that begin with those characters (eg. aweseome-branch-1, awesome-branch-2, ...).

Requirements

I'd like to see the following shortcuts implemented:

  • $checkout + /^[a-zA-Z0-9_.-]*$/ + <tab>
  • $checkout + /^[a-zA-Z0-9_.-]*$/ + <tab><tab>

Possible Solution

This would take any number of acceptable characters after checkout, and check to see if they're included in any names within the list of local branch names.

  • If there's only one match: autocomplete the branch name upon the <tab> keystroke. When the user hits <return>, the checkout confirmation prompt runs (and checks out that branch).
  • If there are multiple matches, the user should hit <tab> again to be able to see them listed in the console, and is then presented with a prompt–asking if they'd like to checkout any of the logged branches (followed by a selection list).
  • This should also handle the standard git use of the bash asterisk wildcard, and be able to match branch names with any number of acceptable characters followed by *.
    • eg. $checkout awe* + <tab> logs any number of awesomely named branches (& runs a prompt), but autocompletes the branch name if there's only one match.
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

No branches or pull requests

1 participant