bobthecow / git-flow-completion

Bash, Zsh and fish completion support for git-flow.
MIT License
2.79k stars 385 forks source link

completion not working with git alias #14

Closed clavelm closed 11 years ago

clavelm commented 12 years ago

Hello, I'm using git on windows : version : 1.7.6.msysgit.0 windows xp sp3

I managed to install git-flow-completion in the bash by putting the file to my home directory and editing .bashrc

When I use the auto completion with "git flow feature finish" + tab, it's working (ther with only 2 features opened : toto and tata) : $ git flow feature finish t tata toto

I defined alias in .gitconfig : ffs = flow feature start fff = flow feature finish

When I use the autocompletion with the alias, here is what happens : $ git fff feature help hotfix init release version

I have the same result as when using git flow + tab : $ git flow feature help hotfix init release version

If you need more info on my config, just ask.

Regards,

Mathieu

clavelm commented 12 years ago

If that problem is only on Windows, it can be interesting to know. Does anyone use git flow completion with alias and it's working ? Thanks,

Mathieu

alexslade commented 12 years ago

I have an alias on Mac ('f' = 'git flow') and flow-completion doesn't work.

tarmolov commented 12 years ago

I have some problem, too (on mac). So I'm looking forward to solving this issue :)

bobthecow commented 12 years ago

@heeton @tarmolov If I understand correctly, you're using Bash aliases (e.g. alias f="git flow")?

If this is the case, your problem is a limitation with the default git completion.

alias r="git remote"

won't tab complete git-remote subcommands either. Since git-flow bash completion can only extend the existing git bash completion, there's not much we can do about that.

@clavelm Interesting. Any ideas how to solve it? :)

clavelm commented 12 years ago

My problem isn't with bash alias completion, but with git alias completion. Completion is working with git commands on my system. I have aliased b for branch and when I write : git b + completion is working.

But with my alias "fff = flow feature finish" , "git fff + " give me the same completion as "git flow + " instead of "git flow feature finish + "

I'm having problem with git stash completion on my system link, and it seems it's coming from the bash version.

I have no idea how to solve that problem. I'm not really sure I'm not the only one to have this problem as nobody was answering.

Mathieu

tarmolov commented 12 years ago

I as @clavelm use git aliases for git-flow.

For instance

fo = flow feature checkout
fs = flow feature start
fs = flow feature finish

So git fo <tab> doesn't work for me. Unfortunately, I have no idea how to fix it :(

bobthecow commented 12 years ago

@clavelm It is a problem with git bash completion. It gets confused when the number of words on the line are different. For example:

publish = push -u origin

will try to autocomplete "origin" (the only possible completion for git push) instead of completing branch names, as if you had entered git push -u origin.

So as long as your aliases replace the same number of arguments, it'll keep working. In your case, it won't.

tarmolov commented 12 years ago

Do you know some workaround for creating short aliases? git flow feature checkout - really really long way to achieve my feature.

pixelastic commented 11 years ago

@tarmolov You can try using bash/zsh alias instead of git one to workaround this issue. I myself am using aliases like gffs or gfff for git flow feature start and git flow feature finish in zsh and their autocompletion works perfectly.

bobthecow commented 11 years ago

I'm closing this issue as it's (unfortunately) not possible to resolve this from our end.