You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Let's implement branch-name autocompletion and selection!
Description
A common git shortcut is to hit
<tab>
after typing thecheckout
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.<tab>
keystroke. When the user hits<return>
, the checkout confirmation prompt runs (and checks out that branch).<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).*
.checkout awe*
+<tab>
logs any number ofawe
somely named branches (& runs a prompt), but autocompletes the branch name if there's only one match.The text was updated successfully, but these errors were encountered: