Skip to content

Instantly share code, notes, and snippets.

@urbanautomaton
Last active July 18, 2016 15:32
Show Gist options
  • Save urbanautomaton/2b083ae0fb7c72087b3a8efd26e5d375 to your computer and use it in GitHub Desktop.
Save urbanautomaton/2b083ae0fb7c72087b3a8efd26e5d375 to your computer and use it in GitHub Desktop.
Username tab-completion for mynewsdesk-git-pair

If you use mynewsdesk-git-pair to manage pairing authors in git, add the following snippet to your .bashrc to enable tab completion of pairing author names.

_git_pair () {
  __gitcomp_nl "$(git config --get-all git-pair.authors | sed 's/\([^ ]*\).*/\1/')"
}

Prerequisites

You will need programmable bash completion set up, and the git completions that use it. On OSX with homebrew that's as simple as

  • brew install bash-completion
  • brew install git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment