#commit-message #git #mob-programming

bin+lib git-mob-tool

A CLI app which can help users automatically add co-author(s) to git commits for pair/mob programming

24 stable releases

1.6.2 Apr 19, 2024
1.6.1 Apr 16, 2024
1.5.4 Mar 29, 2024
1.4.0 Apr 21, 2023
1.1.0 Mar 31, 2023

#722 in Command line utilities

Download history 2/week @ 2024-06-24 112/week @ 2024-07-01 39/week @ 2024-07-08 34/week @ 2024-07-15 160/week @ 2024-07-22 205/week @ 2024-07-29 103/week @ 2024-08-05 47/week @ 2024-08-12 45/week @ 2024-08-19 5/week @ 2024-08-26 49/week @ 2024-09-02 31/week @ 2024-09-09 34/week @ 2024-09-16 52/week @ 2024-09-23 24/week @ 2024-09-30 64/week @ 2024-10-07

174 downloads per month

MIT license

61KB
1.5K SLoC

git mob

CLI app to help you automatically add Co-authored-by trailers to git commits during pair/mob programming

crates.io license build status codecov

You can attribute a git commit to more than one author by adding one or more Co-authored-by trailers to the commit's message. Co-authored commits are visible on GitHub. For more information, see here.

This CLI app will help you add them automatically and also help you store and manage co-authors for pair/mob programming sessions.

Features

  • Cross-platform
  • Co-authors management via CLI
  • Multi-select menu to choose co-author(s) for mobbing
  • Automatic appending of Co-authored-by trailers to commit
  • No need of any git aliases

Installation

Prerequisites

With Binary Package

  • Download and extract the appropriate binary depending on your OS from the latest GitHub release

  • Ensure the binary is in your PATH variable e.g. you may place the file in C:\Windows on Windows or /usr/local/bin on Linux and macOS

  • Ensure the binary is set as executable (Linux and macOS)

    $ chmod +x ./git-mob
    

With Cargo

$ cargo install git-mob-tool

Setup & Configuration

  • Set up a global prepare-commit-msg githook which appends the Co-authored-by trailers to the commit message.

    $ git mob setup --global
    

    If a repository overrides core.hooksPath git configuration variable (e.g when using husky), then you will additionally need to run git mob setup --local for each such repository. This will set up a local (repository-specific) prepare-commit-msg githook which invokes the global one.

    If you prefer to set this up manually or encounter any issues with the automated setup process, you can follow steps outlined here.

  • Store your team members' details with keys

    $ git mob coauthor --add lm "Leo Messi" leo.messi@example.com
    $ git mob coauthor --add em "Emi Martinez" emi.martinez@example.com
    $ git mob coauthor --add sa "Sergio Aguero" sergio.aguero@example.com
    

Usage

  • To mob with some team member(s):

    $ git mob --with
    ? Select active co-author(s):
    > [ ] Leo Messi <leo.messi@example.com>
      [ ] Emi Martinez <emi.martinez@example.com>
      [ ] Sergio Aguero <sergio.aguero@example.com>
    [↑↓ to move, space to select one, → to all, ← to none, type to filter ]
    

    Alternatively, if you remember the co-author keys, you may bypass the multi-select menu by running:

    $ git mob --with lm em
    

    This will start a global mob session. Any git commit made afterwards will have Co-authored-by trailers added to the commit message as shown below:

    This is an example commit message
    
    Co-authored-by: Leo Messi <leo.messi@example.com>
    Co-authored-by: Emi Martinez <emi.martinez@example.com>
    
  • To clear the mob session:

    $ git mob --clear
    
  • To view the co-authors in the current mob session:

    $ git mob --list
    
  • To print help information:

    $ git mob help
    $ git mob help coauthor
    

Troubleshooting

  • When using git mob --help, an error may occur because Git looks for man pages for subcommands. To avoid this error, use one of the following alternatives:
    • git mob help
    • git-mob --help

Dependencies

~5–12MB
~135K SLoC