bobthecow / git-flow-completion

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

Bash script not working #2

Closed crayment closed 13 years ago

crayment commented 13 years ago

I can't get the bash script to work.

git flow fea[tab] does nothing.

It will complete the word flow but that's about it. I see there have been fixes and updates going down for the zsh completion. Chances of us getting updates for the bash version?

Possibly relevant: http://github.com/nvie/git-flow-completion/commit/4b64eccd50fd34391df1833023cb30b125c9e9bd

bobthecow commented 13 years ago

It works. This is most likely an issue on your box. The ZSH commits were just that side catching up with the bash script :)

  1. What versions of git and git-flow are you using?
    • git --version
    • git flow version
  2. If you type _git[tab][tab] what do you see? Is _git_flow in that list?
  3. How about if you run _git_flow? Do you see something complaining about a unary operator?
crayment commented 13 years ago
crayment@Amy:~/dev/dotfiles(master)$git --version
git version 1.7.2.1
crayment@Amy:~/dev/dotfiles(master)$git flow version
0.4-dev
crayment@Amy:~/dev/dotfiles(master)$_git
_git               _git_bisect        _git_cherry        _git_describe      _git_flow          _git_ls_remote     _git_name_rev      _git_remote        _git_stash
_git_add           _git_branch        _git_cherry_pick   _git_diff          _git_format_patch  _git_ls_tree       _git_pull          _git_reset         _git_submodule
_git_am            _git_bundle        _git_commit        _git_diff_tree     _git_gc            _git_merge         _git_push          _git_shortlog      _git_tag
_git_apply         _git_checkout      _git_config        _git_fetch         _git_log           _git_merge_base    _git_rebase        _git_show          _gitk
crayment@Amy:~/dev/dotfiles(master)$__git
__git_aliased_command            __git_find_subcommand            __git_flow_list_releases         __git_ps1                        __git_tags
__git_aliases                    __git_flow_feature               __git_flow_list_remote_features  __git_refs                       __gitcomp
__git_commands                   __git_flow_hotfix                __git_flow_release               __git_refs2                      __gitdir
__git_complete_file              __git_flow_list_features         __git_heads                      __git_refs_remotes               
__git_complete_revlist           __git_flow_list_hotfixes         __git_merge_strategies           __git_remotes                    
crayment@Amy:~/dev/dotfiles(master)$_git_flow
-bash: __git_find_on_cmdline: command not found
crayment commented 13 years ago

Thanks for the quick response btw! What is __git_find_on_cmdline?

crayment commented 13 years ago

Updating git did not help

crayment@Amy:~/dev/dotfiles(master)$git --version
git version 1.7.3.1
crayment@Amy:~/dev/dotfiles(master)$_git_flow
-bash: __git_find_on_cmdline: command not found
bobthecow commented 13 years ago

How 'bout this? type -t __git_find_subcommand

crayment commented 13 years ago

alias

bobthecow commented 13 years ago

__git_find_on_cmdline and __git_find_subcommand are two different names for the same function, which parses the current command line input and checks for subcommands (and other things). git-flow-completion adds an alias so both function names should be valid. It looks like you have neither...

It sounds like you might have an outdated version of git-completion.bash. Grab a fresh copy here and see if that helps.

crayment commented 13 years ago

Hmmm. Even after updating git-completion.bash those functions don't seem to exist. I'm not sure why though. You can see all of my dot files here: http://github.com/crayment/dotfiles

Thanks for you help.

crayment commented 13 years ago

Its obviously not an issue with your script. If I don't load the rest of my dot files and just source git-completions and git-flow-completions it works. You can close this if you like. I will have to do some digging.

crayment commented 13 years ago

Problem solved. When I updated the file was named "git-completion.bash" and my old file was just "git-completion", without the extension. I didn't notice this and didn't update to source the correct file. Thanks for the help.

bobthecow commented 13 years ago

Excellent. I'm glad I could help.

Side note: In the process of digging around, I realized that this commit should have never been made: 88a423544f47794f036cf985317e7c335463b543

So I reverted it and released a new version of git-flow-completion. So thanks for your help too :)