Pairing is a fantastic way to quickly bounce ideas around, get help with something, or even as a tool for mentoring and growth. In recent times, most Git-based tools have adopted the Co-Authored-By trailer to identify when there are multiple authors to a commit. This is great, but often a pain to type out manually, especially if there are many commits or multiple people involved.
Asking around at work, there were a few things people had — everything from vim macros, to custom shell functions — but nothing quite like what I wanted. So I wrote a script to do it for me.
It begins with git-pair (to be used as git pair). This script enumerates all the commit authors in the current repo, offers them to you with a fuzzy-finder, and then appends those people as co-authors on every commit until you run a companion script to end the session.
This uses Git's "commit template" feature to hack in the trailers for us automatically on each commit. This requires you to have a bit of Git configuration to point it at a template file: