Lists all authors of a git repo as potential co-authors of a commit.
git coauthors
Download the git-coauthors
script to a directory in your PATH
. I have ~/bin
in my PATH
and this is where I put it.
These are some of the ways git coauthors
can be integrated in a workflow.
Quickly find a particular author and copy the Co-Authored-By line to the clipboard:
git coauthors | grep Authorname | pbcopy
Paste the output of the above command directly in the buffer:
:read !git coauthors | grep Authorname
Option 2: Using vim-fzf to turn this into a completion:
This is my current workflow. I have an insert-mode keymap in my .vimrc
:
inoremap <expr> <c-x><c-g> fzf#vim#complete('git coauthors')
When I'm writing a commit message, I type the partial name of the co-author and
press Ctrl-xCtrl-g which pops up fzf
with completions:
Pressing Enter finishes the completion with the selected text.
There are probably more ways to integrate this. If you come up with another one, let me know!