git-flow support #246

mhubig opened this Issue Aug 30, 2012 · 6 comments


None yet
3 participants

mhubig commented Aug 30, 2012

Hi Tim,

thank you very much for this awesome plugin!
One thing I'm missing a bit is git-flow support ...
maybe you can have a look in that?

Cheers, Markus


tpope commented Aug 30, 2012

You're not the first to request this. I'll ask you what I asked the last guy: Other than mapping :Gflow to :Git flow (which I'm not going to do), what do you have in mind?

mhubig commented Aug 31, 2012

On my zshell I have the git-flow-completion plugin, which makes it really easy to use this git extention.

I think the first and most requesting thing would be to have some tab-completion for :Git flow. And having a :Gflow command would make it even easier to use.

I'm thinking of something like this:

:Gflow f<tab>
:Gflow feature s<tab>
:Gflow feature start test

:Gflow f<tab>
:Gflow feature f<tab>
:Gflow feature finish t<>
:Gflow feature finish test

In my zsh I even get some sort of a list of possible options which I can select by using my arrow keys and then hit enter.

$ git flow <tab>
feature           -- Manage your feature branches.
hotfix            -- Manage your hotfix branches.
init              -- Initialize a new git repo with support for the branching model.
release           -- Manage your release branches.
support           -- Manage your support branches.
version           -- Shows version information.

Another example:

$ git flow feature <tab>
v                 -- Verbose (more) output
checkout          --  checkout
diff              --  diff
finish            -- Finish a feature branch.
list              -- List all your feature branches. (Alias to `git flow feature`)
publish           --  public
pull              --  pull
rebase            --  rebase
start             -- Start a new feature branch.
track             --  track

And even nicer:

$ git flow feature finish <tab>
better_README    refactor_connector    replace_zlib

I know git-flow is a bit controversial these times, but it taught me a lot of the power of branching in git and it makes some things really easy and fast.


tpope commented Aug 31, 2012

Ah, tab completion. Zsh's tab completion for Git is pretty insane:

$ wc -l ~/src/vim/bundle/vim-fugitive/plugin/fugitive.vim
2487 /home/tpope/src/vim/bundle/vim-fugitive/plugin/fugitive.vim
$ wc -l /usr/share/zsh/functions/Completion/Unix/_git 
6163 /usr/share/zsh/functions/Completion/Unix/_git

That is, the implementation of tab complete in Zsh takes twice as much code as the entirety of fugitive.vim. That's in a language that's designed for tab completion. And needless to say, tab completion for some controversial Git add on is a lower priority than tab completion for Git itself.

Luckily, there's no reason :Gflow couldn't be a separate plugin entirely.

mhubig commented Aug 31, 2012

Yes zsh's tab completion is truly insane! Luckily the git-flow part of it isn't :-):

$ wc -l /usr/local/Cellar/zsh-completions/0.5.2/share/zsh-completions/_git-flow
334 /usr/local/Cellar/zsh-completions/0.5.2/share/zsh-completions/_git-flow

I even learned that there can be some kind of a completion menue in vim with:

:set wildmenu
:set wildmode=list:longest,full

With this settings I get

:Gcommit -<tab>
-C                 -q                 --cleanup=         --quiet
-F                 -s                 --dry-run          --reedit-message=
-a                 -t                 --edit             --reuse-message=
-c                 -u                 --file=            --signoff
-e                 -v                 --include          --template=
-i                 --all              --interactive      --untracked-files
-m                 --allow-empty      --message=         --verbose
-n                 --amend            --no-verify
-o                 --author=          --only

And with

:Gcommit -<tab><tab>
-C  -F  -a  -c  -e  -i  -m  -n  -o  -q  -s  -t  -u  -v  --all  --allow-empty  --amend  > 

A list wich I can navigate with the arrow keys.

If you refuse to add git-flow maybe I'll give it a try and start a vim-fugitive-flow plugin for the vim-fugitive plugin. But watch out, I may send you some nasty questions then, couse I don't know nothing about vim-script ...

aemonge commented Dec 22, 2015

Is the :Gflow or :Git flow still only under consideration ?


tpope commented Dec 22, 2015

No, I think it's best suited to a separate plugin.

tpope closed this Dec 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment