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

Adds support for shorthand force-push syntax #174

Merged
merged 1 commit into from
Jan 4, 2017

Conversation

dan-turner
Copy link
Contributor

Git supports a short-hand syntax for force-pushing a branch to a remote by including the "+" modifier before the branch name. However when doing so, Posh-git was no longer able to auto-complete the branch name as it did not understand this syntax. This PR adds that support.

Closes #173

Git supports a short-hand syntax for force-pushing a branch to a remote by including the "+" modifier before the branch name. However when doing so, Posh-git was no longer able to auto-complete the branch name as it did not understand this syntax.  This PR adds that support.

Closes dahlbyk#173
@dan-turner
Copy link
Contributor Author

Any chance of this making it in @dahlbyk?

@@ -223,6 +223,11 @@ function GitTabExpansion($lastBlock) {
"^push.* (?<remote>\S+) (?<ref>[^\s\:]*\:)(?<branch>\S*)$" {
gitRemoteBranches $matches['remote'] $matches['ref'] $matches['branch']
}

# Handles git push remote +<branch> (force push)
"^push.* (?<remote>\S+) (?<ref>\+)(?<branch>\S*)$" {
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think this is quite what we want... This will capture the + in the ref group and try matching remote branches based on that.

I think it would be sufficient to add \+? above/below before we capture <ref>:<branch> or just <branch> - give that a try?

@dahlbyk
Copy link
Owner

dahlbyk commented May 14, 2015

So sorry for the delay in looking at this, @dan-turner. I appreciate you looping back around to bump it, as this is definitely something we should support.

@dahlbyk dahlbyk merged commit 8557a31 into dahlbyk:master Jan 4, 2017
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.

Feat: Support additional short-hand modifiers in branch auto-complete
2 participants