Giter Club home page Giter Club logo

git-flow-completion's Introduction

git-flow-completion

Bash, Zsh and fish completion support for git-flow.

The contained completion routines provide support for completing:

  • git-flow init and version
  • feature, hotfix and release branches
  • remote feature, hotfix and release branch names

Installation for Bash

To achieve git-flow completion nirvana:

  1. Install git-completion.

  2. Install git-flow-completion.bash. Either:

    1. Place it in your bash_completion.d folder, usually something like /etc/bash_completion.d, /usr/local/etc/bash_completion.d or ~/bash_completion.d.

    2. Or, copy it somewhere (e.g. ~/git-flow-completion.bash) and put the following line in the .profile or .bashrc file in your home directory:

       source ~/git-flow-completion.bash
      
  3. If you are using Git < 1.7.1, you will need to edit git completion (usually /etc/bash_completion.d/git or git-completion.sh) and add the following line to the $command case in _git:

    _git ()
    {
            [...]
            case "$command" in
               [...]
               flow)        _git_flow ;;		
               *)           COMPREPLY=() ;;
            esac
    }
    

Installation for Zsh

To achieve git-flow completion nirvana:

  1. Update your zsh's git-completion module to the newest version -- available here. Optional if you have an up-to-date version of zsh.

  2. Install git-flow-completion.zsh. Either:

    1. Place it in your .zshrc.

    2. Or, copy it somewhere (e.g. ~/.git-flow-completion.zsh) and put the following line in your .zshrc:

       source ~/.git-flow-completion.zsh
      
    3. Or, use this file as an oh-my-zsh plugin.

      1. Install the plugin by cloning this repository to your directory for custom oh-my-zsh plugins:

      git clone https://github.com/bobthecow/git-flow-completion ~/.oh-my-zsh/custom/plugins/git-flow-completion

      After doing that, your file tree ought to look like this:

      1. Turn the plugin on by updating your zsh configuration file, ~/.zshrc

        1. open ~/.zshrc

        2. Find the plugins section. It'll look like this:

           # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
           # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
           # Example format: plugins=(rails git textmate ruby lighthouse)
           plugins=(<some-plugin> <another-plugin> <third-plugin>)
          
        3. Add git-flow-completion to the list of plugins within the parentheses.

        4. Save

      2. Reload Terminal

Installation for fish

To achieve git-flow completion nirvana:

  1. Install git.fish in your ~/.config/fish/completions folder.

The Fine Print

Copyright (c) 2010-2015 Justin Hileman

Distributed under the MIT License

git-flow-completion's People

Contributors

alej0varas avatar bobthecow avatar chevalun avatar curiousstranger avatar d3m3vilurr avatar gucki avatar jagipson avatar jbking avatar lasall avatar nexxtm avatar nvie avatar soplakanets avatar tjfwalker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-flow-completion's Issues

git-completion, OS X, Homebrew instructions for ZSH

https://github.com/bobthecow/git-flow-completion/wiki/Update-Zsh-git-completion-module

Replace /usr/share/zsh/x.x.xx/functions/_git

In newer versions of OSX this file is restricted

Issue ls -lO /usr/share/zsh/x.x.xx/functions/_git

(capital letter 'oh', not zero);

if you see restricted, SIP is protecting that directory tree.

Solution (from the linked answer):

boot into recovery mode (Command-R during boot)
In terminal, issue crsutil disable
Reboot to normal mode. You should see that SIP is no longer blocking write access.
If you later want to restore SIP, just use crsutil enable in recovery mode.

source: https://superuser.com/a/1159330/8036

Broken if installed before git

I tried to install bash-completion and got weird linker errors:

The rest of the "contrib" folder has been copied to:
/usr/local/Cellar/git/1.7.4.1/share/contrib
Error: The linking step did not complete successfully
The package built, but is not symlinked into /usr/local
You can try again using `brew link git'
Error: File exists - /usr/local/etc/bash_completion.d

If I install git first and then install bash-completion everything works happy dandy. If I do it the other way around I get the same problem with git as with bash-completion.

sed: RE error: illegal byte sequence

I'm getting sed: RE error: illegal byte sequence error with the recent changes.

Here are my specs:
Homebrew 1.6.3
Homebrew/homebrew-core (git revision 85d254; last commit 2018-05-08)
git version 2.17.0

It got broken after upgrading the git I guess. I'm not sure what specifically broke it after upgrading brew formulas, I'm getting this error.

I'm not sure it is reproducible or not but my understanding that one of the regular expressions in the bash_completion is not correct. I had no time to dive into. If I find some time, I will let you know my findings

conflict with "Ctrl + R" in Mac/Linux/..

I made a push a moment ago using "git push origin xxx" in command line,then if I want to push again, I like to use "Ctrl + R(reverse-i-search) " to get the push history. When I find it ,however, if I press "Tab", the command will be "git push push origin xxx",so I need to clear the repeated 'push' to make a success push!
Have a look,guys,thank you~
BRs.

Git Completion No Longer Working After Migration Between Computers

Everything is intact as I used the migration assistant, unless there is a requirement for Xcode command line tools or something of that nature? I installed this through Homebrew and it was working fine on my initial computer (running Mac OS 10.9.5) but ceases to work with my new machine (same OS version). Some help would be greatly appreciated.

ZSH completion for 0.4

Alright ZSH fans: Bash completion is finished for 0.4. It's in the dev branch, the release is waiting on you. Who's gonna update ZSH completion so I can release this bad boy? I'd do it but I know next to nothing about ZSH :)

The git-core package is not mandatory

Hi,

On the documentation for Ubuntu, you tell it to install the git-core package: but it is not mandatory to works out.

You can modify the documentation, like:

sudo apt-get install git bash-completion

I tried and all is working on my Ubuntu 14.04 LTS

Thanks in advance.

bash-completion invoke instructions

My ENV

MacOS High Sierra
Git version 2.18.0

There is No '/etc/bash_completion.d/git-completion.bash' after executing 'brew install git bash-completion' on my MacBook.

Instead I add the following line to my ~/.bash_profile:
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion

Not working on Ubuntu 16.04

In a fresh Ubuntu 16.04 machine and after installing git, bash-completion and as described in the instructions, I'm not able to make git completion works. I used to have an Ubuntu 14.04 and worked fine.

Is it a known issue?

Mac OS High Sierra issue: was missing right version of git-completion.bash

I was following the helpful instructions provided here:

#46 (comment)

However, afterwards, I got the following appearing in my shell:

git flowUnknown option: --list-cmds=list-mainporcelain,others,nohelpers,alias,list-complete,config
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

I then discovered on StackExchange that it was because the master version of git-completion.bash I had downloaded was too recent for my built-in version of git:

https://apple.stackexchange.com/questions/327817/git-completion-bash-producing-error-on-macos-sierra-10-12-6

Solution

I found out what my version of git was:

$ git --version
git version 2.10.1 (Apple Git-78)

And then I downloaded the corresponding git-completion.bash version, e.g.:

https://raw.githubusercontent.com/git/git/v2.10.1/contrib/completion/git-completion.bash

It works for me now (:

missing subcommands for hotfix

git-flow-completion misses some subcommands for hotfix:

git flow hotfix 
-> finish   help     list     start    

git flow hotfix help 
usage: git flow hotfix [list] [-v]
   git flow hotfix start [-F] <version> [<base>]
   git flow hotfix finish [-Fsumpk] <version>
   git flow hotfix publish <version>
   git flow hotfix track <version>

Completion of "git flow feature publish" produces only an error

if I want to publish a new branch, I get this error:

 sh: command substitution: line 1: `comm -23 <(__git_flow_list_branches 'feature') <(__git_flow_list_remote_branches 'feature')'

