Open braydie opened 7 years ago
I'm able to get this to work using git-complete.bash on bit bash on Windows
Meaning it already works out-of-the-box? Or you had to extend it in some way?
Is it possible to extend posh-git to handle tab completion for an alias like the above?
We could certainly add an extension point, or maybe even teach posh-git to handle basic compound aliases like yours (split on &&
and look for $1
?
Hey @dahlbyk - sorry I meant to say that I got autocomplete working on git bash following these steps. I believe that is a bash only thing, and wouldn't impact PowerShell (I'm guessing though).
I have a workaround at the moment using https://github.com/dahlbyk/posh-git/issues/257 -- I've added my aliases in to GitTabExpansion.ps1
which replaces my alias for git checkout
for tab completion purposes
sorry I meant to say that I got autocomplete working on git bash following these steps. I believe that is a bash only thing, and wouldn't impact PowerShell (I'm guessing though).
Correct. posh-git is essentially an incomplete port of that completion (plus other stuff). As far as I can tell, its alias expansion is handled here. It looks like for your alias it's going to offer completion options for git checkout
even though the value will actually be used with merge
, but there's a way to use the null command :
to specify what command's completion should be shown.
I'm certainly open to posh-git being smarter about parsing these Git aliases.
It would be easier to only pick up aliases right? For example I simply alias git.exe
to g
. This is IMO already an improvement.
Hi, has there been any work on this since?
I have a complex
git alias
that I'd like to have tab completion on to fill branch names. The command is as follows:$1
should be a branch name. I'm able to get this to work using git-complete.bash on bit bash on WindowsIs it possible to extend posh-git to handle tab completion for an alias like the above?