@sparkbox/commit-colors

1.0.0 • Public • Published

Commit Colors

See a lovely color swatch in your terminal every time you author a commit. Here's what it looks like:

animated gif demonstrating commit colors

The hexadecimal color comes from the first six characters in your commit hash.

Installing

  1. Install the package globally

    npm install -g @sparkbox/commit-colors
  2. Copy/paste the following text into a post-commit hook:

    #!/bin/bash
    SHA=$(git rev-parse HEAD)
    SHA6=${SHA:0:6}
    commit-colors $SHA6
    

    In other words, put the above code in a file named post-commit at the location .git/hooks/post-commit in your git project of choice. Make sure this file is executable. If you want this hook to run an all your repos, see how to do that here.

Todo

  • Make it easier to install the commit hook.
  • Ensure it is cross-platform.
  • Support more color names.
  • ???

Readme

Keywords

none

Package Sidebar

Install

npm i @sparkbox/commit-colors

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

23.2 kB

Total Files

4

Last publish

Collaborators

  • jon-sbx
  • catheraaine
  • kaseybon
  • flotsam