Skip to content

ben-biddington/xp-mode

Repository files navigation

Status

xp-mode makes it easier to record what pairs worked on what commits.

Installation

On a POSIXish system:

curl https://raw.githubusercontent.com/ben-biddington/xp-mode/master/install.sh | bash && source ~/xp-mode.sh 

Read what installer does

Automatic update

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>

Configuration

After installation you have a ~/.xp-mode/people file.

Add authors to it in this format:

Include yourself to make it so you can just use the names of all the people in the group.

Full names

You may also use full names by adding a second field.

Ben;                    [email protected]
Lisa; Lisa Shickadance; [email protected]
Denny;                  [email protected]

Options

Configure a commit-msg hook:

$ 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

Usage

I am Ben and I am about to work with Lisa and Denny.

$ pair Ben,Lisa,Denny
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

FAQ

  • Setting persists only within the current terminal session

Notes

  • 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 and user.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

About

How to record pairs or mobs in git commits

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published