|
1 |
| -Get Zulip notifications for your Git repositories! |
| 1 | +# Zulip Git integration |
2 | 2 |
|
3 |
| -1. {!create-an-incoming-webhook.md!} |
| 3 | +Get Zulip notifications for pushes to your Git repositories! |
4 | 4 |
|
5 |
| -1. {!download-python-bindings.md!} |
| 5 | +Note that Zulip also offers integrations for [GitHub](./github), |
| 6 | +[GitLab](./gitlab) and various other |
| 7 | +[version control hosting services][other-integrations]. |
6 | 8 |
|
7 |
| -1. {!create-channel.md!} |
| 9 | +{start_tabs} |
8 | 10 |
|
9 |
| -1. {!change-zulip-config-file.md!} |
| 11 | +1. {!create-an-incoming-webhook.md!} |
10 | 12 |
|
11 |
| - You may also need to change the value of `STREAM_NAME`. |
| 13 | +1. {!download-python-bindings.md!} |
12 | 14 |
|
13 |
| - You can specify the branches that will be used for notifications by modifying |
14 |
| - the `commit_notice_destination` function. By default, |
15 |
| - pushes to the `main`, `master`, and `test-post-receive` branches will result in a |
16 |
| - notification. |
| 15 | +1. If your Git server and your Zulip server are on the same machine, |
| 16 | + symlink the `post-receive` hook of your Git repository in your Git |
| 17 | + server by running: |
17 | 18 |
|
18 |
| -1. Symlink `/usr/local/share/zulip/integrations/git/zulip_git_config.py` |
19 |
| - to the `.git/hooks` directory of your Git repository. |
| 19 | + `ln -s {{ integration_path }}/post-receive your-repo.git/hooks/post-receive` |
20 | 20 |
|
21 |
| -1. Symlink `/usr/local/share/zulip/integrations/git/post-receive` |
22 |
| - to the `.git/hooks` directory of your Git repository. |
| 21 | + Otherwise, copy the `post-receive` hook to your Git repository's |
| 22 | + `/hooks` directory. |
| 23 | + |
| 24 | + The `post-receive` hook is triggered on every push to the repository. |
| 25 | + |
| 26 | +1. {!change-zulip-config-file.md!} |
| 27 | + |
| 28 | +1. Copy the config file to the same directory as the `post-receive` hook. |
| 29 | + |
| 30 | + `cp {{ config_file_path }} your-repo.git/hooks` |
23 | 31 |
|
24 | 32 | !!! tip ""
|
25 | 33 |
|
26 |
| - You can test the plugin without changing your `main` branch by |
27 |
| - pushing to the `test-post-receive` branch. |
| 34 | + Use the `test-post-receive` branch to test the integration without |
| 35 | + modifying your `main` branch. |
| 36 | + |
| 37 | +{end_tabs} |
| 38 | + |
| 39 | +### Configuration options |
| 40 | + |
| 41 | +In `{{ config_file_path }}`, you can set: |
| 42 | + |
| 43 | +- The channel where notifications are sent by updating the value of |
| 44 | + `STREAM_NAME`. By default, notifications are sent to a channel named |
| 45 | + "commits". |
| 46 | + |
| 47 | +- Which branches send notifications when pushed by updating the |
| 48 | + `commit_notice_destination` function. By default, pushes to the `main`, |
| 49 | + `master`, and `test-post-receive` branches will result in notifications. |
28 | 50 |
|
29 |
| -{!congrats.md!} |
| 51 | +- The message format used in your Zulip notifications by updating the |
| 52 | + `format_commit_message` function. |
30 | 53 |
|
31 |
| - |
| 54 | +[other-integrations]: ../version-control |
0 commit comments