You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-18Lines changed: 23 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -5,25 +5,26 @@
5
5
6
6
## What is git-notify?
7
7
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 changesto 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.
9
9
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.
11
11
12
12
```sh
13
13
git commit -m 'git-notify: NEW PERF TOOLING AVAILABLE ...'
14
14
```
15
15
16
+
Later, at a machine far far away:
16
17

17
18
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:
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.
39
38
40
39
### Installing hooks with husky
41
40
@@ -62,18 +61,17 @@ Configure `git-notify` hooks by adding the following `husky` entries to your `pa
62
61
}
63
62
```
64
63
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._
66
65
67
66
## Configuration
68
67
69
-
-`--prefix "\@team:"`
68
+
-`git-notify --prefix "@everyone"`
70
69
- 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...
72
70
- 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`
77
75
- Instead of a fancy banner, displays a simple text message
78
76
79
77
### All parameters
@@ -104,7 +102,7 @@ npx git-notify --help
104
102
105
103
## About formatting
106
104
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.**
108
106
109
107
For example, this commit message:
110
108
@@ -122,7 +120,7 @@ Will print:
122
120
╘════════════════════════════╛
123
121
```
124
122
125
-
Or:
123
+
The message will be delimited by double line break. Single line breaks and other whitespace will be preserved. So that:
126
124
127
125
````
128
126
Rewrite everything.
@@ -143,7 +141,14 @@ Will display:
143
141
│ please contact Jeff at dev@null.com. │
144
142
│ │
145
143
╘══════════════════════════════════════════╛
144
+
```
146
145
146
+
You can run `git-notify since` to test configuration and dry-run the message you've just created locally. For example:
0 commit comments