1.0.0 • Published 6 years ago

@sparkbox/commit-colors v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

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.
  • ???