Skip to content

Commit cc71fbb

Browse files
committed
Update documentation
1 parent 3a0dfe7 commit cc71fbb

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

README.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,26 @@
55

66
## What is git-notify?
77

8-
Sometimes you want to communicate about important changes, process improvements, new tools etc. to other developers on your project. In a small team, a Slack message will probably do the job, but in larger teams and distributed organizations (such as open source project), reaching everyone can be a pain.
8+
Sometimes you need to communicate about important changes to other developers on your project. In a small team, a Slack message will probably do, but in larger teams and distributed organizations (such as open source projects), reaching everyone can be a pain.
99

10-
`git-notify` allows you to inject announcements into your git commit messages, that will be displayed to other developers when they pull the changes to their machine.
10+
`git-notify` allows you to inject announcements into your git commit messages, and display them to other developers when they pull those commits to their machine.
1111

1212
```sh
1313
git commit -m 'git-notify: NEW PERF TOOLING AVAILABLE ...'
1414
```
1515

16+
Later, at a machine far far away:
1617
![Demo](docs/demo.gif)
1718

18-
Or, instead of adding messages to individual commits, you can add them to the extended merge/squash commit message on GitHub:
19+
If you're using merge/squash commit strategy on GitHub, you can add them to the extended commit message when landing a PR:
1920

2021
![GitHub PR flow example](docs/github-example.png)
2122

22-
You can change the prefix [git-notify] uses. See [Configuration](#configuration) for how to do this.
23-
2423
## Getting started
2524

26-
Install the git-notify package as a devDependency to your project:
25+
`git-notify` is intended for use in node-based projects.
26+
27+
Install the git-notify package as a devDependency:
2728

2829
```bash
2930
# using npm
@@ -33,9 +34,7 @@ npm install --save-dev git-notify
3334
yarn add -D git-notify
3435
```
3536

36-
You'll need to install [git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) to run `git-notify` automatically when other developers pull commits that contain git messages.
37-
38-
Below we show how to install them with the excellent [husky](https://github.com/typicode/husky) node library. For other approaches, see the [Git Hooks](#git-hooks) section.
37+
Next, we'll configure `git-notify` to run automatically when other developers pull commits that contain git messages. Below we show how to install them with the excellent [husky](https://github.com/typicode/husky) node library. For other approaches, see the [Git Hooks](#git-hooks) section.
3938

4039
### Installing hooks with husky
4140

@@ -62,18 +61,17 @@ Configure `git-notify` hooks by adding the following `husky` entries to your `pa
6261
}
6362
```
6463

65-
**Note:** The above instructions below are for [husky v4.x](https://github.com/typicode/husky/tree/master). Husky v5 changes how hooks are configured, as well changes its licensing terms to be free only to other open source projects. See [husky's own documentation](https://dev.to/typicode/what-s-new-in-husky-5-32g5) for how to configure hooks in their latest version.
64+
_**Note:** The above instructions below are for [husky v4.x](https://github.com/typicode/husky/tree/master). Husky v5 has changed how hooks are configured, as well updated its licensing terms to be free only to other open source projects.See [husky's own documentation](https://dev.to/typicode/what-s-new-in-husky-5-32g5) for how to configure hooks in their latest version._
6665

6766
## Configuration
6867

69-
- `--prefix "\@team:"`
68+
- `git-notify --prefix "@everyone"`
7069
- Change the prefix `git-notify` looks for in git commit messages
71-
- You'll need to take care of escaping any special characters that may be interpreted by your shell, `!`, `@`, etc...
7270
- Default: `git-notifier:`
73-
- `--color "ff6f6f"`
74-
- Change the color of the banner
75-
- This can be one of the [`chalk` preset colors](https://www.npmjs.com/package/chalk#colors) or a HEX value. If using HEX value, you can either include or omit the leading `#` character.
76-
- `--simple`
71+
- `git-notify --color "#ff6f6f"`
72+
- Change the color of the banner or message
73+
- This can be one of the [`chalk` preset colors](https://www.npmjs.com/package/chalk#colors) or a hex value. Note that not all terminals support full hex color scales.
74+
- `git-notify --simple`
7775
- Instead of a fancy banner, displays a simple text message
7876

7977
### All parameters
@@ -104,7 +102,7 @@ npx git-notify --help
104102

105103
## About formatting
106104

107-
`git-notify` will display a message for every "git-notify:" prefix it finds in the commit log that was just pulled/merged/rebased/checked out. **The notification message will be the rest of the paragraph following the prefix.** Whitespace will be preserved.
105+
`git-notify` will display a message for every "git-notify:" prefix it finds in the commit log that was just pulled/merged/rebased/checked out. **The notification message will be the rest of the paragraph following the prefix.**
108106

109107
For example, this commit message:
110108

@@ -122,7 +120,7 @@ Will print:
122120
╘════════════════════════════╛
123121
```
124122

125-
Or:
123+
The message will be delimited by double line break. Single line breaks and other whitespace will be preserved. So that:
126124

127125
````
128126
Rewrite everything.
@@ -143,7 +141,14 @@ Will display:
143141
│ please contact Jeff at dev@null.com. │
144142
│ │
145143
╘══════════════════════════════════════════╛
144+
```
146145
146+
You can run `git-notify since` to test configuration and dry-run the message you've just created locally. For example:
147+
148+
```
149+
git commit -m '@team what's up??'
150+
npx git-notify since HEAD~1 --prefix "@team"
151+
```
147152
148153
### Can I group messages
149154

0 commit comments

Comments
 (0)