Code Monkey home page Code Monkey logo

git-pairing-session's Introduction

Git Pairing Session

A mini set of shell scripts to enable you to take advantage of commits with coauthors in Github.

github coauthored commit screenshot

Why pair?

See my blog post on the benefits of pair programming.

Why record coauthors?

  • Chris Beams does a great job of explaining why good git commits are important. Git coauthors extend all the points he makes.
  • Those sweet, sweet, contribution points. ๐Ÿ’š

Installation

  1. Clone this repo into your home directory. ๐Ÿ 
git clone https://github.com/sadir/git-pairing-session.git $HOME/
  1. Add the git-pairing-session script to your bash config (e.g. in ~/.bash_profile or ~/.bashrc).
source $HOME/git-pairing-session/git-pairing-session
  1. Setup your colleagues so git-pairing-session knows who you can ๐Ÿ with.
add_colleague ms "Morgan Sadr-Hashemi" "[email protected]"

Note: your colleagues email addresses must match their github email.

You can remove colleagues too if they abandon you:

remove_colleague ms

Usage

There are two options:

  1. Record your coauthor as you go.
  2. Retrospectively modify your branch to add your coauthor to every commit.

Option 1

  1. Set up your project to be ready for recording coauthors as you go, by running this command in the root of your project (where your .git directory is).
pairing_project # symlinks a git hook to append authors to your commit messages.

Note: this will ask your permission to override your current prepare-commit-msg git hook if you have one.

  1. Get pairing with someone! ๐Ÿ’ช
pairing_with ms # hand it a set of initials you set up earlier
  1. When you're done, stop recording your coauthor.
no_longer_pairing
  1. Eat more fruit ๐Ÿ ๐Ÿ‡ ๐ŸŠ ๐Ÿ ๐ŸŒ ๐Ÿ’

Option 2

  1. Do your work, blissfully unaware that you've forgotten to record your coauthor.

  2. Retrospectively amend your branch to add coauthors.

paired_with ms
  1. Eat more fruit ๐Ÿ ๐Ÿ‡ ๐ŸŠ ๐Ÿ ๐ŸŒ ๐Ÿ’

Customisation

Set this variable if you cloned the repo somewhere else:

export GIT_PAIR_SESSION_DIR=$HOME/git-pairing-session

Why this repo? Why not other-repo?

I had a look at a few of these:

This one randomly attributes the commit to one member of the pair. I wanted each commit to be attributed to both.

This one put both co-authors in as the commiter but that broke the way that github represented commiters. Git the vcs wasn't set up for that.

Similar to git-pair, with added downsides of not being maintained and I quite wanted something in shell script without any dependencies other than Git, rather than using JS.

git-pairing-session's People

Contributors

sadir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

git-pairing-session's Issues

Retrospectively adding co-authors

Would be nice to update a whole branch with co-authors if you'd forgotten to.

Similar to the current pairing_with ms command but retrospectively. paired_with ms.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.