Coder Social home page Coder Social logo

xinzweb / git-together Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kejadlen/git-together

0.0 1.0 0.0 112 KB

Better commit attribution while pairing without messing with your git workflow.

License: MIT License

Shell 26.73% PowerShell 1.80% Rust 71.47%

git-together's Introduction

git-together

Build Status

Following in the footsteps of git-pair and git-duet, but without needing to change your existing git habits.

Installation

brew install seattle-beach/tap/git-together

Configuration

Here's one way to configure git-together, but since it uses git config to store information, there are many other ways to do it. This particular example assumes a desire to store authors at the repo-level in a .git-together file.

# `git-together` is meant to be aliased as `git`
alias git=git-together

# Use .git-together per project for author configuration 
git config --add include.path ../.git-together
# Or use one .git-together for all projects
git config --global --add include.path ~/.git-together

# Setting the default domain
git config --file .git-together --add git-together.domain rocinante.com

# Adding a couple authors
git config --file .git-together --add git-together.authors.jh 'James Holden; jholden'
git config --file .git-together --add git-together.authors.nn 'Naomi Nagata; nnagata'

# Adding an author with a different domain
git config --file .git-together --add git-together.authors.ca 'Chrisjen Avasarala; [email protected]'

Usage

# Pairing
git with jh nn
# ...
git commit

# Soloing
git with nn
# ...
git commit

# Mobbing
git with jh nn ca
# ...
git commit

Soloing and mobbing are set by simply passing in the right number of authors to git with. git-together automatically rotates authors after making a commit so that the author/committer roles are fairly spread across the pair/mob over time.

Aliases are supported as well. You can make git-together do its thing when you use an alias for a committing command by configuring a comma-separated list of aliases:

git config git-together.aliases ci,rv,m
# ...
git ci

Technical Details

Because repo-level authors are common and there's no good way of configuring git config on cloning a repo, git-together will automatically include .git-together to git config if it exists. (See GitConfig::auto_include for details.) This allows git-together to work immediately on cloning a repo without manual configuration.

Under the hood, git-together sets GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME, and GIT_COMMITTER_EMAIL for the commit, merge, and revert subcommands so that git commits have the correct attribution.. git-together also adds the --signoff argument to the commit and revert subcommands so that the commit message includes the Signed-off-by: line.

Known Issues

git-together works by aliasing git itself, so there are going to be issues with git's in-built aliases as well as other utilities (such as Hub) that work in the same manner.

Development

Rust version

Install rust using the rustup tool. Installing from homebrew won't work because some nightly features of rust are needed to build.

Then, switch to the nightly with

rustup default nightly

Bats

Bats is a bash testing framework, used here for integration tests. This can be installed with homebrew.

brew install bats

Testing

cargo test
./bats/integration.bats

git-together's People

Contributors

kejadlen avatar professor avatar sentientmonkey avatar sgravrock avatar

Watchers

 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.