After publishing everything is fine and I assume, that there's a problem with the not yet published branch :)

completion not working with git alias

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

Note for ubuntu users or gitfast completion users

Hello there,

The following is more a note for future user, who will as me encounter a completion problem with oh-my-zsh, your plugin and other completion plugin as gitfast, than a real issue.

First a bit of context:
I'm using WSL with ubuntu 20.04
My shell is ZSH tuned by oh-my-zsh

I followed this part of the install how to: iii

And important I'm using gitfast and want to add git-flow-completion features!

Today I tried this plugin on my ubuntu 20.04 and had to search for a few hours why it did not work!
So first since ubuntu 18.04 the official repositories are offering git-flow AVH

  • You can use the following command to see which flavor you have.
git flow version

For me it answered: 1.12.3 (AVH Edition)

But I just saw this option and of course, I did not check for incompatibilities about this plugin and git-flow AVH, will do tomorrow thought, and for me it did not work...

Then I'm using gitfast plugin, and that I tested it, there is something that is not compatible with the git-flow-completion plugin as when trying to use git flow in[tab] like this problem:

  • Only a list of files that matched the in* pattern in the directory (as mentioned here)

Then I search in all the 400+ Fork if someone corrected this issue and I found the PR of lhernanz
So I selected the most recents changed from all the fork to avoid beeing to far away from the last release, if zsh or oh-my-zsh decided to change something, so I forked wizard-28 fork who applied a change 4 month ago and then apply the patch from lhernanz PR.
After a reload of my terminal (exec zsh) all worked well \o/

Now, well next week-end, all I need to do is compare with the other 400 whitch one got the more complete plugin and apply the lhernanz patch again xD

Branch completion shouldn't consider deleted branches

After following the steps here for adding git_completion to Mac, when I type "git checkout mm-" and press tab, I see all the branches that ever started with mm-, including the ones I have deleted. Is this expected? Would be nice if completion would only work for the branches that show up when I do "git branch".

I also see other people's branches and I'd prefer not to, but that's not as much of an issue since we prefix our branch names with a personal identifier (mm- for me)

404 Link

The link in the wiki page, to the _git binary on sourceforge, gives me a 404. Just thought you might want to know.

Installing the ZSH completion system-wide

I'm looking into installing the ZSH completion system-wide, in such a way that it would just work, out of t he box, like the completions that come with stock ZSH, without the need to source it in one's .zshrc, or anything similar.

The bash completion works like a charm this way, I can just drop it into /etc/bash_completion.d/ and be done with it. The ZSH completion, however, doesn't. If I put it into /usr/share/zsh/functions/Completion/Unix, under the name _git-flow, it doesn't autoload. If I do an autoload _git-flow at that point, it starts to work, but not before.

It would be very useful, if the ZSH completion could be installed system-wide, the same way the bash completion can be. However, my ZSH knowledge is sadly lacking, especially with regards to completion: I don't even know where and how to start debugging the issue.

Autocomplete with long options

git branch --set-upstream-to=origin/str

autocompletes to

git branch origin/streakpanel

but I think it should instead fail to complete, or complete to

git branch --set-upstream-to=origin/streakpanel

git-completion, OS X, Homebrew instructions

For more recent versions of git (installed via brew), the shell script should be:

if [ -f `brew --prefix`/etc/bash_completion.d/git-completion.bash ]; then
  . `brew --prefix`/etc/bash_completion.d/git-completion.bash
fi

ZSH completion

Anyone interested in building ZSH completion functions for git-flow, too?

Link to zsh's git-completion Module is 404

Under "Installation for Zsh" the first point is "Update your zsh's git-completion module to the newest verion -- available here.", but the link results into a 404 (also typo "verion").

I think the intended file is here now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.