xp-mode
makes it easier to record what pairs worked on what commits.
On a POSIXish system:
curl https://raw.githubusercontent.com/ben-biddington/xp-mode/master/install.sh | bash && source ~/xp-mode.sh
Run pair update
ben@bang:~/sauce/xp-mode$ pair update
Running the following in 5s: curl https://raw.githubusercontent.com/ben-biddington/xp-mode/master/install.sh | bash && source ~/xp-mode.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1481 100 1481 0 0 778 0 0:00:01 0:00:01 --:--:-- 777
Installing xp-mode to </home/ben>
Deleting file at </home/ben/xp-mode.sh>
Downloading <https://raw.githubusercontent.com/ben-biddington/xp-mode/master/xp-mode.sh> to </home/ben/xp-mode.sh>
Pairs file already exists at </home/ben/.xp-mode/pairs>
People file already exists at </home/ben/.xp-mode/people>
After installation you have a ~/.xp-mode/people
file.
Add authors to it in this format:
Ben; [email protected]
Lisa; [email protected]
Denny; [email protected]
Include yourself to make it so you can just use the names of all the people in the group.
You may also use full names by adding a second field.
Ben; [email protected]
Lisa; Lisa Shickadance; [email protected]
Denny; [email protected]
$ pair hooks
This adds Co-authored-by
trailers to your commit messages. If you already have a commit-msg
hook configured, it is left alone.
Turn hooks off with:
$ pair hooks -d
I am Ben and I am about to work with Lisa and Denny.
$ pair Ben,Lisa,Denny
- Author name is the names of the people you selected
- Author email is the email address of the last person in the list you selected
- Committer is set to whatever you have set as git config
user.name
anduser.email
commit 402c410f89947c88e3d4e42aefe199cf06917056
Author: Ben, Lisa and Denny <[email protected]>
Commit: Ben Biddington <[email protected]>
Push to master
or with full names:
commit 402c410f89947c88e3d4e42aefe199cf06917056
Author: Ben, Lisa Shickadance and Denny <[email protected]>
Commit: Ben Biddington <[email protected]>
Push to master
When you have hooks enabled, you get extra Co-authored-by
trailers in your commits:
commit 7de767f5e59e154c705bee8de7413529dc287ab5
Author: Ben, Lisa and Denny <[email protected]>
Commit: Ben Biddington <[email protected]>
And use small batches
Co-authored-by: Mob <[email protected]>
Co-authored-by: Mob <[email protected]>
Co-authored-by: Mob <[email protected]>
To revert to normal operation:
pair solo
- Setting persists only within the current terminal session
- Bash function is the only practical way to set
GIT_AUTHOR_{NAME,EMAIL}
- Also tried git_scripts, but subshells are not suitable
- The only git config options seem to be
user.name
anduser.email
which are used to set both author and committer. Temporarily setting them is not an option. - Git hooks are no good either because they run in a child shell and cannot therefore affect the
GIT_AUTHOR_{NAME,EMAIL}
environment variables