Skip to content

Easily build up a commit-message that conforms your team-conventions.

License

Notifications You must be signed in to change notification settings

fr3dch3n/commit

Repository files navigation

commit

Easily build up a commit-message that conforms your team-conventions.

License: MIT

Table of Contents

Usage

There are two types of supported commit-styles: conventional-commits and story-commits.

Conventional Commits

$ commit
# runs `git add -p`
Current pairing partner (separate by [,| ])
» pair
Creating team-member with abbreviation pair (This part is skipped once the pair is known.)
Enter username
» pair1234
Enter mail
» [email protected]
Commit type
» fix
Current Scope
» actions
Summary of your commit
» fix build-step by providing ...
Why did you choose to do that?
» Building the package failed because ...
»
»

This results in a commit-message like this:

fix(actions): fix build-step by providing ...

Building the package failed because ...

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

Story Commits

$ commit
# runs `git add -p`
Current pairing partner (separate by [,| ])
» pair
Creating team-member with abbreviation pair (This part is skipped once the pair is known.)
Enter username
» pair1234
Enter mail
» [email protected]
Current Story
» CI-999
Summary of your commit
» fix build-step
Why did you choose to do that?
» Building the package failed because ...
»
»

This results in a commit-message like this:

[CI-999] fix build-step

Building the package failed because ...

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

Special usecases

Some useful flags.

Make an empty commit (a.k.a. git commit --allow-empty)

To make a commit without any changes (an empty commit), use commit -e.

Skip "git add -p"

To skip the git add -p that runs at start, simply use commit -s.

Commands and Flags

Easily build up a commit-message that conforms your team-conventions.

Usage:
  commit [flags]
  commit [command]

Available Commands:
  help        Help about any command
  version     Print the version number of Commit

Flags:
  -e, --empty-commit   make an empty commit
  -h, --help           help for commit
  -s, --skip-git-add   do not run git add -p beforehand
  -v, --verbose        verbose output

Use "commit [command] --help" for more information about a command.

Features

commit...

  • uses a state file to save last pair and last story you commited to
  • adds new team-members on the fly
  • adds the necessary configuration in an initial setup
  • add multiple pairing partners

Installation

use github release

  1. Select the binary from Releases according to your platform.
  2. Rename it to commit.
  3. Make it executable.
  4. Put it in your path.

build from scratch

To use commit you simply have to build it and put the binary on your path:

git clone https://github.com/fr3dch3n/commit
cd commit
make debug-build
ln -s $(pwd)/commit $HOME/bin/commit  # e.g.

commit will ask you for all configuration it needs.

Running the tests

To execute all tests, simply run: make test.

Built With

  • logrus - The golang logging framework
  • cobra - The cmd-line library
  • readline - Lib to read from command-line
  • testify - Make testing a blessing

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

Easily build up a commit-message that conforms your team-conventions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published