Giter VIP home page Giter VIP logo

xp's Introduction

Introduction

xp is a tool created to make practising extreme programming easier.

Build Status Coverage Status

Reference

Full list of options supported:

โžœ  ~ xp
NAME:
   xp - extreme programming made simple

USAGE:
   xp [global options] command [command options] [arguments...]

VERSION:
   (version)

COMMANDS:
     show-config, sc  Print the current config
     add-dev          Add a new developer
     init, i          Initialize a repo. Setup prepare-commit-msg hook
     set-devs         Set list of devs working on the repo
     help, h          Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --config value  set the default configuration file (default: "/Users/kidoman/.xp")
   --help, -h      show help
   --version, -v   print the versio

Features

  • Manage the co-authorship of commits by automatically writing appropriate* Co-authored-by trailers (see https://help.github.com/articles/creating-a-commit-with-multiple-authors/ for details on this standard)
  • Take co-authorship information written in the first line of the commit message and convert that into appropriate Co-authored-by trailers (overrides all other sources)
  • Ensure that the author drafting the commit is not duplicated as a Co-authored-by trailer
  • Preserve co-authorship information when ammending commits

Installation

The simplest way to install xp in your dev environment is:

go get -u github.com/gojek/xp

If you do not have go installed, or prefer to install a different way, you can always:

  • Download a binary from the releases page
  • brew install gojek/tap/xp

Usage

xp stores its global configuration at ~/.xp (can be overriden via global flag --config)

Most of the xp functionality are exposted via various subcommands:

  • show-config: Print the current stored configuration
  • add-dev: Add/remove developers in xp
  • init: Add/remove repos managed by xp

A separate command add-info is made available for use from within git hooks:

  • prepare-commit-msg
  • commit-msg

Example

Suppose we have a repo at ~/work/lambda which we want to now manage using xp (this assumes you have already installed xp using the instructions above):

Add Karan Misra <[email protected]> as a tracked author in the system with shortcode "km" to allow for easy referencing in future command line invocations or the first line of commit messages. Same for "akshat":

$ xp add-dev km "Karan Misra" [email protected]
$ xp add-dev ak "akshat" [email protected]

Switch to the directory with the git repo:

$ cd ~/work/lambda

Initialize the git hooks and register the repo with xp:

$ xp init

Indicate that akshat is pairing with you by adding him using his shortcode:

$ xp set-devs ak

Commit as normal:

$ touch CHANGE
$ git add .
$ git commit -m"Added CHANGE"

Rejoice at a well formed commit message:

$ git log -1
commit sha (HEAD -> master)
Author: Karan Misra <[email protected]>
Date:   date

    Added CHANGE

    Co-authored-by: akshat <[email protected]>

When working on a story (issue, etc.), xp makes it really easy to embed the issue id in the commit in a well formed manner:

$ git add .
$ git commit -m"[BEEF-123|ak] This is a nice story"
$ git log -1
commit sha (HEAD -> master)
Author: Karan Misra <[email protected]>
Date:   date

    Make world better

    Issue-id: BEEF-123

    Co-authored-by: akshat <[email protected]>

Bonus

If you quickly want to author a commit with someone you typically don't pair with:

$ xp add-dev anand "Anand Shankar" [email protected]

After making the required changes:

$ git add .
$ git commit -m"[anand] Make world better"

The commit message becomes:

$ git log -1
commit sha (HEAD -> master)
Author: Karan Misra <[email protected]>
Date:   date

    Make world better

    Co-authored-by: Anand Shankar <[email protected]>

Note: See how the [anand] from the start of the commit message has now resulted in Anand Shankar being added as a co-author, overriding the repo level setting (thus akshat is not in the list anymore.) Multiple co-authors can be similarly added by separating their aliases by , or | like so:

$ git commit -m"[anand,akshat] Make world better"
$ git commit -m"[anand|akshat] Make world better"

xp's People

Contributors

kidoman avatar

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.