|
1 | 1 | # Commit Colors |
2 | 2 |
|
3 | | -See a lovely color swatch in your terminal every time you author a commit. Here's what it looks like: |
| 3 | +See a lovely color swatch in your terminal every time you author a commit. The hexadecimal color comes from the first six characters in your commit ID. Here's what it looks like: |
4 | 4 |
|
5 | 5 |  |
6 | 6 |
|
7 | | -The hexadecimal color comes from the first six characters in your commit hash. |
| 7 | +Commit colors is written in Go, and is usable on Mac, Windows, and Linux. |
8 | 8 |
|
9 | 9 | *Note: commit-colors 1.0.0 was written in JavaScript and [distributed on npm](https://www.npmjs.com/package/@sparkbox/commit-colors). For instructions on that version of the project, see [the v1 README](https://github.com/sparkbox/commit-colors/tree/76a6b46fed76aeb5e1c813d86ead5185ee1e5cc1).* |
10 | 10 |
|
11 | | -## Installing |
| 11 | +## Installation |
12 | 12 |
|
13 | | -1. Install the package with homebrew: |
| 13 | +**Using Homebrew** |
14 | 14 |
|
15 | | - ```bash |
16 | | - brew tap sparkbox/commit-colors |
17 | | - brew install commit-colors |
18 | | - ``` |
| 15 | +```bash |
| 16 | +brew install sparkbox/commit-colors/commit-colors |
| 17 | +``` |
19 | 18 |
|
20 | | -2. Set up a post-commit hook. Options include: |
| 19 | +**Direct Download** |
21 | 20 |
|
22 | | - **The manual way** |
| 21 | +1. Browse to [the list of releases](https://github.com/sparkbox/commit-colors/releases), and download the package that corresponds to your system (Mac, Windows or Linux). |
| 22 | +2. Move the executable to a location on [your PATH](https://superuser.com/a/284351/193516) ([like `/usr/local/bin`](https://superuser.com/q/7150/193516), for example). |
23 | 23 |
|
24 | | - Copy/paste the following text into a post-commit hook: |
| 24 | +Once installed, you can do a quick test in the terminal: |
25 | 25 |
|
26 | | - ```bash |
27 | | - #!/bin/bash |
28 | | - commit-colors $(git rev-parse HEAD) |
29 | | - ``` |
| 26 | +```bash |
| 27 | +commit-colors 123ADD5db8d67ba9621eb5d6765ffdef4c24077a |
| 28 | +``` |
30 | 29 |
|
31 | | - 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](https://stackoverflow.com/a/14208849/1154642). If you want this hook to run on all your repos, [see how to do that here](https://stackoverflow.com/q/2293498/1154642). |
| 30 | +## Commit Hooks Setup |
32 | 31 |
|
33 | | - **Using a Git Hooks manager** |
| 32 | +**Option 1: Create the hook by hand** |
| 33 | + |
| 34 | +Copy/paste the following text into a post-commit hook: |
| 35 | + |
| 36 | +```bash |
| 37 | +#!/bin/bash |
| 38 | +commit-colors $(git rev-parse HEAD) |
| 39 | +``` |
| 40 | + |
| 41 | +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](https://stackoverflow.com/a/14208849/1154642). If you want this hook to run on all your repos, [see how to do that here](https://stackoverflow.com/q/2293498/1154642). |
| 42 | + |
| 43 | +**Option 2: Use a Git Hooks manager** |
| 44 | + |
| 45 | +See [this list of tools for managing git hooks](https://github.com/aitemr/awesome-git-hooks#tools). |
| 46 | + |
| 47 | +Whatever tool you use, this is the command you'll want it to run: `commit-colors $(git rev-parse HEAD)` |
| 48 | + |
| 49 | +## For Maintainers |
| 50 | + |
| 51 | +### Publishing |
| 52 | + |
| 53 | +1. Create a new tag, and push it up to Github: |
| 54 | + |
| 55 | +```bash |
| 56 | +git tag -a 2.0.0 -m "Version 2 release" |
| 57 | +git push origin 2.0.0 |
| 58 | +``` |
| 59 | + |
| 60 | +2. The Github Action handles the rest! |
| 61 | +- The action publishes [a Github release](https://github.com/sparkbox/commit-colors/releases) and a [homebrew update](https://github.com/sparkbox/homebrew-commit-colors). |
| 62 | +- Additional publishing settings can be found in `goreleaser.yml` |
34 | 63 |
|
35 | | - See [this list of tools for managing git hooks](https://github.com/aitemr/awesome-git-hooks#tools). |
36 | 64 |
|
0 commit comments